[GRASS5] snprintf and other compile errors on IRIX

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue Apr 23 08:13:50 EDT 2002


Hello
I am running GRASS on two slightly out-of-date IRIX installations (6.2 and
6.4---nothing I can do about this!) and everytime I update our GRASS
installation it seems even more modules are failing due to the snprintf
function being used in them. I don't know that much about libraries but it
is not in the standard ones that come with IRIX. I have got round the
problem by downloading a 3rd party libsnprintf library, compiled and
installed that and then I have to manually change the Gmakefile for all
the failed modules, adding in the exact path to libsnprintf.a at the end
of the compiler line in the makefile; it is nearly always after
$(XDRLIB) or $(MATHLIB).

This works fine but it is very tedious. I was wondering could the
makefiles be changed for those modules that include snprintf in their code
(list is below) to perhaps have another variable specifically referring to
a 3rd party snprintf library at the end of the line after ($XDRLIB). [The
snprintf library could even be included with GRASS to make it transparent
to the end user], or else it could be specifed as an option to the
configure script (probably a better idea if it only applies to very few
platforms). Has anybody else had this problem and would it be as easy to
fix as what I have suggested?

Below is a list of the modules with the snprintf problem.

src/libes/dbmi/clients
src/display/d.db
src/display/d.profile
src/display/d.site.labels
src/display/d.vect.labels
src/display/d.what.db
src/display/d.what.vect
src/imagery/i.tape.tm.fast
src/mapdev/v.db.reclass
src/mapdev/v.in.mif
src/mapdev/v.in.shape
src/mapdev/v.mkgrid
src/mapdev/v.out.shape
src/mapdev/v.to.db
src/mapdev/v.transform
src/raster/r.in.shape
src/sites/s.in.dbf
src/sites/s.qcount
src/sites/s.to.rast
src/sites/s.to.vect
src.contrib/GMSL/NVIZ2.2

I found the following errors in addition to use of snprintf:

Compilation error in module: src/paint/p.vrml1.1 (ignored) 
fixed by adding prototype void vrml_putline(int, FILE *, char *); at start
of vrml.c

Compilation error in module: src/sites/s.hull (ignored) 
has some // c++ style comments which my compiler rejects; just needed to
change these to /* */

Compilation error in module: src.contrib/GMSL/NVIZ2.2 (ignored)
as well as the snprintf problem needed to remove newline between lines 232
and 233 in NVIZ2.2/src/nviz_int.c

And the following modules had errors I couldn't fix

Compilation error in module: src/mapdev/v.in.mif (ignored) 

cc -I/indigo-disk2/grass/grass/src/include -g
-I/indigo-disk2/grass/doom.ee.qub.ac.uk/include   -c lex.yy.c -o
OBJ.mips-sgi-irix6.2/lex.yy.o
cfe: Error: mif.l, line 572: Syntax Error
        {blank} |
        ------^
make: *** [OBJ.mips-sgi-irix6.2/lex.yy.o] Error 1

Compilation error in module: src/raster/r.fill.dir (ignored) 

cc -I/indigo-disk2/grass/grass/src/include -g
-I/indigo-disk2/grass/doom.ee.qub.ac.uk/include   -c wtrshed.c -o
OBJ.mips-sgi-irix6.2/wtrshed.o
cfe: Error: wtrshed.c, line 67: missing size for array 'dir'
    struct whereandwhat dir[mxbuf];
 -----------------------^
cfe: Error: wtrshed.c, line 67: storage size for 'dir' isn't known
    struct whereandwhat dir[mxbuf];
 -----------------------^
cfe: Error: wtrshed.c, line 67: Invalid constant expression.
    struct whereandwhat dir[mxbuf];
 ---------------------------^
cfe: Error: wtrshed.c, line 68: missing size for array 'bas'
    struct whereandwhat bas[mxbuf];
 -----------------------^
cfe: Error: wtrshed.c, line 68: storage size for 'bas' isn't known
    struct whereandwhat bas[mxbuf];
 -----------------------^
make: *** [OBJ.mips-sgi-irix6.2/wtrshed.o] Error 1

Compilation error in module: src/raster/r.in.gdal (ignored) 

cc -L/indigo-disk2/grass/grass/src/libes/LIB.mips-sgi-irix6.2
-L/indigo-disk2/grass/doom.ee.qub.ac.uk/lib -o
/indigo-disk2/grass/grass/dist.mips-sgi-irix6.2/etc/bin/cmd/r.in.gdal
OBJ.mips-sgi-irix6.2/main.o OBJ.mips-sgi-irix6.2/gbgetsymbol.o
OBJ.mips-sgi-irix6.2/gdalbridge.o OBJ.mips-sgi-irix6.2/make_loc.o \
         -lgis -lI -lproj -lm  -lz  
ld: ERROR 33: Unresolved text symbol "GBGetSymbol" -- 1st referenced by
OBJ.mips-sgi-irix6.2/gdalbridge.o.
ld: INFO 152: Output file removed because of error.
make: ***
[/indigo-disk2/grass/grass/dist.mips-sgi-irix6.2/etc/bin/cmd/r.in.gdal]
Error 1


I hope this information may be of some use to somebody

Paul





More information about the grass-dev mailing list