[GRASS-dev] [bug #4519] (grass) errors in Grass 55 build

pkelly wrote (Mon, Jul 24 2006 17:06:35):

OK I think I have fixed those in the 5.5 CVS HEAD (apart from the C++ errors
in r.terraflow which I don't have a clue about).

Allright, mostly OK. Only src.contrib/SDTS still fails (and the r.terraflow,
but since you can't help it let's leave this aside for a moment):

$ gmake55 src.contrib/SDTS
  SRC = /home/shoofi/src/straight/grass/src
  CMD = /home/shoofi/src/straight/grass/src/CMD
  UNUSED = /home/shoofi/src/straight/grass/unused
  HEADER = head.i686-pc-linux-gnu
  ARCH = i686-pc-linux-gnu
  GISBASE = /home/shoofi/src/straight/grass/dist.i686-pc-linux-gnu
  VERSION = 5.5-cvs 2004
#################################################################
/home/shoofi/src/straight/grass/src.contrib/SDTS
  make -f OBJ.i686-pc-linux-gnu/make.rules

/home/shoofi/bin/gmake55 ./libes/fips123
  SRC = /home/shoofi/src/straight/grass/src
  CMD = /home/shoofi/src/straight/grass/src/CMD
  UNUSED = /home/shoofi/src/straight/grass/unused
  HEADER = head.i686-pc-linux-gnu
  ARCH = i686-pc-linux-gnu
  GISBASE = /home/shoofi/src/straight/grass/dist.i686-pc-linux-gnu
  VERSION = 5.5-cvs 2004
#################################################################
/home/shoofi/src/straight/grass/src.contrib/SDTS/libes/fips123
  make -f OBJ.i686-pc-linux-gnu/make.rules

make[1]: Entering directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/libes/fips123'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/libes/fips123'
/home/shoofi/bin/gmake55 ./mapdev/v.out.sdts
  SRC = /home/shoofi/src/straight/grass/src
  CMD = /home/shoofi/src/straight/grass/src/CMD
  UNUSED = /home/shoofi/src/straight/grass/unused
  HEADER = head.i686-pc-linux-gnu
  ARCH = i686-pc-linux-gnu
  GISBASE = /home/shoofi/src/straight/grass/dist.i686-pc-linux-gnu
  VERSION = 5.5-cvs 2004
#################################################################
/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts
  make -f OBJ.i686-pc-linux-gnu/make.rules

make[1]: Entering directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
gcc -I/home/shoofi/src/straight/grass/src/include
-I../../libes/fips123/f123inc -g -O2 -c v.out.sdts.c -o
OBJ.i686-pc-linux-gnu/v.out.sdts.o
In file included from v.out.sdts.c:30:
globals.h:30: error: conflicting types for 'Ddr_elem'
externs.h:30: error: previous declaration of 'Ddr_elem' was here
globals.h:62: error: conflicting types for 'Mod'
externs.h:29: error: previous declaration of 'Mod' was here
make[1]: *** [OBJ.i686-pc-linux-gnu/v.out.sdts.o] Error 1
make[1]: Leaving directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
make: *** [all] Error 2

But the modules compiled OK for me so I think the problem might be that your
compiler settings are too strict. Some of the GRASS code is very old and
conforms to Kernighan & Ritchie style instead of ANSI C. That may or may not
be considered a bug but you should be able to configure your compiler to
accept it.

I'm not using any custom compiler/linker options. I'm relying on a default,
just doing:

./configure --with-cxx --without-odbc
--with-tcltk-includes="/usr/include/tcl8.4/"
--with-postgres-includes="/usr/include/postgresql/" --with-freetype
--with-freetype-includes="/usr/include/freetype2/" --with-readline

then make

Maybe the issue is my GCC version - 4.0.3?

Maciek

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

Maciek Sieczka via RT wrote:

pkelly wrote (Mon, Jul 24 2006 17:06:35):

OK I think I have fixed those in the 5.5 CVS HEAD (apart from the C++ errors
in r.terraflow which I don't have a clue about).

Allright, mostly OK. Only src.contrib/SDTS still fails (and the r.terraflow,
but since you can't help it let's leave this aside for a moment):

[...]

make[1]: Entering directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
gcc -I/home/shoofi/src/straight/grass/src/include
-I../../libes/fips123/f123inc -g -O2 -c v.out.sdts.c -o
OBJ.i686-pc-linux-gnu/v.out.sdts.o
In file included from v.out.sdts.c:30:
globals.h:30: error: conflicting types for 'Ddr_elem'
externs.h:30: error: previous declaration of 'Ddr_elem' was here
globals.h:62: error: conflicting types for 'Mod'
externs.h:29: error: previous declaration of 'Mod' was here
make[1]: *** [OBJ.i686-pc-linux-gnu/v.out.sdts.o] Error 1
make[1]: Leaving directory
`/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
make: *** [all] Error 2

OK well I don't see an easy answer to this so I have reverted my earlier change. It obviously hasn't been a problem up to now - it looks like it is something to do with your compiler being pedantic about not allowing arrays of structs or something, but I'm really not very sure and don't think it is worth fixing.

Maybe Glynn will have a clue as I see he made some changes to the relevant files in 2001.

Paul

Paul Kelly wrote:

>>OK I think I have fixed those in the 5.5 CVS HEAD (apart from the C++ errors
>>in r.terraflow which I don't have a clue about).
>
>
> Allright, mostly OK. Only src.contrib/SDTS still fails (and the r.terraflow,
> but since you can't help it let's leave this aside for a moment):
>
[...]
> make[1]: Entering directory
> `/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
> gcc -I/home/shoofi/src/straight/grass/src/include
> -I../../libes/fips123/f123inc -g -O2 -c v.out.sdts.c -o
> OBJ.i686-pc-linux-gnu/v.out.sdts.o
> In file included from v.out.sdts.c:30:
> globals.h:30: error: conflicting types for 'Ddr_elem'
> externs.h:30: error: previous declaration of 'Ddr_elem' was here
> globals.h:62: error: conflicting types for 'Mod'
> externs.h:29: error: previous declaration of 'Mod' was here
> make[1]: *** [OBJ.i686-pc-linux-gnu/v.out.sdts.o] Error 1
> make[1]: Leaving directory
> `/home/shoofi/src/straight/grass/src.contrib/SDTS/mapdev/v.out.sdts'
> make: *** [all] Error 2

OK well I don't see an easy answer to this so I have reverted my earlier
change. It obviously hasn't been a problem up to now - it looks like it
is something to do with your compiler being pedantic about not allowing
arrays of structs or something, but I'm really not very sure and don't
think it is worth fixing.

Maybe Glynn will have a clue as I see he made some changes to the
relevant files in 2001.

It's because the declaration of Ddr_elem uses "struct SDTS_ddr_elems"
before the structure is defined, while the definition uses it
afterwards. The two types are technically different types, resulting
in a "conflicting types" error.

The fix is to put the structure definitions before any variable
declarations or definitions which use them.

--
Glynn Clements <glynn@gclements.plus.com>

Maciej Sieczka wrote:

Sorry if abusing you, but do you possibly have also a clue about the
r.terraflow build error?

No. Although most non-trivial r.terraflow errors boil down to the
r.terraflow code assuming a specific version of GCC which differs from
the one actually being used.

--
Glynn Clements <glynn@gclements.plus.com>