[GRASS5] compiling on IRIX 6.5 with gcc 3.0

Hi,

i just finished a compiling run on IRIX 6.5 with gcc 3.0.
I have several important problems:

d.area:
Gmakefile uses install -D, which is no valid option on IRIX, Solaris
etc. Not to the native BSD install from IRIX, nor to the freeware GNU
install. Without -D it seems to work.

s.hull:
on Solaris some problems with -lm in the library dependency line, should
be removed and changed to $(MATHLIB) on the compile line.

XDRIVER:
Does not compile on IRIX and Solaris due to missing library for
'setenv'. Which library this is referenced in?

grass.postgresql:
libpq-fe.h is not found, although ./configure does not issue any
warnings.
OK, this may be from the manual editing of the header (see below).

NVIZ2.2:
nvizAppInit.c: tk.h: No such file or directory
In file included from nvizAppInit.c:8:
togl.h:92:17: tcl.h: No such file or directory
togl.h:93:16: tk.h: Error 0
In file included from nvizAppInit.c:8:
togl.h:150: parse error before '*' token

(on IRIX and Solaris/SPARC).
On IRIX it compiles with -I/usr/freeware/include added to the include
line.
But gives many many compiling warnings.

I'll upload the output of ./configure etc. to:
http://mitglied.tripod.de/AndreasLange/igrass/index.html

On IRIX i had to change the line
# COMPILE_FLAGS = -g -O2 -I/usr/freeware/include
to
COMPILE_FLAGS = -g -O2
otherwise the compilation of flate.c in the gis lib fails with the
following error:
  SRC = /disk2/opt/grass/grass/src
  CMD = /disk2/opt/grass/grass/src/CMD
  UNUSED = /disk2/opt/grass/grass/unused
  HEADER = head.mips-sgi-irix6.5
  ARCH = mips-sgi-irix6.5
  GISBASE = /disk2/opt/grass/grass/dist.mips-sgi-irix6.5
  VERSION = 5.0.0pre2 September 2001
#################################################################
/disk2/opt/grass/grass/src/libes/gis
  make -f OBJ.mips-sgi-irix6.5/make.rules

gcc -g -O2 -I/usr/freeware/include
-I/disk2/opt/grass/grass/src/include -c flate.c -o
OBJ.mips-sgi-irix6.5/flate.o
flate.c: In function `break_compile':
flate.c:123: `NULL' undeclared (first use in this function)
flate.c:123: (Each undeclared identifier is reported only once
flate.c:123: for each function it appears in.)
make: *** [OBJ.mips-sgi-irix6.5/flate.o] Error 1

For the png-modules i have to add:
-I/usr/include/freeware
and -lm to -lpng to get them to compile.

I think that on IRIX -I/usr/freeware/include should be added to all
libraries instead of to the gcc line.

I hope someone can make something out of my description, i'll be
out/offline some days from now on.

cu,

Andreas
--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
url: http://mitglied.tripod.de/AndreasLange
mail: Andreas.Lange_at_Rhein-Main.de - A.C.Lange_at_GMX.net

Andreas Lange wrote:

i just finished a compiling run on IRIX 6.5 with gcc 3.0.
I have several important problems:

d.area:
Gmakefile uses install -D, which is no valid option on IRIX, Solaris
etc. Not to the native BSD install from IRIX, nor to the freeware GNU
install. Without -D it seems to work.

This should probably just use "cp".

s.hull:
on Solaris some problems with -lm in the library dependency line, should
be removed and changed to $(MATHLIB) on the compile line.

Agreed; will do.

XDRIVER:
Does not compile on IRIX and Solaris due to missing library for
'setenv'. Which library this is referenced in?

It appears to be a BSD function. It's present in GNU libc, but I'm
guessing that other systems might need -lbsd/-lcompat/-lbsd-compat.
I'll change it to use putenv(), which is a POSIX function.

grass.postgresql:
libpq-fe.h is not found, although ./configure does not issue any
warnings.
OK, this may be from the manual editing of the header (see below).

Huh?

NVIZ2.2:
nvizAppInit.c: tk.h: No such file or directory
In file included from nvizAppInit.c:8:
togl.h:92:17: tcl.h: No such file or directory
togl.h:93:16: tk.h: Error 0
In file included from nvizAppInit.c:8:
togl.h:150: parse error before '*' token

Did the Tcl/Tk configure checks pass?

(on IRIX and Solaris/SPARC).
On IRIX it compiles with -I/usr/freeware/include added to the include
line.
But gives many many compiling warnings.

I'll upload the output of ./configure etc. to:
http://mitglied.tripod.de/AndreasLange/igrass/index.html

I'll take a look.

