wiki:BuildingParNCLPreReq

Version 12 (modified by xbxu, 7 years ago) (diff)

--

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

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
  • ZLIB
  • MPI
  • NetCDF
    • szip
    • HDF-5
    • libcurl
  • (Mac Users) Xpm
  • (Mac Users) PNG
  • (Mac Users) X11

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

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

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

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

Xpm

  • Only Mac Users need to install this library.
  • Download Xpm version 3.5.10 from Xpm website.
#!/bin/tcsh
setenv CC mpicc
setenv CXX mpic++
setenv FC mpif90
./configure --prefix=$HOME/utils/xpm-3.5.10/install |& tee configure.log
make |& tee make.log
make install |& tee install.log

PNG

  • Only Mac Users need to install this library.
  • Download PNG version 1.5.13 from PNG website.
#!/bin/tcsh
setenv CC mpicc
setenv CXX mpic++
setenv FC mpif90
./configure --prefix=$HOME/utils/png-1.5.13/install |& tee configure.log
make |& tee make.log
make install |& tee install.log

X11

  • Only Mac Users need to add the search path explicitly while running "Configure -v" command to build ParNCL.
  • Add /usr/X11/lib to libs search path.
  • Add /usr/X11/include to header search path.