re[2]: New problem compiling grass5.0beta7

Hi Markus,

Well the problems continue. I made all the changes you suggested but still received the following error message, which on brief glance looks exactly like the message I received before:

if [ ! -d /usr/local/grass-5.0b ]; then mkdir /usr/local/grass-5.0b ; fi
if [ ! -d src/CMD/next_step ]; then mkdir src/CMD/next_step ; fi
UNIX_BIN=/usr/local/bin SRC=`pwd` GISBASE=/usr/local/grass-5.0b MACHINENAME=`una
me -n` /bin/sh src/CMD/generic/CREATE_GMAKE.sh
mkdir -p -m 755 /usr/local/grass-5.0b
/bin/sh `pwd`/src/CMD/generic/is64bit.sh
echo "Now proceed with make install"
Now proceed with make install
GRASSSRC=`pwd`/src GMAKE=`pwd`/src/CMD/gmake5.0 /bin/sh src/CMD/generic/GISGEN.s
h
GISBASE=/usr/local/grass-5.0b
SRC=/usr/local/grass5.0beta/src
CMD=/usr/local/grass5.0beta/src/CMD
HEADER=head
ARCH=i686-linux-elf
####################################################################
GISGEN Tue Apr 25 19:16:51 PDT 2000
GISBASE = /usr/local/grass-5.0b
SRC = /usr/local/grass5.0beta/src
CMD = /usr/local/grass5.0beta/src/CMD
HEADER = head
ARCH = i686-linux-elf

first step: src/raster/r.binfer

GISGEN: src/raster/r.binfer - Tue Apr 25 19:16:51 PDT 2000

  make -f OBJ.i686-linux-elf/make.rules

