[GRASS5] [bug #1382] (grass) r.mapcalc3 compilation error

this bug's URL: http://intevation.de/rt/webrt?serial_num=1382
-------------------------------------------------------------------------

Subject: r.mapcalc3 compilation error

Platform: GNU/Linux/i386
grass obtained from: CVS
grass binary for platform: Compiled from Sources

Hi,

I compiled the today's CVS HEAD (using the new makefile system from
mk/ directory), but got an error in r.mapcalc:

make[1]: Entering directory `/home/neteler/ggg/src/raster/r.mapcalc3'
gcc -L/home/neteler/ggg/src/libes -Wl,-rpath-link,/home/neteler/ggg/src/libes -o /home/neteler/ggg/dist.i686-pc-linux-gnu/etc/bin/cmd/r.mapcalc /home/neteler/ggg/src/raster/r.mapcalc3/y.tab.o /home/neteler/ggg/src/raster/r.mapcalc3/lex.yy.o
[...]
/home/neteler/ggg/src/raster/r.mapcalc3/xsqrt.o /home/neteler/ggg/src/raster/r.mapcalc3/xsub.o /home/neteler/ggg/src/raster/r.mapcalc3/xtan.o -lgrass_gis -lgrass_btree -lgrass_rowio -lreadline -lhistory -lm -lz
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `function':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x2a3): undefined reference to `syntax_error'
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `variable':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x748): undefined reference to `syntax_error'
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `mapname':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x7e6): undefined reference to `syntax_error'
collect2: ld returned 1 exit status
make[1]: *** [/home/neteler/ggg/dist.i686-pc-linux-gnu/etc/bin/cmd/r.mapcalc] Error 1
make[1]: Leaving directory `/home/neteler/ggg/src/raster/r.mapcalc3'

I am using
CC = gcc
FC = g77
LEX = flex
YACC = bison -y
PERL = /usr/bin/perl
MAKE = make

It seems to be a problem with yacc/bison, which does not generate `syntax_error' from the mapcalc.y file.Unfortunaltely I have no idea
how to solve this.

bison --version
GNU Bison version 1.28

Thanks for a hint,

Markus

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

Subject: r.mapcalc3 compilation error

Platform: GNU/Linux/i386
grass obtained from: CVS
grass binary for platform: Compiled from Sources

Hi,

I compiled the today's CVS HEAD (using the new makefile system from
mk/ directory), but got an error in r.mapcalc:

make[1]: Entering directory `/home/neteler/ggg/src/raster/r.mapcalc3'
gcc -L/home/neteler/ggg/src/libes -Wl,-rpath-link,/home/neteler/ggg/src/libes -o /home/neteler/ggg/dist.i686-pc-linux-gnu/etc/bin/cmd/r.mapcalc /home/neteler/ggg/src/raster/r.mapcalc3/y.tab.o /home/neteler/ggg/src/raster/r.mapcalc3/lex.yy.o
[...]
/home/neteler/ggg/src/raster/r.mapcalc3/xsqrt.o /home/neteler/ggg/src/raster/r.mapcalc3/xsub.o /home/neteler/ggg/src/raster/r.mapcalc3/xtan.o -lgrass_gis -lgrass_btree -lgrass_rowio -lreadline -lhistory -lm -lz
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `function':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x2a3): undefined reference to `syntax_error'
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `variable':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x748): undefined reference to `syntax_error'
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o: In function `mapname':
/home/neteler/ggg/src/raster/r.mapcalc3/expression.o(.text+0x7e6): undefined reference to `syntax_error'
collect2: ld returned 1 exit status
make[1]: *** [/home/neteler/ggg/dist.i686-pc-linux-gnu/etc/bin/cmd/r.mapcalc] Error 1
make[1]: Leaving directory `/home/neteler/ggg/src/raster/r.mapcalc3'

It appears that you are trying to build from within the source
directory; I have no idea whether that works.

I am using
CC = gcc
FC = g77
LEX = flex
YACC = bison -y
PERL = /usr/bin/perl
MAKE = make

It seems to be a problem with yacc/bison, which does not generate
`syntax_error' from the mapcalc.y file. Unfortunaltely I have no
idea how to solve this.

What does the bison command look like?

Was the build performed from clean, or were there old files lying
around? Note that:

1. For the "normal" build mechanism, you have to use
"make maintainer-clean" to remove the files which are generated by
lex/yacc; "make distclean" won't work (presumably, the idea is that
source tarballs include the generated C files, so that users don't
need lex/yacc).

2. For the new build mechanism, the "make clean" rule is bogus. It is
designed for use with a separate build directory, so you don't need
"make clean"; just "rm -rf" the entire build directory once you're
finished with it (obviously, you don't do this if the build directory
happens to be the source directory).

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