Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To use HDF5 on Gadi, first load one of the HDF5 modules. 

Code Block
languagebash
$ module load hdf5/1.10.7

Please note that it is important to specify a version when loading a HDF5 module, as some files created by later HDF5 versions cannot be opened by earlier versions. In order to build an application on Gadi against HDF5, only the required HDF5 libraries need to be linked

Code Block
languagebash
$ gcc -o read_h5_file read_h5_file.c -lhdf5 -lhdf5_hl

The libraries that HDF5 depends on are linked automatically by default using data stored in the shared HDF5 libraries. You do not need to load any underlying modules in order to compile your application. To use the fortran interface, the fortran libraries also need to be linked

Code Block
languagebash
$ gfortran -o read_h5_file read_h5_file.f90 -lhdf5_fortran -lhdf5hl_fortran -lhdf5 -lhdf5_hl

...

We do not usually recommend the use of static linking on Gadi, as it prevents applications from receiving important security or bug fixes that would otherwise be applied automatically when shared libraries are updated. If your application uses HDF5, and is compiled statically (e.g. by passing the -static flag to the compiler) then you will need to include the libraries that HDF5 depends on. The easiest way to do this is to use the compiler wrappers provided with HDF5

Code Block
languagebash
$ h5cc -static -o read_h5_file read_h5_file.c
$ h5fc -static -o read_h5_file read_h5_file.f90

...

There are two HDF5 modules available for each software version:

Code Block
languagebash
$ module avail hdf5
-------------------------- /apps/Modules/modulefiles ---------------------------
hdf5/1.8.21   hdf5/1.10.5   hdf5/1.10.7(default)  hdf5/1.12.1
hdf5/1.8.21p  hdf5/1.10.5p  hdf5/1.10.7p          hdf5/1.12.1p

...