Supplemental Libraries for GrADS 2.0

There are many supplemental libraries that are required to enable various features in the GrADS executable. Building all these libraries from source is not necessarily easy, but this page provides some guidance and suggestions that have led to success on COLA's systems (64-bit linux running CentOS, and Mac OSX). Please post questions about building from source to the GrADS Users Forum. If you have the proper privileges, you may install these anywhere on your system instead of $HOME, just be sure to change the commands listed in the table below to accomodate your own installation.

To begin, make a directory top level directory for the supplibs under your $HOME:
mkdir $HOME/supplibs

Make a subdirectory where you will store the tar files containing the library source code:
mkdir -p $HOME/supplibs/src/tarfiles

Get the src from COLA's FTP server:
cd $HOME/supplibs/src/tarfiles
ftp iges.org
<login as anonymous>
cd grads/Supplibs/2.0/src
mget *
quit

These are the directories where you will install the compiled libaries, the necessary include files, and any executable utilities from the libraries that GrADS may need:
mkdir $HOME/supplibs/bin
mkdir $HOME/supplibs/lib
mkdir $HOME/supplibs/include

Move through the list of libraries in the table below, building them in order listed. Instructions for configuring and installing in the $HOME/supplibs directory are given for each library.

When you are done, unpack the GrADS source code tarball under $HOME. Change into the new GrADS directory you just created, and type ./configure. When the configuration is done, it will show a summary of which features have been enabled. Then type 'make install' and look for your executables in the ./bin directory.

Good Luck!!

Library Version Why GrADS needs it How to configure and install it for GrADS
readline 5.0

Enables command line editing.
Links:
home page

local copy of source code

