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 applies to 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 will need to do a few things before you can use h5cc, as it has site specific paths in it. Make sure the binaries are built with the same compiler that you are using.
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 run-all-ex.sh to compile and run them.
On Windows they are provided in the top HDF5 directory. Follow the instructions in the USING_CMake_Examples.txt file to build the examples.