Compiling Grass 5.0 beta (final) on IRIX6.5

Eric Mitchell emitchell at altaira.com
Wed Mar 8 22:34:16 EST 2000


Ok, I finally managed to start this thing compiling 
under IRIX6.5 using the native cc compiler, and I ran 
into a few minor snags.  Nothing terminal, just some 
gcc specific extensions and a few casting abiguities. 
The diff outputs are included below.  I'm not 100%
certain about some of the changes, but this at least 
compiled and let me get on about my business.

That is, until I got to 
src.contrib/CERL/raster/r.rational.regression,
which looks like its Not Quite Ready for Ansi.
At that point, the compilation dies a horrible 
flaming death. the errors are included after the 
diffs, below.

General comments:

1) The __attribute__ ((__noreturn__)) feature is 
gnu specific, and probably won't work on any other 
compilers.  A check should be added to configure,
and either "#ifdef __GNUC_MINOR__" (as below), or 
do a "#define __attribute__(x)" where unsupported.

2) The configure script should see which *roff is 
installed on the machine.  An "NROFF = @nroff@"
can be thrown in the top level makefile, and man
page processing should be done using "$(NROFF)"

3) The compiler did generate a large number of 
additional warnings, and I have the compilation 
log in its entirety for anyone who may be 
interested that kind of thing.

##################################################################
 emitchell at orion  [/opt/grass/grass5.0beta/src/include]  - 3 >  diff -u gisdefs.h.orig gisdefs.h
--- gisdefs.h.orig      Wed Dec 29 10:10:23 1999
+++ gisdefs.h   Wed Mar  8 20:25:41 2000
@@ -275,7 +275,11 @@
 int G__create_alt_env(void);
 int G__switch_env(void);
 /* error.c */
+#ifdef __GNUC_MINOR__
 int G_fatal_error(char *,...) __attribute__ ((__noreturn__));
+#else
+int G_fatal_error(char *,...);
+#endif
 int G_warning(char *,...);
 int G_suppress_warnings(int);
 int G_sleep_on_error(int);
 emitchell at orion  [/opt/grass/grass5.0beta/src/display/devices/lib]  - 22 >  diff -u SWITCHER.c.orig
SWITCHER.c
--- SWITCHER.c.orig     Wed Mar  8 20:32:29 2000
+++ SWITCHER.c  Wed Mar  8 20:32:52 2000
@@ -556,7 +556,7 @@
                 xarray = (int *) xalloc (xarray, &n_xarray, x, sizeof (*xarray));
                 REC (xarray, x * sizeof (*xarray)) ;
                if (index !=0) index = 1 ;
-               Raster_int(x, y, xarray, index, 1) ;
+               Raster_int(x, y, (unsigned int *) xarray, index, 1) ;
                 break ;
             case RGB_RASTER:
                 REC (&x, sizeof x) ;
@@ -896,10 +896,13 @@
 
 static int rec(void *buf,int n)
 {
+    char *cbuf = buf;
     int stat;
-    while (n-- > 0)
-        if ((stat=get1(((char* )buf)++)) != 0)
+    while (n-- > 0) {
+
+        if ((stat=get1(cbuf++)) != 0)
            return stat; /* EOF or COMMAND_ESC */
+    }
     return 0;
 }
 emitchell at orion  [/opt/grass/grass5.0beta/src/display/devices/lib]  - 32 >  diff -u font.c.orig
font.c 
--- font.c.orig Wed Mar  8 20:36:33 2000
+++ font.c      Wed Mar  8 20:37:22 2000
@@ -115,8 +115,9 @@
 
 static int X_copy (int *a,char *b, int n)
 {
+     char *ca = a;
      while (n-- > 0)
-       (char)*a++ = *b++;
+       *ca++ = *b++;
 
      return 0;
 }
 emitchell at orion  [/opt/grass/grass5.0beta/src/display/d.rast.edit]  - 39 >  diff -u edit.h.orig
edit.h 
--- edit.h.orig Wed Mar  8 20:44:20 2000
+++ edit.h      Wed Mar  8 20:45:02 2000
@@ -62,7 +62,11 @@
 /* main.c */
 int do_edit(int, int, double);
 int error(int, char [128]);
