How to build HDF-EOS

This page explains how to build the HDF-EOS2 library and the HDF-EOS5 library.

HDF-EOS2

You can get the latest release from hereexternal. As of August 2021, HDF-EOS 3.0 is the latest version, and you can get the library from NASA web site external . There are two tar files for UNIX; one contains source code and sample code, and the other contains code for test drivers.

Because HDF-EOS2 is built on HDF4external , the HDF4external library is required to build the HDF-EOS2 library. HDF4external can optionally be built with the SZIPexternal compression library. If SZIPexternal was used, you need to know the library path. Due to the license issue, there are two types of SZIPexternal libraries: decoder only and encoder/decoder. You need to know which type of SZIPexternal is used to build HDF4external . The HDF-EOS2 needs to be built with the same type of SZIPexternal used to build HDF4external . Any inconsistencies regarding the SZIPexternal type will cause the failure of configure.

There are two ways to build HDF-EOS libraries. One way is to run the INSTALL-HDFEOS script. For detailed instructions, please read README under doc directory of the source distribution of the HDF-EOS2 library. Another way is to run configure and make. This is explained below.

The first step is to execute configure script included in the package. One option is required as a parameter to configure: CC. If HDF4external was built with SZIPexternal, another option --with-szlib is required. The following is an example when HDF4external is built with SZIPexternal.

Figure 1 Configure HDF-EOS2
$ ./configure \
CC=<hdf4_path>/bin/h4cc \
--with-szlib=<szip_path> --enable-install-include
If you are going to write a Fortran program and compile it with the HDF-EOS2 library, you need to build the HDF-EOS2 library with -Dfc2fortran option in CC like below:
Figure 2 Configure HDF-EOS2 with Fortran Support
$ ./configure \
CC='<hdf4_path>/bin/h4cc -Df2cFortran'\
--with-szlib=<szip_path> --enable-install-include
Alternatively, you can set the environment variables instead of supplying the above options. In csh or tcsh, you run the following commands:
Figure 3 Configure HDF-EOS2 with environment variables for csh or tcsh
%setenvCC <hdf4_path>/bin/h4cc

or

%setenvCC '<hdf4_path>/bin/h4cc -Df2cFortran' # For Fortran Support
%./configure --with-szlib=<szip_path> --enable-install-include
In sh or bash, you run the following commands:
Figure 4 Configure HDF-EOS2 with environment variables for sh or bash
$exportCC=<hdf4_path>/bin/h4cc

or

$exportCC='<hdf4_path>/bin/h4cc -Df2cFortran'
$./configure --with-szlib=<szip_path> --enable-install-include
You should replace <hdf4_path> and <szip_path> by proper paths in the above command. The configure script will check your system, and generate Makefile. If configure generates some errors, please carefully check the error message. It is very possible that you may need to correctly set other flags, such as CFLAGS, FFLAGS and LDFLAGS. For example, some systems may have a C compiler or Fortran compiler that generates either 32-bit binary or 64-bit binary depending on those flags.

After configuration, one can build HDF-EOS2 using make. If you downloaded code for test drivers, you can also test if the library works as expected by running make check. Running make install will install the HDF-EOS2 library.

For more information on how to use auto-configuration to build the HDF-EOS2 library, check the text file AUTOCONF_INSTALL under doc directory of the source distribution of the HDF-EOS2 library.

HDF-EOS5

You can get the latest release from hereexternal. As of May 2021, HDF-EOS5 2.0 is the latest version, and you can get the library from NASA web siteexternal.

Because HDF-EOS5 is built on HDF5external , the HDF5external library version 1.8.22 or higher is required to build the HDF-EOS5 library. HDF5external can optionally be built with the SZIPexternal compression library. If SZIPexternal was used, you need to know the library path. Due to the license issue, there are two types of SZIPexternal libraries: decoder only and encoder/decoder. You need to know which type of SZIPexternal is used to build HDF5external . The HDF-EOS5 needs to be built with the same type of SZIPexternal used to build HDF5external . Any inconsistencies regarding the SZIPexternal type will cause the failure of configure.

The first step is to execute configure script included in the package. One option is required as a parameter to configure: CC. If HDF5external was built with SZIPexternal, another option --with-szlib is required. The following is an example when HDF5external 1.8 is built with SZIPexternal.

Figure 5 Configure HDF-EOS5
$ ./configure \
CC=<hdf5_path>/bin/h5cc \
--with-szlib=<szip_path> --enable-install-include
If you are going to write a Fortran program and compile it with the HDF-EOS5 library, you need to build the HDF-EOS5 library with -Dfc2fortran option in CC like below:
Figure 6 Configure HDF-EOS5 with Fortran Support
$ ./configure \
CC='<hdf5_path>/bin/h5cc -Df2cFortran'\
--with-szlib=<szip_path> --enable-install-include
Alternatively, you can set the environment variables instead of supplying the above options. In csh or tcsh, you run the following commands:
Figure 7 Configure HDF-EOS5 with environment variables for csh or tcsh
%setenvCC <hdf5_path>/bin/h5cc

or

%setenvCC '<hdf5_path>/bin/h5cc -Df2cFortran' # For Fortran Support
%./configure--with-szlib=<szip_path> --enable-install-include
In sh or bash, you run the following commands:
Figure 8 Configure HDF-EOS5 with environment variables for sh or bash
$exportCC=<hdf5_path>/bin/h5cc

or

$exportCC='<hdf5_path>/bin/h5cc -Df2cFortran' # For Fortran Support
$./configure--with-szlib=<szip_path> --enable-install-include
You should replace <hdf5_path> and <szip_path> by proper paths in the above command. The configure script will check your system, and generate Makefile. If configure generates some errors, please carefully check the error message. It is very possible that you may need to correctly set other flags, such as CFLAGS, FFLAGS and LDFLAGS. For example, some systems may have a C compiler or Fortran compiler that generates either 32-bit binary or 64-bit binary depending on those flags.

After configuration, one can build HDF-EOS5 using make. You can also test if the library works as expected by running make check. Running make install will install the HDF-EOS5 library.

For more information on how to use auto-configuration to build the HDF-EOS5 library, check the text file doc/AUTOCONF_INSTALL.


Last modified: 04/24/2023
About Us | Contact Info | Archive Info | Disclaimer
Sponsored by Subcontract number 4400528183 under Raytheon Contract number NNG15HZ39C, funded by NASA / Maintained by The HDF Group