Installed location:
In your program include the appropriate HDF header files and call the: appropriate HDF functions.
To compile and link enter:
gcc pgm.c -I$HDF_HOME/include -L$HDF_HOME/lib -lmfhdf -ldf -ljpeg -lz -o pgmReplace pgm.c with the name of the file containing your source code and pgm with the name of the executable to be created. If you omit -static, you will have to set the LD_LIBRARY_PATH environmen variable at run time to include HDF_HOME/lib.
Set HDF_HOME to be: /u/local/apps/hdf/current. You can either set an environment variable or replace $HDF_HOME in the command shown above.
In your program include the appropriate HDF header files and call the: appropriate HDF functions.
To compile and link enter:
ifort pgm.f90 -I$HDF_HOME/include -L$HDF_HOME/lib -lmfhdf -ldf -ljpeg -lz -o pgmReplace pgm.f90 with the name of the file containing your source code and pgm with the name of the executable to be created.
Set HDF_HOME to be: /u/local/apps/hdf/current. You can either set an environment variable or replace $HDF_HOME in the command shown above.
See also the compiling instructions from the HDF group.
An exmaple of compiling sd_create.f on Hoffman2 cluster:
$ ifort sd_create.f -L/u/local/apps/hdf/current/lib -lmfhdf -ldf -ljpeg -lz $ a.out ... sd.hdf created ... data1 created ... data written out ... file closed
In your program include the appropriate HDF header files and call the: appropriate HDF5 functions.
To compile and link using the gcc compiler enter:
gcc pgm.c -I$HDF5_HOME/include -L$HDF5_HOME/lib -lhdf5_hl -lhdf5 -lz -lm -static -o pgmor:
h5cc pgm.c -o pgm
To compile and link using the Intel compiler enter:
icc pgm.c -I$HDF5_HOME/include -L$HDF5_HOME/lib -lhdf5_hl -lhdf5 -lz -lm -static-intel -o pgmReplace pgm.c with the name of the file containing your source code and pgm with the name of the executable to be created. If you omit -static, you will have to set the LD_LIBRARY_PATH environmen variable at run time to include HDF5_HOME/lib.
Set HDF5_HOME to be: /u/local/apps/hdf5/current. You can either set an environment variable or replace $HDF5_HOME in the command shown above.
In your program include the appropriate HDF5 header files and call the: appropriate HDF functions.
To compile and link enter:
ifort pgm.f90 -L$HDF5_HOME/lib -lhdf5_fortran -lhdf5 -lz -lm -static-intel -o pgmor:
h5fc pgm.f90 -static-intel -o pgmReplace pgm.f90 with the name of the file containing your source code and pgm with the name of the executable to be created. If you omit -static, you will have to set the LD_LIBRARY_PATH environmen variable at run time to include HDF5_HOME/lib.
Set HDF5_HOME to be: /u/local/apps/hdf5/current. You can either set an environment variable or replace $HDF5_HOME in the command shown above.
HDF5 cannot be called from Fortran 77.