Supplemental Libraries for grads version 2
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; this page provides some guidance and suggestions that have led to success on COLA's unix systems (64-bit linux running CentOS, and Mac OSX). COLA's objective in building grads is to make our binary releases portable, so we strive to build all the libraries from scratch, disabling features grads doesn't need, and then link statically when building grads. If you are building GrADS from source but not planning to distribute your build, then you may find that many of these libraries are already installed on your system and you can link with them dynamically. In this case, use the --enable-dyn-supplibs option with the GrADS configure script. 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.1/src
mget *
quit
These are the directories where you will install the compiled
libaries, pkgconfig files, the necessary include files, and any
executable utilities from the libraries that GrADS will need:
mkdir $HOME/supplibs/lib
mkdir $HOME/supplibs/lib/pkgconfig
mkdir $HOME/supplibs/include
mkdir $HOME/supplibs/bin
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. If you are building on Mac OSX 10.6, set the environment variable CFLAGS to "-arch i386". For Mac OSX 10.7, I have used -arch x86_64.
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. |
cd $HOME/supplibs/src/ |
ncurses | 5.7 |
Required by readline. |
cd $HOME/supplibs/src/ |
zlib | 1.2.5 |
General compression library. |
cd $HOME/supplibs/src/ |
libpng | 1.5.12 |
PNG reference library. Links: home page local copy of source code |
cd $HOME/supplibs/src/ Note: The pkgconfig file is required for building cairo |
jpeg | 6b |
Image compression library. Links: home page local copy of source code |
cd $HOME/supplibs/src/ |
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 mkdir gd cd gd-2.0.34 ./configure --with-png=$HOME/supplibs/src/libpng --with-jpeg=$HOME/supplibs/src/jpeg --prefix=$HOME/supplibs/src/gd make ; make install cp $HOME/supplibs/src/gd/lib/libgd.a $HOME/supplibs/lib mkdir $HOME/supplibs/include/gd cp $HOME/supplibs/src/gd/include/* $HOME/supplibs/include/gd |
jasper | 1.900.1 |
For image coding and manipulation Links: home page local copy of source code |
cd $HOME/supplibs/src/ |
g2clib | 1.4.0 |
Decodes data in GRIB2 format. |
cd $HOME/supplibs/src/
Note: There is no configure script in this
library, so you must edit the makefile to change two lines identified
below (INC, CC). Write out $HOME explicitly in the makefile.
make |
szip | 2.1 |
General purpose lossless compression library. |
cd $HOME/supplibs/src/ |
udunits | 1.11.7 |
Supports units of physical quantities. |
cd $HOME/supplibs/src/ |
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/ |
hdf5 | 1.8.11 |
(GrADS 2.0.a7+) Hierarchical Data Format library, version 5. Requires: zlib, szip Links: home page local copy of source code |
cd $HOME/supplibs/src/ |
curl | 7.19.6 |
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 mkdir curl cd curl-7.19.6 ./configure --without-ssl --without-libidn --enable-static --disable-ldap --prefix=$HOME/supplibs/src/curl make ; make install cp $HOME/supplibs/src/curl/lib/libcurl.a $HOME/supplibs/lib cp $HOME/supplibs/src/curl/lib/pkgconfig/libcurl.pc $HOME/supplibs/lib/pkgconfig |
netcdf | 4.2.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
Note: before running configure, set the following environment variables:
Note: After the library is built, you can unset the environment variables: |
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 mkdir tiff cd tiff-3.8.2 ./configure --prefix=$HOME/supplibs/src/tiff 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 mkdir geotiff cd libgeotiff-1.2.5 ./configure --enable-incode-epsg --enable-static --with-libtiff=$HOME/supplibs/src/tiff --prefix=$HOME/supplibs/src/geotiff make ; make install cp $HOME/supplibs/src/geotiff/lib/libgeotiff.a $HOME/supplibs/lib mkdir $HOME/supplibs/include/geotiff cp $HOME/supplibs/src/geotiff/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/ |
pkgconfig | 0.23 |
(GrADS 2.1.a0+) A helper tool used when compiling applications and libraries. Required for Cairo. Links: home page local copy of source code |
cd $HOME/supplibs/src |
xml2 | 2.6.16 |
An XML parser and toolkit. |
cd $HOME/supplibs/src |
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
N.B. You may need edit configure.ac so it
won't use pkg-config to find curl or xml2 (libdap_pkgconfig_libcurl=no
and libdap_pkgconfig_libxml2=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. Alternatively, you can set the following environment
vars:
./configure |
gadap | 2.0 |
Enables OPeNDAP access of in situ data. Requires dap, curl, and xml2. Links: local copy of source code |
cd $HOME/supplibs/src |
Xrender | 0.9.6 |
(GrADS 2.1.a0+) A helper tool used when compiling applications and libraries. Required for Cairo. Links: home page local copy of source code |
cd $HOME/supplibs/src N.B. It may be necessary to unset the environment vars PGK_CONFIG and PKG_CONFIG_PATH before configuring libXrender. If so, be sure to reset them before continuing to build the remainder of the libraries.
./configure --prefix=$HOME/supplibs/src/libXrender |
pixman | 0.28.0 |
(GrADS 2.1.a0+) |
cd $HOME/supplibs/src |
freetype | 2.4.10 |
(GrADS 2.1.a0+) A software font engine. Required by Cairo. Links: home page local copy of source code |
cd $HOME/supplibs/src |
fontconfig | 2.9.0 |
(GrADS 2.1.a0+) A library for configuring and customizing font access. Required by Cairo. Links: home page local copy of source code |
cd $HOME/supplibs/src
N.B. After configuration, edit config.h to set USE_ICONV = 0 |
cairo | 1.12.16 |
(GrADS 2.1.a1+) A 2D graphics library with support for multiple output devices. Requires pkgconfig, zlib, xml2, libpng, pixman, fontconfig, freetype, and Xrender. Links: home page local copy of source code |
cd $HOME/supplibs/src |