Building H5Part

We recommned that you build against the 1.8.x tree of HDF5. Although older version of H5Part work with the 1.6.x branch, current and future releases may not.

Download and install HDF5 1.8:

Build H5Part:


Quickstart for the impatient

  1. Configure:
    For the serial implementation
        ./configure
    
    For the parallel implementation configure with
        ./configure --enable-parallel
    
    If you also want to build fortran bindings, add the --enable-fortran flag to the configure line.
  2. Make the Library:
    Type make to build the library. The libraries are named accordingly.
    • libH5Part.a: Serial C/C++ Library.
    • libpH5Part.a: Parallel C/C++ library.
    • libH5PartF.a: Serial F77/F90 library.
    • libpH5PartF.a: Parallel F77/F90 library.
  3. Make Regression Tests and Examples:
    Just type make tests to build regression tests and/or example programs for H5Part. These tests are
    • H5PartF: Fortran example (only build if --enable-fortran is specified).
    • H5PartFpar: Parallel Fortran example (only built if both --enable-fortran and --enable-parallel are specified).
    • H5PartTest: Serial C example. This test writes a sample datafile and then reopens it for reading. It demonstrates the most basic reading/writing capabilities.
    • H5PartTestP: Parallel C example (only built if --enable-parallel is specified). This program only works as an MPI/parallel program.
    • Bench: This program will only be built if --enable-parallel is specified. It compares the performance of raw binary I/O (one file per processor), raw binary MPI-IO based parallel I/O to a single file, and the parallel H5Part/HDF5 to a single file. Generally, H5Part should be very close to the MPI-IO implementation in terms of performance, but slower than one-file-per-processor. If HDF5 is slower the MPI-IO, it would indicate that some performance tuning will be required for your platform (contact us, and we will see what we can do!).
  4. Building Your Own Programs:
    There are many different subtleties to linking on various computer platforms, but typically one does the following.
    • C/C++ Serial:
      #include < H5Part.h > into your source file.
      $CC -Ipath_to_H5Part.h -Ipath_to_hdf5.h -o outfile MyFile.cc -Lpath_to_libH5Part.a -lH5Part -Lpath_to_libhdf5 -lhdf5 -lz -lsz
    • C/C++ Parallel:
      #include < H5Part.h > into your source file.
      $MPICC -Ipath_to_H5Part.h -Ipath_to_hdf5.h -DPARALLEL_IO -DH5_HAVE_PARALLEL -o outfile MyFile.cc -Lpath_to_libH5Part.a -lH5Part -Lpath_to_libhdf5 -lhdf5 -lz -lsz
    • Fortran Serial:
      include 'H5Part.inc' into your source file.
      $FC -Ipath_to_H5Part.h -Ipath_to_hdf5.h -o outfile MyFile.cc -Lpath_to_libH5PartF.a -lH5PartF -Lpath_to_libhdf5 -lhdf5 -lz -lsz -lc
    • Fortran Parallel:
      include 'H5Part.inc' into your source file.
      $MPIF90 -Ipath_to_H5Part.h -o outfile MyFile.cc -Lpath_to_libpH5PartF.a -lpH5PartF -Lpath_to_libhdf5 -lhdf5 -lz -lsz -lc

Details for H5Part Configure and Build

Configure Options

H5Part uses GNU Autoconf to generate a Makefile from the makefile template called Makefile.in. The configure script pays attention to the following configure options;

Make Options

Environment Variables for Configure

The configuration script is of limited intelligence. Sometimes, you have to define the following environment variables in order to help it on its way. You will often only need to tell it where to find the HDF5 libraries (H5ROOT for serial or PHDF5ROOT for parallel builds). All of these environment variables can also be overidden in the Makefile that is generated by the autoconfigure script. The configure script pays attention to the following environment variables;

Configuration options for NERSC platforms