Skip to content

Instantly share code, notes, and snippets.

@milancurcic
Last active July 11, 2024 17:03
Show Gist options
  • Save milancurcic/3a6c1a97a99d291f88cc61dae6621bdf to your computer and use it in GitHub Desktop.
Save milancurcic/3a6c1a97a99d291f88cc61dae6621bdf to your computer and use it in GitHub Desktop.
Building the parallel OpenMPI-HDF5-NetCDF stack

Parallel OpenMPI-HDF5-NetCDF stack

Description

Instructions for building the OpenMPI-HDF5-NetCDF stack with parallel I/O from source, using the Intel Compiler suite.

Valid for the following packages:

  • openmpi-2.1.1
  • hdf5-1.8.19
  • netcdf-4.4.1.1
  • netcdf-fortran-4.4.4

Dependencies:

  • zlib

Instructions

Set OPENMPI, HDF5, and NETCDF to appropriate install directories.

Building openmpi

export OPENMPI=/path/to/install/directory
CC=icc CXX=icpc FC=ifort ./configure --prefix=$OPENMPI
make && make install
export PATH=$OPENMPI/bin:$PATH
export LD_LIBRARY_PATH=$OPENMPI/lib:$LD_LIBRARY_PATH

Building HDF5

export HDF5=/path/to/install/directory
CC=mpicc FC=mpif90 CFLAGS=-fPIC ./configure --enable-shared --enable-parallel --enable-fortran --enable-fortran2003 --prefix=$HDF5
make && make install

Building NetCDF-C

export NETCDF=/path/to/install/directory
CC=mpicc LDFLAGS=-L$HDF5/lib LIBS=-lhdf5 CPPFLAGS=-I$HDF5/include ./configure --prefix=$NETCDF
make && make install

Building NetCDF-Fortran

CC=mpicc FC=mpif90 LDFLAGS=-L$NETCDF/lib CPPFLAGS=-I$NETCDF/include LIBS=-lnetcdf ./configure --prefix=$NETCDF --enable-parallel-tests
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment