BISMG:SarahS/install netcdf

How to install netcdf libraries on bluecrystalp3
You need to build the c and gfortran libraries separately
 * Download the c library from here
 * wget https://github.com/Unidata/netcdf-c/archive/v4.3.3-rc2.tar.gz


 * Download the fortran libraries from here
 * wget https://github.com/Unidata/netcdf-fortran/archive/v4.4.0.tar.gz


 * Uncompress the files tar -xvzf filename.gz


 * Build the c netcdf libraries in this directory mkdir netcdf. The built c and fortran libraries have different names so it should not cause a conflict
 * Call configure home dir.
 * CPPFLAGS=-I/cm/shared/libraries/gnu_builds/hdf5-1.8.12/include/ LDFLAGS="-L/cm/shared/libraries/gnu_builds/hdf5-1.8.12/lib -lhdf5_hl -lhdf5 -lz" ../netcdf-c-4.3.3-rc2/configure --prefix=/panfs/panasas01/geog/ggsrs/netcdf
 * make
 * make install
 * make check


 * Build the fortran netcdf libraries in this directory. Remember to link to the hdf5 libraries.
 * mkdir netcdff-build, cd netcdff-build
 * CPPFLAGS=-I/$HOME/netcdf/include/ LDFLAGS="-L/$HOME/netcdf/lib -lnetcdf -L/cm/shared/libraries/gnu_builds/hdf5-1.8.12/lib -lhdf5_hl -lhdf5 -lz" ../netcdf-fortran-4.4.0/configure --prefix=/panfs/panasas01/geog/ggsrs/netcdf
 * make
 * make install
 * make check


 * /panfs/panasas01/geog/ggsrs/netcdf should contain fortran and c netcdf libraries

For information on the netcdf library paths use these commands netcdf/bin/nf-config --fflags netcdf/bin/nf-config --flibs

How to install parallel version of the netcdf libraries on bluecrystalp3

 * Need to install parallel hdf5 and rebuild netcdf c and fortran netcdf libraries in parallel linking to parallel hdf5
 * Create directories for build libraries, phdf5, pnetcdf-build, pnetcdff-build
 * Download parallel hdf5 from here http://www.hdfgroup.org/HDF5/release/obtainsrc.html
 * module add mvapich2/gcc/64/1.7-qlc
 * CC=/usr/mpi/gcc/mvapich2-1.7-qlc/bin/mpicc CXX=/usr/mpi/gcc/mvapich2-1.7-qlc/bin/mpicc FC=/usr/mpi/gcc/mvapich2-1.7-qlc/bin/mpif90 ./configure --prefix=/panfs/panasas01/geog/ggsrs/phdf5-build/ --enable-parallel
 * make && make install & make check