cd $HOME/supplibs/src/
tar xvfz ./tarfiles/readline-5.0.tar.gz
cd readline-5.0/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/readline-5.0
make
make install
cp ./lib/libreadline.a $HOME/supplibs/lib
mkdir -p $HOME/supplibs/include/readline
cp ./include/readline/*.h $HOME/supplibs/include/readline

ncurses 5.7

Required for readline.
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz ./tarfiles/ncurses-5.7.tar.gz
cd ncurses-5.7/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/ncurses-5.7
make
make install
cp ./lib/libncurses.a $HOME/supplibs/lib

zlib 1.2.3 General compression library
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz ./tarfiles/zlib-1.2.3.tar.gz
cd zlib-1.2.3/
./configure --prefix=$HOME/supplibs/src/zlib-1.2.3
make
make install
cp ./lib/libz.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/zlib
cp ./include/zlib.h $HOME/supplibs/include/zlib
libpng 1.2.18 PNG reference library.
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz tarfiles/libpng-1.2.18.tar.gz
cd libpng-1.2.18/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/libpng-1.2.18
make
make install
cp ./lib/libpng12.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/libpng12
cp ./include/libpng12/*.h $HOME/supplibs/include/libpng12
jpeg 6b Image compression library.
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz tarfiles/jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/jpeg-6b
make
mkdir ./bin
mkdir -p ./man/man1
make install
mkdir ./include
cp *.h ./include/
mkdir ./lib
cp libjpep.a ./lib
cp libjpeg.a $HOME/supplibs/lib

gd 2.0.34 GD Graphics Library.
Requires: zlib, libpng, jpeg
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz tarfiles/gd-2.0.34.tar.gz
cd gd-2.0.34
./configure --disable-shared \
--with-png=$HOME/supplibs/src/libpng-1.2.18 \
--with-jpeg=$HOME/supplibs/src/jpeg-6b \
--prefix=$HOME/supplibs/src/gd-2.0.34
make
make install
cp ./lib/libgd.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/gd
cp ./include/* $HOME/supplibs/include/gd
jasper 1.701.0 Library for coding and manipulation of images.
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz tarfiles/jasper-1.701.0.tar.gz
cd jasper-1.701.0/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/jasper-1.701.0
make
make install
cp lib/libjasper.a $HOME/supplibs/lib/

g2clib 1.1.8

Decodes data in GRIB2 format.
Requires: zlib, png, jasper
Links:
home page
local copy of source code

There is no configure script in this library, so you must edit the makefile to change three lines identified below (INC, CC and ARFLAGS). Write out $HOME explicitly in the makefile.

INC=-I/usr/include -I$HOME/supplibs/src/jasper-1.701.0/include -I$HOME/supplibs/src/libpng-1.2.18 -I$HOME/supplibs/src/zlib-1.2.3/include
CC=gcc
ARFLAGS=

make
cp libgrib2c.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/grib2c
cp grib2.h $HOME/supplibs/include/grib2c

szip 2.1 General purpose lossless compression library.
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz tarfiles/szip-2.1.tar.gz
cd szip-2.1/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/szip-2.1
make
make install
cp lib/libsz.a $HOME/supplibs/lib

udunits 1.11.7

Supports units of physical quantities.
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz ./tarfiles/udunits-1.11.7.tar.gz
cd udunits-1.11.7/src/
make
make install
cd ../
cp ./lib/libudunits.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/udunits
cp ./include/udunits.h $HOME/supplibs/include/udunits

hdf 4.2r3 Hierarchical Data Format library, version 4. Requires: zlib, udunits, jpeg, szip
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz tarfiles/HDF4.2r3.tar.gz
cd HDF4.2r3/
./configure --disable-netcdf --disable-shared --disable-fortran \
--with-zlib=$HOME/supplibs/src/zlib-1.2.3 \
--with-jpeg=$HOME/supplibs/src/jpeg-6b \
--with-szip=$HOME/supplibs/src/szip-2.1 \
--prefix=$HOME/supplibs/src/HDF4.2r3
make
make install
cp lib/libdf.a $HOME/supplibs/lib
cp lib/libmfhdf.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/hdf
cp ./include/*.h $HOME/supplibs/include/hdf/
hdf5 1.8.4-patch1 (GrADS 2.0.a7+)
Hierarchical Data Format library, version 5. Requires: zlib, jpeg, szip
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz tarfiles/hdf5-1.8.4-patch1.tar.gz
cd hdf5-1.8.4-patch1/
./configure --disable-shared --disable-fortran \
--with-zlib=$HOME/supplibs/src/zlib-1.2.3 \
--with-jpeg=$HOME/supplibs/src/jpeg-6b \
--with-szlib=$HOME/supplibs/src/szip-2.1 \
--prefix=$HOME/supplibs/src/hdf5-1.8.4-patch1
make
make install
cp ./lib/libhdf5.a $HOME/supplibs/lib
cp ./lib/libhdf5_hl.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/hdf5
cp ./include/*.h $HOME/supplibs/include/hdf5/

curl 7.19.6 A library for handling files with URL syntax.
For enabling OPeNDAP access.
Links:
home page
local copy of source code
cd $HOME/supplibs/src
tar xvfz tarfiles/curl-7.19.6.tar.gz
cd curl-7.19.6/
./configure --without-ssl --without-libidn \
--enable-static --disable-shared \
--disable-ldap --prefix=$HOME/supplibs/src/curl-7.19.6
make
make install
cp ./lib/libcurl.a $HOME/supplibs/lib
netcdf 4.1.1 (GrADS 2.0.a8+)
Network Common Data Form library.
Requires hdf5, zlib, szip, curl.
Links:
home page
local copy of source code

cd $HOME/supplibs/src
tar xvfz tarfiles/netcdf-4.1.1-rc2.tar.gz
cd netcdf-4.1.1-rc2/
./configure --disable-f77 --enable-netcdf-4 --enable-dap \
--with-hdf5=$HOME/supplibs/src/hdf5-1.8.4-patch1 \
--with-zlib=$HOME/supplibs/src/zlib-1.2.3 \
--with-szlib=$HOME/supplibs/src/szip-2.1 \
--with-curl=$HOME/supplibs/src/curl-7.19.6 \
--prefix=$HOME/supplibs/src/netcdf-4.1.1-rc2
make
make install
cp ./lib/libnetcdf.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/netcdf
cp ./include/netcdf.h $HOME/supplibs/include/netcdf
cp ./bin/nc-config $HOME/supplibs/bin

xml2 2.6.16 An XML parser and toolkit.
For enabling OPeNDAP station data access.
Links:
home page
local copy of source code

cd $HOME/supplibs/src
tar xvfz tarfiles/libxml2-2.6.16.tar.gz
cd libxml2-2.6.16/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/libxml2-2.6.16
make
make install
cp ./lib/libxml2.a $HOME/supplibs/lib

dap 3.7.8 Open-source Project for a Network Data Access Protocol (OPeNDAP).
Requires: xml2, curl.
Links:
home page
local copy of source code

cd $HOME/supplibs/src
tar xvfz tarfiles/libdap-3.7.8.tar.gz
cd libdap-3.7.8/

N.B. You may need edit configure.ac so it won't use pkg-config to find curl (libdap_pkgconfig_libcurl=no) then run autoreconf. This is only necessary if curl is installed someplace else on your system without the special configure options outlined above for building curl.

./configure --disable-shared \
--with-xml2=$HOME/supplibs/src/libxml2-2.6.16 \
--with-zlib=$HOME/supplibs/src/zlib-1.2.3 \
--with-curl=$HOME/supplibs/src/curl-7.19.6 \
--prefix=$HOME/supplibs/src/libdap-3.7.8
make
make install
cp lib/libdap.a $HOME/supplibs/lib
cp lib/libdapclient.a $HOME/supplibs/lib

gadap 2.0 Enables OPeNDAP access of in situ data. Requires dap, curl, xml2.
Links:
local copy of source code

cd $HOME/supplibs/src
tar xvfz tarfiles/gadap-2.0.tar.gz
cd gadap-2.0/
setenv PATH {$PATH}:{$HOME}/supplibs/src/libdap-3.7.8/bin
./configure --prefix=$HOME/supplibs/src/gadap-2.0
make
make install
cp ./lib/libgadap.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/gadap
cp ./include/*.h $HOME/supplibs/include/gadap/

tiff 3.8.2 (GrADS 2.0.a5+)
Library for storing image data in the Tag Image File Format.
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz tarfiles/tiff-3.8.2.tar.gz
cd tiff-3.8.2/
./configure --disable-shared \
--prefix=$HOME/supplibs/src/tiff-3.8.2
make
make install
cp lib/libtiff.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/tiff
cp ./include/*.h $HOME/supplibs/include/tiff
geotiff 1.2.5 (GrADS 2.0.a5+)
Library for reading, and writing georeferenced raster imagery.
Requires: tiff.
Links:
home page
local copy of source code
cd $HOME/supplibs/src/
tar xvfz tarfiles/libgeotiff-1.2.5.tar.gz
cd libgeotiff-1.2.5/
./configure --enable-incode-epsg \
--enable-static --disable-shared \
--with-libtiff=$HOME/supplibs/src/tiff-3.8.2 \
--prefix=$HOME/supplibs/src/libgeotiff-1.2.5
make
make install
cp ./lib/libgeotiff.a $HOME/supplibs/lib
mkdir $HOME/supplibs/include/geotiff
cp ./include/* $HOME/supplibs/include/geotiff
shapelib 1.2.10 (GrADS 2.0.a8+)
Enables handling of shapefiles
Links:
home page
local copy of source code

cd $HOME/supplibs/src/
tar xvfz tarfiles/shapelib-1.2.10.tar.gz
cd shapelib-1.2.10/
make lib
cp ./.libs/libshp.a $HOME/supplibs/lib/
mkdir $HOME/supplibs/include/shapelib
cp shapefil.h $HOME/supplibs/include/shapelib