wiki:BuildingParNCLPreReq
Last modified 5 years ago Last modified on 04/08/13 13:42:13

Pre-requisite Software for building ParNCL

Since ParNCL requires many external software packages make sure that all the packages are compiled with the same set of compilers and use the same compiler options (This makes life easier). For tcsh build scripts assuming that you are using GNU compilers use,

setenv CC gcc
setenv CXX g++
setenv FC gfortran

If you are using gcc, you need version 4.4 or later. Don't use g77 fortran compiler for building any of the packages. The compiler is old and replaced by the newer gfortran compiler.

The following external packages are required before building NCL.

  • JPEG
  • X11 development packages
    • X11
    • Xpm
    • Xext
  • PNG
  • PROJ.4
  • ZLIB
  • GDAL
  • MPI
  • NetCDF
    • szip
    • HDF-5
    • cURL

JPEG

All versions of the JPEG image compression library are not compatible with NCL (and other packages like HDF4).

  • Download version 6b from HDF4 website.
  • Build and install the software
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
./configure --prefix=$HOME/utils/jpeg-6b/install |& tee configure.log
make |& tee make.log
make install |& tee install.log
  • "make install" will not install lib and header files automatically, you will additionally need to do this:
make install-lib
make install-headers

X11 development packages

These libraries are usually installed as part of an X developer's package.

X11

  • (Mac-Users) Some Mac systems have X11 libraries installed in "/usr/X11/lib" (and headers in "/usr/X11/include"). In this case you need to specify the include/lib paths while configuring ParNCL
  • Download X11 version 1.5.0 from X11 website.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
autoreconf -fi
./configure --prefix=$HOME/utils/X11-1.5.0/install --disable-shared --enable-static |& tee configure.log
make |& tee make.log
make install |& tee install.log

Xpm

  • Download Xpm version 3.5.10 from Xpm website.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
autoreconf -fi
./configure --prefix=$HOME/utils/xpm-3.5.10/install --disable-shared --enable-static |& tee configure.log
make |& tee make.log
make install |& tee install.log

Xext

  • Download Xext version 1.3.1 from Xext website.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
autoreconf -fi
./configure --prefix=$HOME/utils/Xext-1.3.1/install --disable-shared --enable-static |& tee configure.log
make |& tee make.log
make install |& tee install.log

PNG

  • Download PNG version 1.5.13 from PNG website.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
./configure --prefix=$HOME/utils/png-1.5.13/install |& tee configure.log
make |& tee make.log
make install |& tee install.log

PROJ.4

  • Download and install PROJ.4 version 4.8.0 from PROJ.4 website.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran

./configure --prefix=$HOME/utils/proj-4.8.0/install --enable-static=yes --enable-shared=no |& tee configure.log
make |& tee make.log
make install |& tee install.log

ZLIB

  • Download ZLIB version 1.2.5 from ZLIB website.
  • I had to comment out line 171 in the Makefile.in that assumed the existence of shared libs.
            cp $(STATICLIB) $(DESTDIR)$(libdir)
    #       cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
            cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
    
  • Configure ZLIB to generate static libraries
  • Build and install the source
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
./configure --prefix=$HOME/utils/zlib-1.2.5/install --static |& tee configure.log
make |& tee make.log
make install |& tee install.log

GDAL

  • Download and install GDAL version 1.9.2 from GDAL website.
  • Configure GDAL using the options specified below
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran

./configure --prefix=$HOME/utils/gdal-1.9.2/gdal-install --with-static-proj4=$HOME/utils/proj-4.8.0/install --without-pam --with-png=$HOME/utils/png-1.5.13/install --with-gif=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg=$HOME/utils/jpeg-6b/install --with-libz=$HOME/utils/zlib-1.2.5/install --with-sqlite3=no --with-expat=no --with-curl=no --without-ld-shared --with-hdf4=no --with-hdf5=no --with-pg=no --without-grib --with-freexl=no --with-geos=no --enable-static --disable-shared

make all |& tee make.log
make install |& tee install.log

SZIP

  • Download szip version 2.1 from HDF4 website.
  • Configure szip to generate static libraries.
  • Build and install SZIP.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++
setenv FC gfortran
./configure --prefix=$HOME/utils/szip-2.1/install --disable-shared --enable-static |& tee configure.log
make |& tee make.log
make install |& tee install.log

cURL

  • Download version 7.24.x or later from cURL website.
  • Configure cURL to generate static libraries.
  • Build and install cURL.
#!/bin/tcsh
setenv CC gcc
setenv CXX g++

./configure --prefix=$HOME/utils/curl-7.28.1/install --disable-shared --enable-static |& tee configure.log
make |& tee make.log
make install |& tee install.log

MPI

MPI is required for building all the subsequent libraries.

Get and Install MPI:

We use MPICH2, the free implementation of MPI-2 available from Argonne National Laboratory

HDF5

  • Download HDF5 version 1.8.5-patch 1 from the HDF5 ftp site. Note that versions > 1.8.5-patch1 have not been tested and versions < 1.8.5patch1 have known issues with NetCDF.
  • (Mac Users) HDF5-1.8.6 works with NetCDF 4.1.2
  • Enable parallel option (MOAB requires a parallel build of HDF5)
  • Configure HDF5 to generate static libraries
#!/bin/tcsh
setenv CC mpicc
setenv CXX mpic++
setenv FC mpif90
./configure --prefix=$HOME/utils/hdf5-1.8.5-patch1/install --disable-shared --enable-static --with-zlib=$HOME/utils/zlib-1.2.5/install --enable-parallel |& tee configure.log
make |& tee make.log
make install |& tee install.log

NetCDF

  • Download NetCDF version 4.1.1 from NetCDF website.
  • (Mac Users) NetCDF 4.1.2 with HDF5-1.8.6 is known to work.
  • Eventhough I specified the paths to hdf5 to the NetCDF configure script with the "--with-hdf5" option I had to set the compiler flags for NetCDF to pick the correct libraries. This needs to be investigated further.
  • Configure NetCDF to disable shared libraries, enable NetCDF 4 and use the hdf5, zlib and szip libraries installed.
#!/bin/tcsh
setenv CC mpicc
setenv CXX mpic++
setenv FC mpif90
setenv CFLAGS '-I$HOME/utils/hdf5-1.8.5-patch1/install/include -I$HOME/utils/zlib-1.2.5/install/include -I$HOME/utils/szip-2.1/install/include'
setenv LDFLAGS '-no-undefined -L$HOME/utils/hdf5-1.8.5-patch1/install/lib -L$HOME/utils/zlib-1.2.5/install/lib -L$HOME/utils/szip-2.1/install/lib'
setenv CXXFLAGS '-I$HOME/utils/hdf5-1.8.5-patch1/install/include -I$HOME/utils/zlib-1.2.5/install/include -I$HOME/utils/szip-2.1/install/include'
./configure --prefix=$HOME/utils/netcdf-4.1.1/install --enable-netcdf4 --disable-shared --with-hdf5=$HOME/utils/hdf5-1.8.5-patch1/install --with-zlib=$HOME/utils/zlib-1.2.5/install --with-szip=$HOME/utils/szip-2.1/install |& tee configure.log
make |& tee make.log
make install |& tee install.log