h5c++can be used in much the same way MPIch is used to compile an HDF5 program. It takes care of specifying where the HDF5 header files and libraries are on the command line.
h5c++supersedes all other compiler scripts in that if you've used one set of compiler scripts to compile the HDF5 C++ library, thenh5c++uses those same scripts. For example, when compiling an MPIch program, you use thempiCCscript.
Some programs use HDF5 in only a few modules. It isn't necessary to useh5c++to compile those modules which don't use HDF5. In fact, sinceh5c++is only a convenience script, you are still able to compile HDF5 C++ modules in the normal way. In that case, you will have to specify the HDF5 libraries and include paths yourself. Use the-showoption to see the details.
An example of how to useh5c++to compile the programhdf_prog, which consists of modulesprog1.cppandprog2.cppand uses the HDF5 C++ library, would be as follows:
Use the directoryDIRto find HDF5lib/andinclude/subdirectories Default: prefix specified when configuring HDF5.
Show the commands without executing them.
Compile using shared HDF5 libraries. Default for HDF5 built without static libraries.
Compile using static HDF5 libraries. Default for HDF5 built with static libraries.
The normal compile line options for your compiler.h5c++uses the same compiler you used to compile HDF5. Check your compiler's manual for more information on which options are needed.
When set, these environment variables override some of the built-in defaults ofh5c++.
Use a different C++ compiler.
Use a different linker.
Use shared version of the HDF5 library. Default: no, except when HDF5 built with only shared libraries.
Use additional preprocessor flags.
Use additional C++ compiler flags.
Use additional library paths.
Use additional libraries.
The last four of these environment variables have corresponding variables with names ending inBASEthat can also be set by editing their values in the "Things You Can Modify to Override HDF5 Library Build Components" section of theh5c++script.
Note that adding library paths toHDF5_LDFLAGSwhere another HDF5 version is located may link your program with that other HDF5 Library version.
An error occurred.
Tool modified to switch default to link to shared libraries when HDF5 configured with--disable-static.
Four compiler flags and environment variables added.