make[1]: Entering directory `/usr/local/grass5.0beta/src/raster/r.binfer'
rm -f lex.c gram.c
yacc binfer.y
rm -f gram.c
mv y.tab.c gram.c
rm -f OBJ.i686-linux-elf/gram.o
gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c gram.c
mv gram.o OBJ.i686-linux-elf/gram.o
lex binfer.l
rm -f lex.c
mv lex.yy.c lex.c
rm -f OBJ.i686-linux-elf/lex.o
gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c lex.c
binfer.l:41: redefinition of `yylineno'
lex.c:271: `yylineno' previously defined here
make[1]: *** [OBJ.i686-linux-elf/lex.o] Error 1
make[1]: Leaving directory `/usr/local/grass5.0beta/src/raster/r.binfer'
GISGEN failure at STEP: src/raster/r.binfer
make: *** [do-install] Error 1

  >> Hi Skip,

  >> you find all traps existing in GRASS 5 :slight_smile:

  >> This is a problem I had, too, and yesterday I
  >> may have found the solution.

  >> Store attached file binfer.l in
  >> src/raster/r.binfer

  >> and proceed with
  >> make install

  >> Please tell me if compiling now.

  >> Thanks

  >> Markus

  >> On Mon, Apr 24, 2000 at 04:19:05PM -0700, Skip wrote:
  >> > Hi Markus,
  >> >
  >> > I installed the flex package as you indicated. Yacc was already
  >> installed. However, I still had the compile stop before completing. This
  >> is the error message produced:
  >> >
  >> > if [ ! -d /usr/local/grass-5.0b ]; then mkdir /usr/local/grass-5.0b ; fi
  >> > if [ ! -d src/CMD/next_step ]; then mkdir src/CMD/next_step ; fi
  >> > UNIX_BIN=/usr/bin SRC=`pwd` GISBASE=/usr/local/grass-5.0b
  >> MACHINENAME=`uname -n`
  >> > /bin/sh src/CMD/generic/CREATE_GMAKE.sh
  >> > mkdir -p -m 755 /usr/local/grass-5.0b
  >> > /bin/sh `pwd`/src/CMD/generic/is64bit.sh
  >> > echo "Now proceed with make install"
  >> > Now proceed with make install
  >> > GRASSSRC=`pwd`/src GMAKE=`pwd`/src/CMD/gmake5.0 /bin/sh
  >> src/CMD/generic/GISGEN.s
  >> > h
  >> > GISBASE=/usr/local/grass-5.0b
  >> > SRC=/usr/local/grass5.0beta/src
  >> > CMD=/usr/local/grass5.0beta/src/CMD
  >> > HEADER=head
  >> > ARCH=i686-linux-elf
  >> > ####################################################################
  >> > GISGEN Mon Apr 24 12:41:46 PDT 2000
  >> > GISBASE = /usr/local/grass-5.0b
  >> > SRC = /usr/local/grass5.0beta/src
  >> > CMD = /usr/local/grass5.0beta/src/CMD
  >> > HEADER = head
  >> > ARCH = i686-linux-elf
  >> >
  >> > first step: src/raster/r.binfer
  >> >
  >> > GISGEN: src/raster/r.binfer - Mon Apr 24 12:41:46 PDT 2000
  >> >
  >> > make -f OBJ.i686-linux-elf/make.rules
  >> >
  >> > make[1]: Entering directory
  >> `/usr/local/grass5.0beta/src/raster/r.binfer'
  >> > rm -f lex.c gram.c
  >> > yacc binfer.y
  >> > rm -f gram.c
  >> > mv y.tab.c gram.c
  >> > rm -f OBJ.i686-linux-elf/gram.o
  >> > gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c gram.c
  >> > mv gram.o OBJ.i686-linux-elf/gram.o
  >> > lex binfer.l
  >> > rm -f lex.c
  >> > mv lex.yy.c lex.c
  >> > rm -f OBJ.i686-linux-elf/lex.o
  >> > gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c lex.c
  >> > binfer.l:41: redefinition of `yylineno'
  >> > lex.c:271: `yylineno' previously defined here
  >> > make[1]: *** [OBJ.i686-linux-elf/lex.o] Error 1
  >> > make[1]: Leaving directory `/usr/local/grass5.0beta/src/raster/r.binfer'
  >> > GISGEN failure at STEP: src/raster/r.binfer
  >> > make: *** [do-install] Error 1
  >> >
  >> > >> Hi Skip,
  >> >
  >> >
  >> > >> On Mon, Apr 24, 2000 at 07:40:10AM -0700, Skip wrote:
  >> >
  >> > >> >
  >> #################################################################
  >> > >> > /usr/local/grass5.0beta/src/raster/r.binfer
  >> > >> > mkdir OBJ.i686-linux-elf
  >> > >> > make -f OBJ.i686-linux-elf/make.rules
  >> > >> >
  >> > >> > make[1]: Entering directory
  >> > >> `/usr/local/grass5.0beta/src/raster/r.binfer'
  >> > >> > rm -f lex.c gram.c
  >> > >> > yacc binfer.y
  >> > >> > rm -f gram.c
  >> > >> > mv y.tab.c gram.c
  >> > >> > rm -f OBJ.i686-linux-elf/gram.o
  >> > >> > gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c gram.c
  >> > >> > mv gram.o OBJ.i686-linux-elf/gram.o
  >> > >> > lex binfer.l
  >> > >> > make[1]: lex: Command not found
  >> >
  >> > >> ... this is easy: just install the "lex/flex" program. Using
  >> > >> SuSe use "YAST" to install "flex" and "yacc". lex is a requirement
  >> > >> to build GRASS.
  >> > >> Then run again
  >> >
  >> > >> configure
  >> > >> make install
  >> >
  >> > >> Hope this helps
  >> >
  >> > >> Markus
  >> >
  >> >
  >> >
  >> >
  >> >
  >> >
  >> > =================================
  >> > Skip Haak
  >> > Natural Resource Solutions
  >> > 950 Lloyd Center, Suite 48
  >> > Portland, OR 97232
  >> > Office: (503) 460-3198
  >> > Mobile: (503) 998-3267
  >> > Facsimile: (503) 460-3230
  >> > E-mail: shaak@teleport.com

  >> --
  >> Dipl.-Geogr. Markus Neteler * University of Hannover
  >> Institute of Physical Geography and Landscape Ecology
  >> Schneiderberg 50 * D-30167 Hannover * Germany
  >> Tel: ++49-(0)511-762-4494 Fax: -3984

  >> -- NextPart --
  >> Attached File: c:\goldmine\MailBox\Attach\binfer.l

=================================
Skip Haak
Natural Resource Solutions
950 Lloyd Center, Suite 48
Portland, OR 97232
Office: (503) 460-3198
Mobile: (503) 998-3267
Facsimile: (503) 460-3230
E-mail: shaak@teleport.com

Skip wrote:

Hi Markus,

Well the problems continue. I made all the changes you suggested but still received the following error message, which on brief glance looks exactly like the message I received before:

[...]

make[1]: Entering directory `/usr/local/grass5.0beta/src/raster/r.binfer'
rm -f lex.c gram.c
yacc binfer.y
rm -f gram.c
mv y.tab.c gram.c
rm -f OBJ.i686-linux-elf/gram.o
gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c gram.c
mv gram.o OBJ.i686-linux-elf/gram.o
lex binfer.l
rm -f lex.c
mv lex.yy.c lex.c
rm -f OBJ.i686-linux-elf/lex.o
gcc -g -O2 -I/usr/local/grass5.0beta/src/include -c lex.c
binfer.l:41: redefinition of `yylineno'
lex.c:271: `yylineno' previously defined here

The problem with yylineno is that it's an "undocumented feature" of the
original AT&T lexical analyser, but not a part of the ISO standard.
This is why some implementation of lex automaticaly add it, and some
don't.

On linux side, or better said when you use the GNU compiler package,
there is no lex program, but a flex program, that is ISO compliant.
As for many Gnu program, you have an option that made flex to work
like the original lex program (the lex program on linux is simply
a shell script saying "flex -l $*")

It should be also noted that the -l flag also change the output code
produced by flex : yylineno must contain the line number of the input
file of r.binfer, hence producing accurate error message when something
is wrong in it...

Clearly, if you use "lex" or "flex -l", you should not put a line with
"int yylineno=1" in binfer.l. A quick and dirty fix : remove this line
(#41 in binfer.l) and run again gmake5...

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97