+#ifdef __GNUC_MINOR__
 int ext(void) __attribute__ ((__noreturn__));
+#else
+int ext(void);
+#endif
 /* menu.c */
 int main_menu(void);
 int option_menu(void);
 emitchell at orion  [/opt/grass/grass5.0beta/src/include]  - 46 >  diff -u config.h.gen config.h
--- config.h.gen        Wed Mar  8 20:52:33 2000
+++ config.h    Wed Mar  8 20:52:40 2000
@@ -62,7 +62,7 @@
 /* #undef uid_t */
 
 /* define curses.h WINDOW structure component */
-#define CURSES_MAXY NONE
+#define CURSES_MAXY _maxy
 
 /* define if ftime() exists */
 #define HAVE_FTIME 1
 emitchell at orion  [/opt/grass/grass5.0beta/src/general/g.setproj]  - 53 >  diff -u
local_proto.h.orig local_proto.h
--- local_proto.h.orig  Wed Mar  8 20:55:15 2000
+++ local_proto.h       Wed Mar  8 20:55:38 2000
@@ -25,7 +25,12 @@
 int ask_fips(FILE *, int *, int *, int *);
 /* main.c */
 int min1(int, int);
+#ifdef __GNUC_MINOR__
 int leave(int) __attribute__ ((__noreturn__));
+#else
+int leave(int);
+#endif
+
 /* table.c */
 int init_table(void);
 int get_proj_index(char *);
 emitchell at orion  [/opt/grass/grass5.0beta/src/general/g.version]  - 74 >  diff -u main.c.orig
main.c
--- main.c.orig Wed Mar  8 21:03:40 2000
+++ main.c      Wed Mar  8 21:04:18 2000
@@ -1,9 +1,11 @@
 #include <stdio.h>
 
+#define QUOTE(x) #x
+
 int main(int argc, char *argv[])
 {
     fprintf (stdout, "GRASS %s (%s) %s\n", 
-           VERSION_NUMBER, VERSION_DATE, VERSION_UPDATE_PKG );
+           QUOTE(VERSION_NUMBER), QUOTE(VERSION_DATE), QUOTE(VERSION_UPDATE_PKG) );
     fprintf (stdout, "\n");
     fprintf (stdout, "Copyright and License Statement\n");
     fprintf (stdout, "\n");
 emitchell at orion  [/opt/grass/grass5.0beta/src/general/g.version]  - 75 >  diff -u Gmakefile.orig
Gmakefile
--- Gmakefile.orig      Wed Mar  8 21:00:20 2000
+++ Gmakefile   Wed Mar  8 21:05:23 2000
@@ -1,5 +1,5 @@
 PGM=g.version
-EXTRA_CFLAGS=-DVERSION_NUMBER="\"$(VERSION_NUMBER)\"" -DVERSION_DATE="\"$(VERSION_DATE)\""
-DVERSION_UPDATE_PKG="\"$(VERSION_UPDATE_PKG)\""
+EXTRA_CFLAGS=-DVERSION_NUMBER="$(VERSION_NUMBER)" -DVERSION_DATE="$(VERSION_DATE)"
-DVERSION_UPDATE_PKG="$(VERSION_UPDATE_PKG)"
 
 $(BIN_MAIN_INTER)/$(PGM): main.o
        $(CC) $(LDFLAGS) $(MATHLIB) $(XDRLIB) -o $@ main.o
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.class]  - 81 >  diff -u local_proto.h.orig
local_proto.h
--- local_proto.h.orig  Wed Mar  8 21:09:14 2000
+++ local_proto.h       Wed Mar  8 21:09:56 2000
@@ -97,7 +97,11 @@
 int nstd225(void);
 int nstd250(void);
 /* main.c */
+#ifdef __GNUC_MINOR__
 void quit(void) __attribute__ ((__noreturn__));
