wiki:BuildingParNCLPreReq

Version 4 (modified by jayesh, 7 years ago) (diff)

The compilers for building HDF5 and NetCDF need to be MPI compilers

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

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

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 I haven't tested versions > 1.8.5-patch1 and versions < 1.8.5patch1 have known issues with NetCDF.
  • 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.
  • 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