WRF Installation on NTNU-HPCS (cschang @ Sep. 2017)
1. Installation
1.1 Compiler & MPI:
In :~/.bash_profile":
- source /opt/intel/compilers_and_libraries_2017/linux/bin/compilervars.sh intel64
- export PATH=/opt/openmpi-1.10.5-intel17/bin:$PATH
- export LD_LIBRARY_PATH=/opt/openmpi-1.10.5-intel17/lib:$LD_LIBRARY_PATH
- export LD_RUN_PATH=/opt/openmpi-1.10.5-intel17/lib:$LD_RUN_PATH
($ mpirun -V )
- download hdf5 from https://support.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.10.1.tar
- ( echo $CC $CXX $FC $F90 )
- (Note: suggest to check which version with "mpicc", "mpicxx", "mpif90" )
- export CC=mpicc
- export CXX=mpicxx
- export FC=mpif90
- export F90=mpif90
( echo $CC $CXX $FC $F77 $F90 )
- ./configure --prefix=/home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/ --enable-parallel --enable-shared --enable-static --enable-fortran
(check config.status)
- make -j 12 install
$cat /home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/lib/libhdf5.settings
or
$ldd /home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/bin/xxxxxx
1.3 Building parallel-netcdf (pnetcdf)
- download pnetcdf from http://trac.mcs.anl.gov/projects/parallel-netcdf
- export CC=mpicc
- export CXX=mpicxx
- export FC=mpif90
- export F90=mpif90
- export OMPI_MPICC=icc
- export OMPI_MPICXX=icpc
- export OMPI_MPIFC=ifort
- export OMPI_MPIF77=ifort
- export OMPI_MPIF90=ifort
( echo $OMPI_MPICC $OMPI_MPICXX $OMPI_MPIFC $OMPI_MPIF77 $OMPI_MPIF90 )
- export CFLAGS="-g -O2 -fPIC"
- export CXXFLAGS="-g -O2 -fPIC"
- export FFLAGS="-g -fPIC"
- export FCFLAGS="-g -fPIC"
- export FLDFLAGS="-fPIC"
- export F90LDFLAGS="-fPIC"
- export LDFLAGS="-fPIC"
("-fPIC" needs by shared library)
( echo $CFLAGS $CXXFLAGS $FFLAGS $FCFLAGS $FLDFLAGS $F90LDFLAGS $LDFLAGS )
- ./configure --prefix=/home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5/ --enable-fortran --enable-large-file-test
- make -j 16 install
- (make check --> check squential programs)
- (make ptest --> check parallel programs)
# after install, to check:
$ldd /home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5/bin/xxxxxx
1.4 Building netcdf-C & netcdf-fortran
#netcdf-C:
(same as $1.2; $ echo $CC $CXX $FC $F77 $F90 )
- download netcdf-C from ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.1.tar.gz (only use this version)
- download netcdf-fortran from ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.3.tar.gz
- export CC=mpicc
- export CXX=mpicxx
- export FC=mpif90
- export F90=mpif90
- export OMPI_MPICC=icc
- export OMPI_MPICXX=icpc
- export OMPI_MPIFC=ifort
- export OMPI_MPIF77=ifort
- export OMPI_MPIF90=ifort
- export HDF5=/home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5
- export PNET=/home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5
- export CFLAGS="-I$HDF5/include -I$PNET/include"
- export CXXFLAGS="-I$HDF5/include -I$PNET/include"
- export CPPFLAGS="-I$HDF5/include -I$PNET/include"
- export FFLAGS="-I$HDF5/include -I$PNET/include"
- export FCFLAGS="-I$HDF5/include -I$PNET/include"
- export LDFLAGS="-I$HDF5/include -I$PNET/include -L$HDF5/lib -L$PNET/lib"
- ./configure --prefix=/home/cschang/software_cschang/netcdf-4.4.x_intel-17.0.1_openmpi-1.10.5 --enable-fortran --disable-static --enable-shared --with-pic --enable-parallel-tests --enable-pnetcdf --enable-large-file-tests --enable-largefile --disable-dap --enable-netcdf4
- make
- make check
- make install
(check: ..../lib/libnetcdgf.settings --> PNetCDF Support: yes)
#netcdf-fortran:
- export NCDIR=/home/cschang/software_cschang/netcdf-4.4.x_intel-17.0.1_openmpi-1.10.5
- export LD_LIBRARY_PATH=${NCDIR}/lib:$LD_LIBRARY_PATH
- export CFLAGS="-I$HDF5/include -I$NCDIR/include"
- export CXXFLAGS="-I$HDF5/include -I$NCDIR/include"
- export CPPFLAGS="-I$HDF5/include -I$NCDIR/include"
- export FFLAGS="-I$HDF5/include -I$NCDIR/include"
- export FCFLAGS="-I$HDF5/include -I$NCDIR/include"
- export LDFLAGS="-I$HDF5/include -I$NCDIR/include -L$HDF5/lib -L$NCDIR/lib"
( echo $CFLAGS $CXXFLAGS $CPPFLAGS $FCFLAGS $FFLAGS $LDFLAGS )
- ./configure --prefix=$NCDIR --disable-static --enable-shared --with-pic --enable-parallel-tests --enable-large-file-tests --enable-largefile
- make
- make install
- Note: You can use script "nf-config" to find out the relevant compiler options to build your application. Enter
#set environment variables for pnetcdf & NETCDF:
1.5 Building extra libraries for "grib2" (JasPer + libpng + zlib)
#JasPer:
- ref: "WRF user Guide"