+#else
+void quit(void);
+#endif
 int error(char *, int);
 /* mouse.c */
 int Mouse_pointer(int *, int *, int *);
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.colors]  - 87 >  diff -u main.c.orig main.c
--- main.c.orig Wed Mar  8 21:12:45 2000
+++ main.c      Wed Mar  8 21:13:06 2000
@@ -5,7 +5,11 @@
 #include "globals.h"
 #include "local_proto.h"
 
+#ifdef __GNUC_MINOR
 static void quit (int) __attribute__ ((__noreturn__));
+#else
+static void quit (int);
+#endif
 static int error(char *,int);
 
 int main (int argc, char *argv[])
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.in.erdas]  - 92 >  diff -u main.c.orig
main.c
--- main.c.orig Wed Mar  8 21:15:33 2000
+++ main.c      Wed Mar  8 21:16:03 2000
@@ -545,7 +545,7 @@
         if (!(swapflag->answer || autoswapflag->answer))
         {
                ActuallySwap = 0;
-               if ((erdashd.pack == 256 ) || (erdashd.pack == 512 )) // 1 or 2 byte-swapped
+               if ((erdashd.pack == 256 ) || (erdashd.pack == 512 )) /* 1 or 2 byte-swapped */
                        ActuallySwap = 1 ;
                if (erdashd.pack == 0)
                {
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.ortho.photo/photo.2image]  - 97 >  diff -u
globals.h.orig globals.h
--- globals.h.orig      Wed Mar  8 21:18:21 2000
+++ globals.h   Wed Mar  8 21:19:17 2000
@@ -144,7 +144,11 @@
 int Menu_msg(char *);
 int Start_mouse_in_menu(void);
 /* main.c */
+#ifdef __GNUC_MINOR__
 int quit(int) __attribute__ ((__noreturn__));
+#else
+int quit(int);
+#endif
 int error(char *, int);
 /* mark.c */
 int mark(int, int, int);
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.ortho.photo/photo.2target]  - 103 >  diff
-u local_proto.h.orig local_proto.h
--- local_proto.h.orig  Wed Mar  8 21:20:52 2000
+++ local_proto.h       Wed Mar  8 21:21:56 2000
@@ -69,7 +69,11 @@
 int Menu_msg(char *);
 int Start_mouse_in_menu(void);
 /* main.c */
+#ifdef __GNUC_MINOR__
 int quit(int) __attribute__ ((__noreturn__));
+#else
+int quit(int);
+#endif
 int error(char *, int);
 /* mark.c */
 int mark(int, int, int);
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.points]  - 109 >  diff -u main.c.orig
main.c
--- main.c.orig Wed Mar  8 21:24:44 2000
+++ main.c      Wed Mar  8 21:25:07 2000
@@ -6,7 +6,11 @@
 #include "local_proto.h"
 #include "raster.h"
 
+#ifdef __GNUC_MINOR__
 int quit (int) __attribute__ ((__noreturn__));
+#else
+int quit (int);
+#endif
 int error (char *, int);
 
 int main (int argc, char *argv[])
 emitchell at orion  [/opt/grass/grass5.0beta/src/imagery/i.vpoints]  - 114 >  diff -u globals.h.orig
globals.h
--- globals.h.orig      Wed Mar  8 21:28:17 2000
+++ globals.h   Wed Mar  8 21:28:31 2000
@@ -155,7 +155,11 @@
 int Start_mouse_in_menu(void);
 /* main.c */
 int main(int, char *[]);
+#ifdef __GNUC_MINOR__
 int quit(int) __attribute__ ((__noreturn__));
+#else
+int quit(int);
+#endif
 int error(char *, int);
 /* mark.c */
 int mark(int, int, int);
 emitchell at orion  [/opt/grass/grass5.0beta/src/libes/geom/basic]  - 119 >  diff -u malloc.c.orig
malloc.c
--- malloc.c.orig       Wed Mar  8 21:33:39 2000
+++ malloc.c    Wed Mar  8 21:34:20 2000
@@ -8,6 +8,10 @@
 #include <sys/types.h>
 #endif
 
+#ifdef sgi
+#include <malloc.h> /* we need the M_DEBUG macro below */
+#endif
+
 /*---------------------------------------------------------------------------*/
 
 #define REPORT_THRESHOLD  1000000
 emitchell at orion  [/opt/grass/grass5.0beta/src/mapdev/v.geom/cmd]  - 124 >  diff -u Gmakefile.orig
