Compiling grads2.0a - how to configure and how to compile?

Paul Earnshaw paul.earnshaw at METOFFICE.GOV.UK
Fri Feb 8 05:44:18 EST 2008


Stefan,

grads2.0a has not been configured to find the supplibs packages in the
form that supplibs-2.x.x has them. I managed to get it compile by
linking what grads wants to where they actually are.

If you are confident in editing the configure/makefile scripts, then you
may be able to make this work properly. However if, like me, you are not
then you will need to work around it.

The first main problem is that you need to remove the i686-pc-linux-gnu
part of the supplibs path. How you do this is up to you, but ultimately
you need the path to the include directory in supplibs to be
"/usr/src/supplibs/include", not "/usr/src/supplibs/i686-pc-linux-
gnu/include"

After that, you need to make sure grads can find the individual
packages, I did this using symbolic links as shown below. Not the most
elegant method, but it does work.

Cheers,
Paul

PS. I have had a couple of issues in compiling GrADS (1.9-rc1 and 2.0a)
concerning the supplibs-2.x.x package that it would be nice to get
sorted.

In 1.9-rc1, the expected netcdf include to hdf "hdf/netcdf.h" is
actually named "hdf/hdf4_netcdf.h" when supplibs is compiled. It is a
simple renaming exercise, but nonetheless a little frustrating when it
can and should just work.

In 2.0a, in order for the GUI interface to work you need the include
file "freq.h" and library "libfreq.a" which I assume are part of the
libsx package. The problem is that these files are not created as part
of the supplibs package, and neither are they mentioned on the Grads2.0a
dependencies table http://iges.org/grads/gadoc/supplibs.html

How do I get at them?



