How do I build HDF5 from source
The following instructions are for building with configure. (If you wish to use CMake, see Building with CMake. Also, refer to the INSTALL_CMake.txt file in the source code.)
If need be, specify the compilers to use. For example:
setenv CC /<path_to_compiler>/gcc setenv FC /<path_to_compiler>/f90
The simple instructions are:
cd <top HDF5 source code directory> ./configure --prefix=<location for HDF5 software> make 2>&1 make.out make check 2>&1 check.out make install
2>&1 rather than
>& to redirect both stdout and stderr to a file. That way issues from the OS, shell or compiler will be included in the output file.
If the tests fail, you can run the tests with the
-i option to ignore errors:
make -i check >& check.out
To clean up the tests so that they can be rerun, type:
You can see how many tests pass or fail, as follows:
$ grep -c FAIL check.out
$ grep -c PASS check.out
To view the options that can be specified with configure, specify the -h option to configure.
Other common options that can be used with configure are:
--enable-java --with-zlib=INSTALLDIR --with-szlib=INSTALLDIR --disable-shared --enable-static --disable-hl
Review the check.out file to be sure everything was built and tested properly.
For more detailed instructions refer to the INSTALL file in the release_docs/ directory of the HDF5 source code.
Windows and UNIX (CMake)
You must use CMake to build HDF5 from source on Windows. CMake can also be used to build on Unix platforms.
See Building with CMake for instructions on building HDF5 with CMake. Also, refer to the INSTALL_CMake.txt file in the source code.