Gmakefile
--- Gmakefile.orig      Wed Mar  8 21:43:17 2000
+++ Gmakefile   Wed Mar  8 21:43:51 2000
@@ -5,6 +5,10 @@
 
 LIBES = $(VECTLIB) $(DIG_ATTLIB) $(GISLIB) $(TRIANGLIB)
 
+ifeq ($(shell uname),IRIX64)
+LIBES += -lmalloc
+endif
+
 SOURCES = \
        main.c

 emitchell at orion  [/opt/grass/grass5.0beta/src/paint/Interface/driverlib]  - 129 >  diff -u
interface.c.orig interface.c
--- interface.c.orig    Wed Mar  8 21:48:06 2000
+++ interface.c Wed Mar  8 21:48:59 2000
@@ -363,16 +363,17 @@
 static int rec (void *buf,int n)
 {
     int i;
+    char *cbuf = buf;
 
     while (n > 0)
     {
-       i = read (0, buf, n);
+       i = read (0, cbuf, n);
 
        if (i == 0)
            paint_error ("unexpected EOF");
        if (i < 0)
            paint_error ("read error");
-       (char *)buf += i;
+       cbuf += i;
        n -= i;
     }
 emitchell at orion  [/opt/grass/grass5.0beta/src/paint/Programs/p.map.new/cmd]  - 134 >  diff -u
scale.c.orig scale.c
--- scale.c.orig        Wed Mar  8 21:51:53 2000
+++ scale.c     Wed Mar  8 21:52:22 2000
@@ -24,7 +24,11 @@
 #define MILES_TO_INCHES  ((double)5280*12)
 
 static double do_scale (struct Cell_head *, int, int, char *);
+#ifdef __GNUC_MINOR__
 static int OOPS (void) __attribute__ ((__noreturn__));
+#else
+static int OOPS (void);
+#endif
 
 int scale (struct Cell_head *window, int panel, int margin, char *text)
 {
 emitchell at orion  [/opt/grass/grass5.0beta/src/ps.map/ps.map/cmd]  - 139 >  diff -u scale.c.orig
scale.c
--- scale.c.orig        Wed Mar  8 21:53:48 2000
+++ scale.c     Wed Mar  8 21:54:28 2000
@@ -13,7 +13,11 @@
 #define MILES_TO_INCHES  ((double)5280*12)
 #define PWIDTH (PS.page_width-PS.left_marg-PS.right_marg)
 static double do_scale(char *);
+#ifdef __GNUC_MINOR__
 static int OOPS() __attribute__ ((__noreturn__));
+#else
+static int OOPS();
+#endif
 
 
 double scale(char *text)
 emitchell at orion  [/opt/grass/grass5.0beta/src/raster/r.mapcalc/mapcalc]  - 144 >  diff -u
maps.c.orig maps.c
--- maps.c.orig Wed Mar  8 21:58:30 2000
+++ maps.c      Wed Mar  8 22:00:44 2000
@@ -332,8 +332,9 @@
                    SETNULL_D(values);
                values++;
            }
+           values = vbuf;
            btree_update (btree, (char *)&key, sizeof(key),
-                (char *)values = vbuf, sizeof(vbuf));
+                values, sizeof(vbuf));
        }
 
 /* and finally lookup the translated value */
 emitchell at orion  [/opt/grass/grass5.0beta/src/raster/r.statistics/man]  - 153 >  diff -u
Gmakefile.orig Gmakefile
--- Gmakefile.orig      Wed Mar  8 22:05:22 2000
+++ Gmakefile   Wed Mar  8 22:05:58 2000
@@ -2,8 +2,14 @@
 MDIR=$(SRC)/../man/man$(MSEC)
 MUTL=$(SRC)/../man/utilities
 
+ifeq ($(shell uname),IRIX64)
+NROFF = groff
+else
+NROFF=nroff
+endif
+
 man:  
        -cp r.statistics.man $(MDIR)/r.statistics