Symbolic links in supplibs/include
------------------------------------------------------------------------------
drwxr-xr-x  3 frpe umdev 4096 Feb  4 13:01 X11
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 atom.h -> hdf/atom.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 bitvect.h -> hdf/bitvect.h
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 cdeflate.h -> hdf/cdeflate.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 cnbit.h -> hdf/cnbit.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 cnone.h -> hdf/cnone.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 crle.h -> hdf/crle.h
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 cskphuff.h -> hdf/cskphuff.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 cszip.h -> hdf/cszip.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:46 curl
lrwxrwxrwx  1 frpe umdev    9 Feb  4 17:57 dap -> libnc-dap
lrwxrwxrwx  1 frpe umdev    8 Feb  4 18:39 df.h -> hdf/df.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 dfan.h -> hdf/dfan.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 dfgr.h -> hdf/dfgr.h
lrwxrwxrwx  1 frpe umdev    9 Feb  4 18:39 dfi.h -> hdf/dfi.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 dfrig.h -> hdf/dfrig.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 dfsd.h -> hdf/dfsd.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 dfstubs.h -> hdf/dfstubs.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 dfufp2i.h -> hdf/dfufp2i.h
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 dynarray.h -> hdf/dynarray.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 17:33 g2c
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:53 gadap
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:40 gadap.h -> gadap/gadap.h
lrwxrwxrwx  1 frpe umdev   17 Feb  4 18:41 gadap_err.h ->
gadap/gadap_err.h
lrwxrwxrwx  1 frpe umdev   19 Feb  4 18:41 gadap_types.h ->
gadap/gadap_types.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:39 gd
lrwxrwxrwx  1 frpe umdev   14 Feb  4 17:54 grib2.h -> grib2c/grib2.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:41 grib2c
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 h4config.h -> hdf/h4config.h
lrwxrwxrwx  1 frpe umdev   12 Feb  4 18:39 hbitio.h -> hdf/hbitio.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 hchunks.h -> hdf/hchunks.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 hcomp.h -> hdf/hcomp.h
lrwxrwxrwx  1 frpe umdev   12 Feb  4 18:39 hcompi.h -> hdf/hcompi.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 hconv.h -> hdf/hconv.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 13:18 hdf
lrwxrwxrwx  1 frpe umdev    9 Feb  4 18:39 hdf.h -> hdf/hdf.h
lrwxrwxrwx  1 frpe umdev   16 Feb  4 18:39 hdf2netcdf.h ->
hdf/hdf2netcdf.h
lrwxrwxrwx  1 frpe umdev   17 Feb  4 18:39 hdf4_netcdf.h ->
hdf/hdf4_netcdf.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:59 hdf5
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 hdfi.h -> hdf/hdfi.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 herr.h -> hdf/herr.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 hfile.h -> hdf/hfile.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 hkit.h -> hdf/hkit.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 hlimits.h -> hdf/hlimits.h
lrwxrwxrwx  1 frpe umdev   13 Feb  4 18:39 hntdefs.h -> hdf/hntdefs.h
lrwxrwxrwx  1 frpe umdev   12 Feb  4 18:39 hproto.h -> hdf/hproto.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 htags.h -> hdf/htags.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:37 jasper
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:37 jpeg
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:50 libdap
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:52 libnc-dap
drwxr-xr-x  3 frpe umdev 4096 Feb  4 12:37 libpng
drwxr-xr-x  2 frpe umdev 4096 Feb  4 18:28 libsx
drwxr-xr-x  3 frpe umdev 4096 Feb  4 12:42 libxml2
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 linklist.h -> hdf/linklist.h
lrwxrwxrwx  1 frpe umdev   14 Feb  4 18:39 local_nc.h -> hdf/local_nc.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 mfan.h -> hdf/mfan.h
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 mfgr.h -> hdf/mfgr.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 mfhdf.h -> hdf/mfhdf.h
lrwxrwxrwx  1 frpe umdev   12 Feb  4 18:39 mfhdfi.h -> hdf/mfhdfi.h
lrwxrwxrwx  1 frpe umdev   12 Feb  4 18:39 mstdio.h -> hdf/mstdio.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:36 netcdf
lrwxrwxrwx  1 frpe umdev   15 Feb  4 18:39 netcdf.h -> netcdf/netcdf.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 13:00 netcdf4
drwxr-xr-x  2 frpe umdev 4096 Feb  4 13:00 readline
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:36 szlib
lrwxrwxrwx  1 frpe umdev   10 Feb  4 18:39 tbbt.h -> hdf/tbbt.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:36 udunits
lrwxrwxrwx  1 frpe umdev   17 Feb  4 17:46 udunits.h ->
udunits/udunits.h
lrwxrwxrwx  1 frpe umdev   11 Feb  4 18:39 vattr.h -> hdf/vattr.h
lrwxrwxrwx  1 frpe umdev    8 Feb  4 18:39 vg.h -> hdf/vg.h
drwxr-xr-x  2 frpe umdev 4096 Feb  4 12:36 zlib
---------------------------------------------------------------------------------

