[GRASS-user] grass 6.3.0 solaris 10 install errors

Brian Clark brclark at usgs.gov
Tue Oct 14 15:24:43 EDT 2008

Glynn Clements wrote:
> Brian Clark wrote:
>> Ah. thanks!... but still... errors.. after make, I cd'd to the first 
>> directory in error.log (lib/vector/diglib) and tried 'make' -
>> ->make
>> make OBJ.sparc-sun-solaris2.10/test
>> make[1]: Entering directory `/wattemp/GRASS/grass-6.3.0/lib/vector/diglib'
>> echo "==============TEST============="
>> ==============TEST=============
>> gcc -L/wattemp/GRASS/grass-6.3.0/dist.sparc-sun-solaris2.10/lib  
>> -Wl,-R,/wattemp/GRASS/grass-6.3.0/dist.sparc-sun-solaris2.10/lib    
>> -I/usr/local/include/ncurses -g -O2  -I/usr/local/include/ncurses 
>> -I/usr/local/include  
>> -I/wattemp/GRASS/grass-6.3.0/dist.sparc-sun-solaris2.10/include  -o 
>> OBJ.sparc-sun-solaris2.10/test test.c -lgrass_dig2 -lgrass_gis 
>> -lgrass_datetime -lnsl    -lz  -lsocket   -lgrass_rtree  -lgrass_rtree \
>>                         -lgrass_gis -lgrass_datetime -lnsl    -lz  
>> -lsocket   -lgrass_datetime -lm  -lnsl    -lz 
>> /wattemp/GRASS/grass-6.3.0/dist.sparc-sun-solaris2.10/lib/libgrass_gis.so: 
>> undefined reference to `gethostname at SUNWprivate_1.1'
>> collect2: ld returned 1 exit status
>> make[1]: *** [OBJ.sparc-sun-solaris2.10/test] Error 1
>> make[1]: Leaving directory `/wattemp/GRASS/grass-6.3.0/lib/vector/diglib'
>> make: *** [default] Error 2
>> This looks familiar - before we added $(SOCKLIB) to /lib/gis/Makefile 
>> (which is still there). Is this a similar situation?
> Strange. The configure script actually checks that gethostname() is
> available without additional libraries.
> You could try undefining HAVE_GETHOSTNAME in include/config.h after
> configure has run, in which case it should fall back to uname().
> AFAICT, the only reference is in lib/gis/mach_name.c, so if all else
> fails, you can always hack that file, e.g.:
> char *G__machine_name(void)
> {
>     static char name[] = "dummy";
>     return name;
> }
> Ultimately, the only way we'll get a proper fix is if someone who
> understands Solaris can determine the correct compilation and linking
> flags.
In addition to suggestions throughout the previous portions of this
thread, our IT guy put together this list of final tweaks (see below)
and was able to successfully install grass 6.3.0 on solaris 10 (yeah!).
So thanks for the contributions! -you'll also note, many of the tweaks
below were mentioned in the above thread or on other forum
(http://thread.gmane.org/gmane.comp.gis.grass.devel/23553 - also had to
change startup scripts as mentioned on this forum).


The first thing that I would recommend for a build of Grass on Solaris
is to use the Bash shell while building and installing Grass
on Solaris. This step if often overlooked and can cause problems later
on. If you cannot use the Bash shell then use the Bourne shell
for the build and installation.


To configure GRASS correctly on a system which doesn't have a suitable
install program (AC_PROG_INSTALL ignores versions which are known to
have problems), you need to ensure that $srcdir is an absolute path,
by using e.g.:

    ./configure --srcdir=`pwd` --without-opengl --without-tcltk

Used the above configuration and it worked fine.

Build Error fixes during 'make' step:

1) Error undefined reference to `gethostname at SUNWprivate_1.1'

    To fix I edited the file under the build directory

    Changed to:

    char *G__machine_name(void)
        static char name[] = "dummy";
        return name;

      I basically just assigned the name[] character variable to "dummy".
      This value just need to be assigned to something.

2) To fix curser errors "undefined reference to `initscr32 "

      To fix I edited the file under the build directory

      changed: CURSES = -lncurses $(COMPATLIB)
      to:      CURSES = -lcurses $(COMPATLIB).

    Problem on solaris 10 is, that ncurses is installed in /usr/local, but
    the header file is in /usr/local/include/ncurses/ncurses.h
    configure detects ncurses, but the link phase does not work, as
    initscr32 from system curses library is needed.

3) Error with unresolved variable FP_NAN

    To fix edited file under build directory /imagery/i.atcorr/main.cpp
    and added the variable FP_NAN:


    static void process_raster (int ifd, InputMask imask, ScaleRange iscale,
                    int ialt_fd, int ivis_fd, int ofd, bool oflt,
                    ScaleRange oscale, bool optimize)
            FCELL* buf;         /* buffer for the input values */
        FCELL* alt = NULL;         /* buffer for the elevation values */
        FCELL* vis = NULL;         /* buffer for the visibility values */
        FCELL  prev_alt = -1.f;
        FCELL  prev_vis = -1.f;
            int row, col;

        int FP_NAN;


More information about the grass-user mailing list