Page tree

The license could not be verified: License Certificate has expired!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Are there compile scripts for building HDF5 applications ?


Yes, compile scripts are included in the bin/ directory of the built binaries when building HDF5 from source:

  • h5cc (C)
  • h5fc (if FORTRAN is enabled)
  • h5c++ (if C++ is enabled)

(Below, h5cc is specified but the information is similar for h5fc and h5c++, as well.)

To compile an application, type, h5cc -o prog prog.c where prog is the executable that gets created and prog.c is your application.

If you leave off -o prog then the executable is a.out.

Use h5cc -show to see what libraries and compiler are used by h5cc.

If building the HDF5 library from source, then the compile scripts should be ready to use without changes.

If using the pre-compiled binaries that we provide, you should use the same compiler that was used to build the binaries. After you have copied the files to the final installation directory, do the following:

  • cd to the bin/ directory in the pre-compiled binaries.
  • Run ./h5redeploy and enter yes to the question. This will fix some of the paths used in h5cc.

This should work in most cases. If it does not, you can edit the h5cc utility and check the values of the variables (eg. LDFLAGS, LIBS, CPPFLAGS, ..)


Applications included with the built HDF5 binaries

Example programs are included with the built binaries. For Unix, they are found in the share/hdf5_examples/ directory. Execute to compile and run them.

On Windows example programs are provided in the HDF5Examples folder in the top HDF5 directory. Follow the instructions in the USING_CMake_Examples.txt file to build the examples.