On Thu, 2008-02-07 at 22:57 +0200, Stefan Gofferje wrote:
> Hei,
>
> as I didn't find any binary packages for x86-32, I try compiling myself.
> But already the configuring fails...
>
> I downloaded the supplib package from Sourceforge and compiled it.
> dirstructure is as follows:
>
> In /usr/src/supplibs/i686-pc-linux-gnu/ I have the include dir which
> contains one subdir for each package and the lib dir which includes alls
> libs in one dir.
>
> ./configure finds nothing. (s. config.txt)
>
> After export SUPPLIBS=/usr/src/supplibs/i686-pc-linux-gnu
>
> ./configure find at least the libs for printim and readline (s.
> config2.txt) but not grib2 libs nor any other.
>
> Very strange also is the error in the NetCDF check "command not found"...
>
> Has anyone any hints on how to get that compiled?
>
> Tervehdys Suomesta,
> Stefan Gofferje
>
> --
> Since light travels faster than sound, is that why some people appear
> bright until you hear them speak?
> plain text document attachment (config2.txt)
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether to enable maintainer-specific portions of Makefiles... no
>
> Checking for programs
> ------------------
> checking for gawk... (cached) gawk
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
>
> Setting host specific options
> -------------------------
> checking build system type... i686-pc-linux-gnu
> checking host system type... i686-pc-linux-gnu
> checking for supplibs directory... /usr/src/supplibs/i686-pc-linux-gnu
>
> Checking system libraries, headers, and compiler features
> -----------------------------------------
> checking for cos in -lm... yes
> checking how to run the C preprocessor... gcc -E
> checking for X... libraries , headers
> checking for gethostbyname... yes
> checking for connect... yes
> checking for remove... yes
> checking for shmat... yes
> checking for IceConnectionNumber in -lICE... yes
>
> checking for grep that handles long lines and -e... /usr/bin/grep
> checking for egrep... /usr/bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking malloc.h usability... yes
> checking malloc.h presence... yes
> checking for malloc.h... yes
> checking sys/file.h usability... yes
> checking sys/file.h presence... yes
> checking for sys/file.h... yes
> checking for unistd.h... (cached) yes
>
> checking for an ANSI C-conforming const... yes
> checking whether byte ordering is bigendian... no
> checking for strtod... yes
> checking for off_t... yes
> checking for special C compiler options needed for large files... no
> checking for _FILE_OFFSET_BITS value needed for large files... 64
> checking for _LARGEFILE_SOURCE value needed for large files... no
>
> Checking for optional feature support
> ------------------------------------
> checking whether to use dynamic linking... no
>
> Check GrADS command line editing support...
> checking readline/readline.h usability... yes
> checking readline/readline.h presence... yes
> checking for readline/readline.h... yes
> checking readline/history.h usability... yes
> checking readline/history.h presence... yes
> checking for readline/history.h... yes
> checking for library containing tgetent... -lncurses
> checking for libreadline.a in supplibs... yes
> + Command line editing enabled
>
> Check GrADS GUI support...
> checking freq.h usability... no
> checking freq.h presence... no
> checking for freq.h... no
> - GUI disabled
>
> Checking printim support...
> checking gd.h usability... yes
> checking gd.h presence... yes
> checking for gd.h... yes
> checking for library containing tgetstr... none required
> checking for libz.a in supplibs... yes
> checking for libpng12.a in supplibs... yes
> checking for libgd.a in supplibs... yes
> + printim enabled
>
> Checking netcdf support...
> checking udunits.h usability... no
> checking udunits.h presence... no
> checking for udunits.h... no
> ./configure: line 9777: {}: command not found
> - netcdf disabled
>
> Checking hdf support...
> checking for udunits.h... (cached) no
> - hdf4 disabled
>
> Checking grib2 support...
> checking grib2.h usability... no
> checking grib2.h presence... no
> checking for grib2.h... no
> - grib2 disabled
>
>
> Checking which GrADS binaries can be built
> ------------------------------------
> checking for udunits.h... (cached) no
> - gradsdap (OPeNDAP/netCDF) build disabled
>
>   +=========================================================================+
>    GrADS 2.0.a0 : Built Thu Feb 7 22:51:35 EET 2008 for i686-pc-linux-gnu
>   +=========================================================================+
>
>   +----------------------------------+
>   |                                  |
>   | Configuration Summary            |
>   |                                  |
>   |  + readline enabled              |
>   |  + printim enabled               |
>   |  - netcdf disabled               |
>   |  - hdf4 disabled                 |
>   |  - grib2 disabled                |
>   |  - GUI disabled                  |
>   |                                  |
>   | Build Summary                    |
>   |                                  |
>   |  + grads enabled                 |
>   |  - gradsdap (OPeNDAP) disabled   |
>   |                                  |
>   |  - Dynamic linking disabled      |
>   |                                  |
>   +----------------------------------+
> configure: creating src/VERSION
> configure: creating src/buildinfo.h
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
> config.status: creating src/Makefile
> config.status: WARNING:  src/Makefile.in seems to ignore the --datarootdir setting
> config.status: creating src/config.h
>
> Run 'make && make install' to build GrADS.
> Executables will be installed to bin/ in current dir, unless prefix was specified.
>
> plain text document attachment (config.txt)
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether to enable maintainer-specific portions of Makefiles... no
>
> Checking for programs
> ------------------
> checking for gawk... (cached) gawk
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
>
> Setting host specific options
> -------------------------
> checking build system type... i686-pc-linux-gnu
> checking host system type... i686-pc-linux-gnu
> checking for supplibs directory... ../supplibs
>
> Checking system libraries, headers, and compiler features
> -----------------------------------------
> checking for cos in -lm... yes
> checking how to run the C preprocessor... gcc -E
> checking for X... libraries , headers
> checking for gethostbyname... yes
> checking for connect... yes
> checking for remove... yes
> checking for shmat... yes
> checking for IceConnectionNumber in -lICE... yes
>
> checking for grep that handles long lines and -e... /usr/bin/grep
> checking for egrep... /usr/bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking malloc.h usability... yes
> checking malloc.h presence... yes
> checking for malloc.h... yes
> checking sys/file.h usability... yes
> checking sys/file.h presence... yes
> checking for sys/file.h... yes
> checking for unistd.h... (cached) yes
>
> checking for an ANSI C-conforming const... yes
> checking whether byte ordering is bigendian... no
> checking for strtod... yes
> checking for off_t... yes
> checking for special C compiler options needed for large files... no
> checking for _FILE_OFFSET_BITS value needed for large files... 64
> checking for _LARGEFILE_SOURCE value needed for large files... no
>
> Checking for optional feature support
> ------------------------------------
> checking whether to use dynamic linking... no
>
> Check GrADS command line editing support...
> checking readline/readline.h usability... yes
> checking readline/readline.h presence... yes
> checking for readline/readline.h... yes
> checking readline/history.h usability... yes
> checking readline/history.h presence... yes
> checking for readline/history.h... yes
> checking for library containing tgetent... -lncurses
> checking for libreadline.a in supplibs... no
> - Command line editing disabled
>
> Check GrADS GUI support...
> checking freq.h usability... no
> checking freq.h presence... no
> checking for freq.h... no
> - GUI disabled
>
> Checking printim support...
> checking gd.h usability... yes
> checking gd.h presence... yes
> checking for gd.h... yes
> checking for library containing tgetstr... none required
> checking for libz.a in supplibs... no
> - printim disabled (Warning: gxtran will not be built)
>
> Checking netcdf support...
> checking udunits.h usability... no
> checking udunits.h presence... no
> checking for udunits.h... no
> ./configure: line 9777: {}: command not found
> - netcdf disabled
>
> Checking hdf support...
> checking for udunits.h... (cached) no
> - hdf4 disabled
>
> Checking grib2 support...
> checking grib2.h usability... no
> checking grib2.h presence... no
> checking for grib2.h... no
> - grib2 disabled
>
>
> Checking which GrADS binaries can be built
> ------------------------------------
> checking for udunits.h... (cached) no
> - gradsdap (OPeNDAP/netCDF) build disabled
>
>   +=========================================================================+
>    GrADS 2.0.a0 : Built Thu Feb 7 22:50:10 EET 2008 for i686-pc-linux-gnu
>   +=========================================================================+
>
>   +----------------------------------+
>   |                                  |
>   | Configuration Summary            |
>   |                                  |
>   |  - readline disabled             |
>   |  - printim disabled              |
>   |  - netcdf disabled               |
>   |  - hdf4 disabled                 |
>   |  - grib2 disabled                |
>   |  - GUI disabled                  |
>   |                                  |
>   | Build Summary                    |
>   |                                  |
>   |  + grads enabled                 |
>   |  - gradsdap (OPeNDAP) disabled   |
>   |                                  |
>   |  - Dynamic linking disabled      |
>   |                                  |
>   +----------------------------------+
> configure: creating src/VERSION
> configure: creating src/buildinfo.h
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
> config.status: creating src/Makefile
> config.status: WARNING:  src/Makefile.in seems to ignore the --datarootdir setting
> config.status: creating src/config.h
> config.status: src/config.h is unchanged
>
> Run 'make && make install' to build GrADS.
> Executables will be installed to bin/ in current dir, unless prefix was specified.
>
--
Dr. Paul Earnshaw   Global Model Development and Diagnostics
Met Office  FitzRoy Road  Exeter  Devon  EX1 3PB  United Kingdom
Tel: +44 (0)1392 884525  Fax: +44 (0)1392 885681
email: paul.earnshaw at metoffice.gov.uk website: www.metoffice.gov.uk



More information about the gradsusr mailing list