[GRASSLIST:1883] RE: configuring Grass5.03 on Debian

Glynn,

  The last part of the logfile states:

configure: failed program was:
#line 4793 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid and error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char deflate();

int main() {
deflate()
; return 0; }

If this is a small test program, I don't see what it does. When compiled on
its own, the compiler complains "undefined reference to deflate" and stops.

However, when I add:
  #include <zlib.h>
then it only complains of "too few arguments to function 'deflate'" before it
stops. What is this testing, and how do I get around this?

   Thanks,

            Jim

===== Original Message From Glynn Clements <glynn.clements@virgin.net> =====
Jim Browne wrote:

I am trying to compile Grass5.03 on Debian Linux and the configure script
stops at :
checking for location of zlib library...
checking for deflate in -1z... no

Examine config.log for any applicable error messages.

--
Glynn Clements <glynn.clements@virgin.net>

Jim Browne wrote:

  The last part of the logfile states:

configure: failed program was:

I need to see the lines immediately before that, which will contain
the actual error messages. In general, you should quote everything
related to that check, i.e. from the "checking ..." line down to the
start of the next check (including the first line of the following
check confirms that you really have included everything).

However, given the limited number of things which can go wrong with a
library as simple as zlib, the error is probably "cannot find -lz" (or
something with an equivalent meaning).

In which case, you would need to use --with-zlib-libs=???, where ???
is the directory where zlib (e.g. libz.a, libz.so) resides (e.g.
/usr/local/lib).

However, I find it rather odd that zlib isn't found automatically on a
Linux system. Every Linux system I've ever seen has zlib installed,
and has it in /usr/lib, where the linker will find it without the need
for any -L switches.

On commercial Unices, it is often elsewhere (e.g. /usr/local/lib,
/sw/lib), and non-Unix systems (e.g. Windows/Cygwin or MacOSX) may not
even have it, but it's pretty common nowadays (zlib implements the
"gzip" compression/decompression algorithms).

#line 4793 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid and error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char deflate();

int main() {
deflate()
; return 0; }

If this is a small test program, I don't see what it does.

The compiled object (.o) file will have a dependency upon the
deflate() function, so the program won't link if the deflate()
function isn't available from the libraries against which it is
linked.

The test program is never run; the test only checks whether it is
linked successfully.

When compiled on
its own, the compiler complains "undefined reference to deflate" and stops.

That is to be expected. The actual test will use the -lz switch, and
possibly one or more -L switches (if you used --with-zlib-libs=...).
The deflate() function isn't likely to be in the C library (libc), so
linking won't succeed without additional libraries. The function will
certainly be in zlib, so the only remaining factor is to ensure that
the -lz switch works given whichever -L switches are used.

However, when I add:
  #include <zlib.h>
then it only complains of "too few arguments to function 'deflate'" before it
stops.

That is also to be expected. Given that the program is never actually
run, it only matters that a call to the function occurs. It doesn't
matter whether the call has the correct arguments.

What is this testing, and how do I get around this?

It's testing that programs which depend upon deflate() can be built.
In practice, that means that it's testing whether it can find zlib,
i.e. whether --with-zlib-libs=... is necessary and, if so, that it was
used, and with a suitable argument.

--
Glynn Clements <glynn.clements@virgin.net>

Dear GRASS Users:

I tried to use "s.to.rast" command.

----
Hayashi Shin-ichiro
mail:forest@bres.tsukuba.ac.jp URL:http://ryuiki.agbi.tsukuba.ac.jp/~forest
Watershed Management Lab., University of TSUKUBA

Dear GRASS Users:

Sorry! I send My previous mail with mistake.

I tried to use "s.to.rast" command.
But command said ERROR as follows.

GRASS 5.0.2 > s.to.rast input=const output=const_rast
Using size option: 0
Finding and opening site list...

ERROR: selected decimal field column no. 1 not present in sites list.

My question is "What does this error mean?"

My site data is

name|const
desc|s.in.ascii sites=const input=const_site fs=space
205|435|#1 @1 @ryuroko
245|290|#2 @2 @ryuroko
195|310|#3 @3 @ryuroko
250|235|#4 @4 @ryuroko
270|220|#5 @5 @ryuroko

Please give me your suggestion.
Thank you in advance.
Sincerely yours.

Hayashi Shin-ichiro wrote:

Sorry! I send My previous mail with mistake.

I tried to use "s.to.rast" command.
But command said ERROR as follows.

GRASS 5.0.2 > s.to.rast input=const output=const_rast
Using size option: 0
Finding and opening site list...

ERROR: selected decimal field column no. 1 not present in sites list.

My question is "What does this error mean?"

My site data is

name|const
desc|s.in.ascii sites=const input=const_site fs=space
205|435|#1 @1 @ryuroko
245|290|#2 @2 @ryuroko
195|310|#3 @3 @ryuroko
250|235|#4 @4 @ryuroko
270|220|#5 @5 @ryuroko

The default options are findex=1 and field=decimal. However, field 1
is a category, not a decimal. So, you need to use field=cat, i.e.:

  s.to.rast field=cat input=const output=const_rast

Alternatively, if you aren't interested in the category values, you
can use the -s switch, i.e.

  s.to.rast -s input=const output=const_rast

--
Glynn Clements <glynn.clements@virgin.net>