-       nroff $(MUTL)/man.version $(MDIR)/.class-header \
+       $(NROFF) $(MUTL)/man.version $(MDIR)/.class-header \
        $(MUTL)/man.header r.statistics.man $(MDIR)/.class-notice \
        > $(GISBASE)/man/$(MSEC)/r.statistics
 emitchell at orion  [/opt/grass/grass5.0beta/src/scripts/contrib/s.in.grid]  - 158 >  diff -u
Gmakefile.orig Gmakefile
--- Gmakefile.orig      Wed Mar  8 22:09:42 2000
+++ Gmakefile   Wed Mar  8 22:09:54 2000
@@ -16,6 +16,11 @@
 MDIR=$(SRC)/../man/man$(MSEC)
 MUTL=$(SRC)/../man/utilities
 
+ifeq ($(shell uname),IRIX64)
+NROFF = groff
+else
+NROFF=nroff
+endif
 
 all : $(PROG) man
 
@@ -26,7 +31,7 @@
 
 man:
        -cp $(PGM).man $(MDIR)/$(PGM)
-       nroff $(MUTL)/man.version $(MDIR)/.class-header \
+       $(NROFF) $(MUTL)/man.version $(MDIR)/.class-header \
         $(MUTL)/man.header $(PGM).man $(MDIR)/.class-notice \
         > $(GISBASE)/man/$(MSEC)/$(PGM)
 
 emitchell at orion  [/opt/grass/grass5.0beta/src/sites/s.kcv]  - 165 >  diff -u Gmakefile.orig
Gmakefile
--- Gmakefile.orig      Wed Mar  8 22:16:35 2000
+++ Gmakefile   Wed Mar  8 22:16:51 2000
@@ -11,6 +11,12 @@
        histo.o \
        utils.o
 
+ifeq ($(shell uname),IRIX64)
+NROFF = groff
+else
+NROFF=nroff
+endif
+
 all: s.kcv man
 
 s.kcv: $(BIN_CONTRIB_CMD)/s.kcv 
@@ -20,7 +26,7 @@
 
 man:  
        -cp s.kcv.man $(MDIR)/s.kcv
-       nroff $(MUTL)/man.version $(MDIR)/.class-header \
+       $(NROFF) $(MUTL)/man.version $(MDIR)/.class-header \
           $(MUTL)/man.header s.kcv.man $(MDIR)/.class-notice \
           > $(GISBASE)/man/$(MSEC)/s.kcv
 lint:
 emitchell at orion  [/opt/grass/grass5.0beta/src.contrib/CERL/raster/r.out.mpeg]  - 170 >  diff -u
local_proto.h.orig local_proto.h
--- local_proto.h.orig  Wed Mar  8 22:21:37 2000
+++ local_proto.h       Wed Mar  8 22:22:00 2000
@@ -2,7 +2,6 @@
 int load_files(void);
 int use_r_out(void);
 char **gee_wildfiles(char *, char *, int *);
-int parse_command(int, char *[], char *[][], int *, int *, int *, int *);
 /* write.c */
 int write_ycc(char *, char *, char *, int, int, int *, int *, char *);
 int write_ppm(char *, char *, char *, int, int, int *, int *, char *);
 emitchell at orion  [/opt/grass/grass5.0beta/src.contrib/CERL/raster/r.out.mpeg]  - 172 >  diff -u
main.c.orig main.c
--- main.c.orig Wed Mar  8 22:22:22 2000
+++ main.c      Wed Mar  8 22:23:10 2000
@@ -38,6 +38,9 @@
 
 #define USE_PPM
 
+int parse_command(int, char *[], char *[MAXVIEWS][MAXIMAGES], 
+                  int *, int *, int *, int *);
+
 int     nrows, ncols, numviews, quality, quiet=0;
 char   *vfiles[MAXVIEWS][MAXIMAGES];
 char   outfile[BUFSIZ];
##################################################################
/opt/grass/grass5.0beta/src.contrib/CERL/raster/r.rational.regression
  make -f OBJ.mips-sgi-irix6.5/make.rules 

