PGI Guide to HDF5

This guide is intended to help build the HDF5 package for Linux using PGI 2012 compilers.

Version Information

This guide was created for HDF5 release 1.8.10 compiled using the PGI 2012 compilers. This information is for both x64 processors running 64-bit Linux and x86 processors running 32 bit Linux.

Application Notes

Information about HDF5 can be found on the HDF5 website. From the HDF5 home page:

"HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, viewing, and analyzing data in the HDF5 format. "

The HDF5 technology suite includes:

  • A versatile data model that can represent very complex data objects and a wide variety of metadata.
  • A completely portable file format with no limit on the number or size of data objects in the collection.
  • A software library that runs on a range of computational platforms, from laptops to massively parallel systems, and implements a high-level API with C, C++, Fortran 90, and Java interfaces.
  • A rich set of integrated performance features that allow for access time and storage space optimizations.
  • Tools and applications for managing, manipulating, viewing, and analyzing the data in the collection."

Obtaining the Source Code

The HDF5 source code is available from the HDF5 website referenced above. You may want to check there for recent updates.


HDF5 can be configured to use several different external software packages. This example uses one of the simpler configurations, but does use the zlib and szlib compression libraries.

Building, Testing and Installing HDF5

  1. Untar the HDF5 package:

      tar -xvzf hdf5-1.8.10.tar.gz
      cd hdf5-1.8.10
  2. HDF5 can be configured for parallel use and with Fortran interfaces and debugging symbols:

      env CC=mpicc FC=mpif90 CXX=mpicxx LDFLAGS=-lnuma ./configure --enable-fortran 
      --enable-fortran2003 --enable-production --enable-unsupported --enable-parallel 
      --enable-cxx --with-zlib --with-szlib --prefix=/usr/local
  3. Build the code:

      make >& make.log
      make test >& make_test.log
  4. Finally, install the results.

      sudo make install

Known Issues and Limitations

The code can be compiled with experimental C++ bindings by adding CXX=mpiCC and ‑‑enable-cxx to the configure line as shown above. With C++ enabled, the C++ tfile test may fail in some earlier versions on HDF5. This is a failure in the test harness rather then the C++ file I/O functions.

Click me