h5fcandh5pfccan be used in much the same waympif90by MPICH is used to compile an HDF5 program. These tools take care of specifying on the command line the locations of the HDF5 header files and libraries.h5fcis for use in serial computing environments;h5pfcis for parallel environments.
h5fcandh5pfcsubsume all other compiler scripts in that if you have used a set of scripts to compile the HDF5 Fortran library, thenh5fcandh5pfcalso use those scripts. For example, when compiling an MPICH program, you use thempif90script. If you have built HDF5 using MPICH, thenh5fcuses the MPICH program for compilation.
Some programs use HDF5 in only a few modules. It is not necessary to useh5fcandh5pfcto compile those modules which do not use HDF5. In fact, sinceh5fcandh5pfcare only convenience scripts, you can still compile HDF5 Fortran modules in the normal manner, though you will have to specify the HDF5 libraries and include paths yourself. Use the-showoption to see the details.
An example of how to useh5fcto compile the programhdf_prog, which consists of the modulesprog1.f90andprog2.f90and uses the HDF5 Fortran library, would be as follows.h5pfcis used in an identical manner.
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. h5fcandh5pfcuse the 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-inh5fcandh5pfcdefaults.
Use a different Fortran compiler.
Use a different linker.
Use shared version of the HDF5 library. Default: no, except when HDF5 built with only shared libraries.
Use additional Fortran compiler flags.
Use additional library paths.
Use additional libraries.
The last three 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 theh5fcandh5pfcscripts.
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.
Tool updated to recognize.f95,.f03, and.f08file extensions.
Three compiler flags and environment variables added.