make[1]: Entering directory `/opt/grass/grass5.0beta/src.contrib/CERL/raster/r.rational.regression'
rm -f OBJ.mips-sgi-irix6.5/xformation.o
cc -g   -I/opt/grass/grass5.0beta/src/include  -c xformation.c
"xformation.c", line 49: warning(1116): non-void function "normalization_x1"
          (declared at line 6) should return a value
  }
  ^
"xformation.c", line 101: warning(1116): non-void function "normalization_x2"
          (declared at line 53) should return a value
  }
  ^
"xformation.c", line 153: warning(1116): non-void function "ndvi" (declared at
          line 104) should return a value
  }
  ^
"xformation.c", line 209: warning(1116): non-void function "ndvi_intensity"
          (declared at line 156) should return a value
  }
  ^
"xformation.c", line 264: warning(1116): non-void function "ndvi_reflectance"
          (declared at line 211) should return a value
  }
  ^
"xformation.c", line 323: warning(1116): non-void function "rvi" (declared at
          line 268) should return a value
  }
  ^
"xformation.c", line 578: warning(1116): non-void function
          "nonlinear_linearization" (declared at line 327) should return a
          value
  }
  ^
"xformation.c", line 817: warning(1116): non-void function
          "nonlinear_linearization_NDVI" (declared at line 581) should return
          a value
  }
  ^
"xformation.c", line 969: warning(1551): variable "standard_residual_old" is
          used before its value is set
                  standard_residual, standard_residual_old);
                                     ^
"xformation.c", line 972: warning(1116): non-void function "relaxation"
          (declared at line 820) should return a value
  }
  ^
"xformation.c", line 984: error(1153): declaration is incompatible with
          previous "vector" (declared at line 12)
        y2=vector(ndata);
           ^
"xformation.c", line 984: error(1515): a value of type "int" cannot be
          assigned to an entity of type "double *"
        y2=vector(ndata);
          ^
"xformation.c", line 985: error(1515): a value of type "int" cannot be
          assigned to an entity of type "double *"
        epsilon=vector(ndata);
               ^
"xformation.c", line 1054: warning(1116): non-void function "prediction_linear"
          (declared at line 975) should return a value
  }
  ^
"xformation.c", line 1264: warning(1116): non-void function
          "prediction_linear_other" (declared at line 1058) should return a
          value
  }
  ^
"xformation.c", line 1280: error(1515): a value of type "int" cannot be
          assigned to an entity of type "double *"
        y2=vector(ndata);
          ^
"xformation.c", line 1281: error(1515): a value of type "int" cannot be
          assigned to an entity of type "double *"
        epsilon=vector(ndata);
               ^
"xformation.c", line 1351: warning(1116): non-void function
          "prediction_nonlinear" (declared at line 1270) should return a value
  }
  ^
"xformation.c", line 1527: warning(1116): non-void function
          "prediction_nonlinear_other" (declared at line 1358) should return a
          value
  }
  ^
5 errors detected in the compilation of "xformation.c".
make[1]: *** [OBJ.mips-sgi-irix6.5/xformation.o] Error 2
make[1]: Target `/opt/grass/etc/bin/contrib/cmd/r.rational.regression' not remade because of errors.
make[1]: Leaving directory `/opt/grass/grass5.0beta/src.contrib/CERL/raster/r.rational.regression'
GISGEN failure at STEP: src.contrib/CERL/raster/r.rational.regression
make: *** [do-install] Error 1
make: Target `install' not remade because of errors.


-- ebm
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| Eric B. Mitchell         mailto:emitchell at altaira.com |
| tel: (301) 809 - 3534    Altair Aerospace Corporation |
| tel: (800) 7 - ALTAIR    4201 Northview Dr. Suite 410 |
| fax: (301) 805 - 8122    Bowie, MD  20716             |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
              ,___
          /"\  / o=\  /"""---===/
         /   \_/  \__/   ---===/ 
         |    //\   || /""TT""/ //\   || ||""\
         |   //  \  ||    ||   //  \  || ||__/
         |  //--==\ |L--/ ||  //--==\ || || "=,
          \      ---===/
           \____---===/



More information about the grass-user mailing list