[GRASSLIST:5593] can't compile v.in.tig.rim in grass5

Hi,
I'm trying to compile rim stuff (s.db.rim, v.db.rim v.in.tig.rim, etc)
for grass5 on Linux 2.4.18-19.8.0 i686 athlon i386 GNU/Linux.

I got s.db.rim and v.db.rim to compile by first compileing rim from
grass4.3 (couldn't find it in the grass-5.0.0 src)

Then I did:
mkdir /usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu
ln -s /usr/lib/librim.a \
/usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu/librim.a

and was then able to get s.db.rim and v.db.rim to compile
in /usr/src/grass-5.0.0/src.garden/grass.rim

BUT THEN...
I did /usr/src/grass-5.0.0/src.garden/grass.tig.rim/gmake5 and wound up
with:

make[2]: Entering directory
`/usr/src/grass-5.0.0/src.garden/grass.tig.rim/v.in.tig.rim/cmd'
gcc -I/usr/src/grass-5.0.0/src/include -g -O2 -c main.c -o
OBJ.i686-pc-linux-gnu/main.o
gcc -L/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu -o
/usr/src/grass-5.0.0/dist.i686-pc-linux-gnu/etc/bin/cmd/v.in.tig.rim
OBJ.i686-pc-linux-gnu/main.o -lgis
/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu/libgis.a(flate.o):
In function `G_zlib_compress':
/usr/src/grass-5.0.0/src/libes/gis/flate.c:351: undefined reference to
`deflateInit_'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:361: undefined reference to
`deflate'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:368: undefined reference to
`deflateEnd'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:373: undefined reference to
`deflateEnd'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:393: undefined reference to
`deflateEnd'
/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu/libgis.a(flate.o):
In function `G_zlib_expand':
/usr/src/grass-5.0.0/src/libes/gis/flate.c:424: undefined reference to
`inflateInit_'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:431: undefined reference to
`inflate'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:445: undefined reference to
`inflateEnd'
/usr/src/grass-5.0.0/src/libes/gis/flate.c:453: undefined reference to
`inflateEnd'
collect2: ld returned 1 exit status
make[2]: ***
[/usr/src/grass-5.0.0/dist.i686-pc-linux-gnu/etc/bin/cmd/v.in.tig.rim]
Error 1

Is there some equivalent to v.in.tig.rim ? It seem like the easiest way
to import TIGER data.

thanks,
Phil

Philipp Molzer wrote:

I'm trying to compile rim stuff (s.db.rim, v.db.rim v.in.tig.rim, etc)
for grass5 on Linux 2.4.18-19.8.0 i686 athlon i386 GNU/Linux.

I got s.db.rim and v.db.rim to compile by first compileing rim from
grass4.3 (couldn't find it in the grass-5.0.0 src)

Then I did:
mkdir /usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu
ln -s /usr/lib/librim.a \
/usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu/librim.a

and was then able to get s.db.rim and v.db.rim to compile
in /usr/src/grass-5.0.0/src.garden/grass.rim

BUT THEN...
I did /usr/src/grass-5.0.0/src.garden/grass.tig.rim/gmake5 and wound up
with:

make[2]: Entering directory
`/usr/src/grass-5.0.0/src.garden/grass.tig.rim/v.in.tig.rim/cmd'
gcc -I/usr/src/grass-5.0.0/src/include -g -O2 -c main.c -o
OBJ.i686-pc-linux-gnu/main.o
gcc -L/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu -o
/usr/src/grass-5.0.0/dist.i686-pc-linux-gnu/etc/bin/cmd/v.in.tig.rim
OBJ.i686-pc-linux-gnu/main.o -lgis
/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu/libgis.a(flate.o):
In function `G_zlib_compress':
/usr/src/grass-5.0.0/src/libes/gis/flate.c:351: undefined reference to
`deflateInit_'

Is there some equivalent to v.in.tig.rim ? It seem like the easiest way
to import TIGER data.

The module hasn't been kept up-to-date.

You can fix the immediate problem above by adding $(XDRLIB) to the
link command in src.garden/grass.tig.rim/v.in.tig.rim/cmd/Gmakefile,
i.e.:

  $(CC) $(LDFLAGS) -o $@ main.o $(GISLIB) $(XDRLIB)

However, there may be other things which need to be updated.

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

Thanks,
I got everything compiled and moved into the various appropriate directories (scripts,etc/bin/cmd, bin, scripts ...) but am still having problems:

I try: (tried zone=T18 but got an error, so went with zone=18)
v.in.tig.rim dbname=34013 in1file=TGR34013.RT1 in2file=TGR34013.RT2 zone=18
You must be in GRASS4 to run this program.

Seems like I'm being sent to
v.in.tg.rm.sh 34013 TGR34013.RT1 TGR34013.RT2 18

so I do:
export MAPSET=state1
export GISDBASE=/home/pmolzer/grassdata
export LOCATION_NAME=njstat1
export GRASS_GUI=text

this gets me past the GRASS4 test.

The script then dumps me into the rim shell, but unable to interact, so I have to kill the v.db.rim process. Neither ESC-Enter or C-c work, nor do any of the rim commands.

v.db.rim seems to work fine in ineractive mode,
but I think that this part of v.in.tg.rm.sh:
# Build new data base
v.db.rim $DB << EOF
.in $ETC/db.layout
.ex
EOF

is causing me to get hung up.

Has the syntax changed for non-interactive mode and, if so, what is it?

thanks,
Phil

Glynn Clements wrote:

Philipp Molzer wrote:

I'm trying to compile rim stuff (s.db.rim, v.db.rim v.in.tig.rim, etc)
for grass5 on Linux 2.4.18-19.8.0 i686 athlon i386 GNU/Linux.

I got s.db.rim and v.db.rim to compile by first compileing rim from
grass4.3 (couldn't find it in the grass-5.0.0 src)

Then I did:
mkdir /usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu
ln -s /usr/lib/librim.a \
/usr/src/grass-5.0.0/src.related/rim/LIB.i686-pc-linux-gnu/librim.a

and was then able to get s.db.rim and v.db.rim to compile
in /usr/src/grass-5.0.0/src.garden/grass.rim

BUT THEN...
I did /usr/src/grass-5.0.0/src.garden/grass.tig.rim/gmake5 and wound up
with:

make[2]: Entering directory
`/usr/src/grass-5.0.0/src.garden/grass.tig.rim/v.in.tig.rim/cmd'
gcc -I/usr/src/grass-5.0.0/src/include -g -O2 -c main.c -o
OBJ.i686-pc-linux-gnu/main.o
gcc -L/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu -o
/usr/src/grass-5.0.0/dist.i686-pc-linux-gnu/etc/bin/cmd/v.in.tig.rim
OBJ.i686-pc-linux-gnu/main.o -lgis
/usr/src/grass-5.0.0/src/libes/LIB.i686-pc-linux-gnu/libgis.a(flate.o):
In function `G_zlib_compress':
/usr/src/grass-5.0.0/src/libes/gis/flate.c:351: undefined reference to
`deflateInit_'
   
Is there some equivalent to v.in.tig.rim ? It seem like the easiest way
to import TIGER data.
   
The module hasn't been kept up-to-date.

You can fix the immediate problem above by adding $(XDRLIB) to the
link command in src.garden/grass.tig.rim/v.in.tig.rim/cmd/Gmakefile,
i.e.:

$(CC) $(LDFLAGS) -o $@ main.o $(GISLIB) $(XDRLIB)

However, there may be other things which need to be updated.