Parallel NetCDF

Building Parallel NetCDF with Arm Compiler


Overview Before you begin Procedure Related information

Overview

How to build Parallel NetCDF with Arm Compiler for HPC.

Parallel NetCDF is a parallel IO library for accessing NetCDF files in CDF-1, 2, and 5 formats. For more information on Parallel NetCDF, see the Parallel NetCDF website.

For the purposes of this build, the following components are used:

 Component Form
 Parallel NetCDF  Version 1.9.0
 HDF5  Version 1.10.5
 Arm Compiler for HPC
 Version 19.2
 Open MPI  Version 4.0.1
 Operating system  RHEL 7.5
 Hardware
 Cavium ThunderX2

Recipes for other versions of the application are available in the GitLab Packages Wiki.

Procedure

  1. Create build and install locations, and set them using the environment variables build_dir and install_dir, for example:

    mkdir pnetcdf_build
    mkdir pnetcdf_install
    export build_dir=/path/to/pnetcdf_build 
    export install_dir=/path/to/pnetcdf_install

    replacing /path/to/ with the path to the new directories.

  2. Specify the location of the HDF5 installation by setting hdf_dir, respectively, such as:

    export hdf_dir=/path/to/hdf5_install

    replacing /path/to/hdf_install with the path to your HDF5 installation, respectively.

  3. Download and unpack Parallel NetCDF:

    cd $build_dir
    wget http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.9.0.tar.gz
    tar -zxvf parallel-netcdf-1.9.0.tar.gz
    cd parallel-netcdf-1.9.0
  4. To build for Arm AArch64, you require up-to-date versions of config.guess and config.sub.

    To obtain up-to-date versions, use:

    wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O scripts/config.guess
    wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O scripts/config.sub
  5. Set the compiler environment variables:

    export CC=armclang
    export CXX=armclang++
    export F77=armflang
    export F90=armflang
    export FC=armflang
    export MPICC=mpicc
    export MPIF77=mpifort
    export MPIF90=mpifort
    export MPICXX=mpicxx
  6. Configure the build by passing the location of the HDF5 include and lib directories using a series of environment variables:

    export CFLAGS="-I${hdf_dir}/include -O3 -fPIC -DPIC" 
    export CXXFLAGS="-I${hdf_dir}/include -O3 -fPIC -DPIC"
    export FFLAGS="-I${hdf_dir}/include -O3 -fPIC"
    export FCFLAGS="-I${hdf_dir}/include -O3 -fPIC"
    export LDFLAGS="-L${hdf_dir}/lib -L${hdf_dir}/lib" 
    
     ./configure  --prefix=$install_dir
  7. Build, test, and install Parallel NetCDF, using:

    make
    make check
    make ptest
    make install