Comments on building GrADS from source

Len Makin len.makin at CSIRO.AU
Tue Oct 25 20:42:22 EDT 2005


Hi Jennifer,
As a non-GrADS user (a mere support person ;-) I was charged with
(re)building GrADS after we had a disk crash, and subsequently changed to
SuSe Linux which doesn't include it in the distribution. I decided the
safest was to build from source, so downloaded 1.9b4(tar.gz). I was
surprised to find it had a simple problem discovered as follows:

[Note: many application packages for our users are installed under /tools ]
Checking for desirable pre-requisites and what was currently installed, I
installed (/usr/local):
      - gd-2.0.33 (Note:With SuSe, libgd.so is installed in /usr/lib,rpm -q
tells me version is gd-2.0.32-6, but there are no corresponding
headers (gd.h) and related files. Need something like
gd-devel?? - not in SuSe)
      - HDF4.2r1

Environment and configure were:
CC=gcc
export CPPFLAGS="-I/tools/readline/include
-I/tools/udunits/include -I/tools/netcdf/include
-I/usr/local/include"
export LDFLAGS="-L/tools/readline/lib -L/tools/udunits/lib
-L/tools/netcdf/lib -L/usr/local/lib"
./configure --prefix=/tools/grads-1.9b4 --with-readline
--with-printim --with-lats --with-nc --with-hdf
--enable-dyn-supplibs
from which the configure produced:

    +----------------------------------+
    | |
    | Configuration Summary |
    | |
    | + readline enabled |
    | + printim enabled |
    | - GUI disabled |
    | + LATS enabled |
    | - wi disabled (default) |
    | |
    | Build Summary |
    | |
    | + gradsc (classic) enabled |
    | + gradsnc (netCDF) enabled |
    | + gradshdf (HDF-SDS) enabled |
    | - gradsdods (OPeNDAP) disabled |
    | |
    | + Dynamic linking enabled |
    | |
    +----------------------------------+
but the make then failed due to an undefined reference to an old GD function
from gd version 1.?
undefined gdCompareInt()
Google found the old code at
http://www.boutell.com/cgibook/cd/SOURCE/GD1_2/gd.c
I extracted and inserted into the offending file:

% diff gxhpng.c gxhpng.c.orig
9,13d8
< int gdCompareInt(const void *a, const void *b)
< {
< return (*(const int *)a) - (*(const int *)b);
< }
<

make then succeeded.

Then I joined this list, intending to report the bug, and found that the
same solution had been found and included as part of patches for a Fedora
build, in August by Patrice Dumas <pertusus at FREE.FR>. The 1.9b4 source is
dated 23/05/05


More information about the gradsusr mailing list