On IRIX i had to change the line
# COMPILE_FLAGS = -g -O2 -I/usr/freeware/include
to
COMPILE_FLAGS = -g -O2
otherwise the compilation of flate.c in the gis lib fails with the
following error:
  SRC = /disk2/opt/grass/grass/src
  CMD = /disk2/opt/grass/grass/src/CMD
  UNUSED = /disk2/opt/grass/grass/unused
  HEADER = head.mips-sgi-irix6.5
  ARCH = mips-sgi-irix6.5
  GISBASE = /disk2/opt/grass/grass/dist.mips-sgi-irix6.5
  VERSION = 5.0.0pre2 September 2001
#################################################################
/disk2/opt/grass/grass/src/libes/gis
  make -f OBJ.mips-sgi-irix6.5/make.rules

gcc -g -O2 -I/usr/freeware/include
-I/disk2/opt/grass/grass/src/include -c flate.c -o
OBJ.mips-sgi-irix6.5/flate.o
flate.c: In function `break_compile':
flate.c:123: `NULL' undeclared (first use in this function)
flate.c:123: (Each undeclared identifier is reported only once
flate.c:123: for each function it appears in.)
make: *** [OBJ.mips-sgi-irix6.5/flate.o] Error 1

This occurs if HAVE_ZLIB_H is undefined.

Does /usr/freeware/include contain a file called config.h? That would
break stuff.

The CFLAGS definition in the generated make.rules file is wrong:

CFLAGS = $(COMPILE_FLAGS) -I$(INCLUDE_DIR) $(EXTRA_CFLAGS) $(USE_TERMIO)

For gcc, the "-I$(INCLUDE_DIR)" should come first.

For the png-modules i have to add:
-I/usr/include/freeware
and -lm to -lpng to get them to compile.

PNGLIB should include -lm and/or -lz if either of these have to be
specified explicitly.

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

Andreas Lange wrote:

I'll upload the output of ./configure etc. to:
http://mitglied.tripod.de/AndreasLange/igrass/index.html

The only files which I can find there indicate the use of an old
version of GRASS (prior to the last batch of configure changes).

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

Hi Glynn, Hi all,

good news: GRASS now compiles out of the box on IRIX 6.5 (with one
exception, see below).

I used the the following configure line:
#!/usr/freeware/bin/bash
./configure \
--with-postgres \
--with-libs=/usr/freeware/lib32 \
--with-includes=/usr/freeware/include \
--with-odbc-libs=/usr/local/lib \
--with-odbc-includes=/usr/local/include \
--with-fftw-libs=/usr/local/lib \
--with-fftw-includes=/usr/local/include \
--with-blas=no \
--with-lapack=no \
--with-freetype=no
#--with-freetype-libs=/usr/local/lib \
#--with-freetype-includes=/usr/local/include

freetype is not installed properly, so i could not compile.

There is a file "config.h" in /usr/freeware/include, which breaks the
compiling of the gis lib. If i rename this file, the postgresql modules
no longer compile. But i consider this a bug of the postgresql
installation on IRIX. If i rename the file to the original config.h the
postgresql modules compile.

I'll do some testing in the next days, but will report only failure of
modules, not success.
If there is interest in the binary tarball, please tell me. The
compressed binary package is approx. 50 MB _after_ stripping. But i
think that the binary distribution should be compiled with the SGI MIPS
PRO compiler to get more optimized binaries.

cu,

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
url: http://mitglied.tripod.de/AndreasLange
mail: Andreas.Lange_at_Rhein-Main.de - A.C.Lange_at_GMX.net

Andreas Lange wrote:

There is a file "config.h" in /usr/freeware/include, which breaks the
compiling of the gis lib.

What version (as in "cvs status") of src/CMD/generic/make.mid do you
have?

I recently changed it to have:

CFLAGS = -I$(INCLUDE_DIR) $(COMPILE_FLAGS) $(EXTRA_CFLAGS) $(USE_TERMIO)

This should force src/include to be searched before any other
directories, provided that you're using gcc:

`-IDIR'
     Add the directory DIR to the head of the list of directories to be
     searched for header files. This can be used to override a system
     header file, substituting your own version, since these
     directories are searched before the system header file
     directories. If you use more than one `-I' option, the
     directories are scanned in left-to-right order; the standard
     system directories come after.

If there is interest in the binary tarball, please tell me. The
compressed binary package is approx. 50 MB _after_ stripping. But i
think that the binary distribution should be compiled with the SGI MIPS
PRO compiler to get more optimized binaries.

Do you know how that compiler handles -I switches? If there is at
least one compiler which is known to process -I switches
right-to-left, some part of the build process needs to handle CFLAGS
appropriately.

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