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 July 2009, HDF-EOS 2.16 v1.00 is the latest version, and you can get the library from their ftp siteexternal. 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>
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>
Alternatively, you can set the environment variables instead of suppying the above options. In csh or tcsh, you run the following commands:
Figure 3 Configure HDF-EOS2 with enviornment varibles for csh or tcsh
%setenvCC <hdf4_path>/bin/h4cc

or

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

or

$exportCC='<hdf4_path>/bin/h4cc -Df2cFortran'
$./configure --with-szlib=<szip_path>
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 July 2009, HDF-EOS 5.1.12 is the latest version, and you can get the library from their ftp siteexternal. There are two tar files for UNIX; one contains source code and sample code, and the other contains code for test drivers.

Because HDF-EOS5 is built on HDF5external , the HDF5external library 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 is 1.8 or higher, one needs to define H5_USE_16_API preprocessor macro as CFLAGS. This is because HDF-EOS5 uses HDF5external 1.6 API and this is not compatible with HDF5external 1.8 API. 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 \
CFLAGS=-DH5_USE_16_API \
--with-szlib=<szip_path>
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'\
CFLAGS=-DH5_USE_16_API \
--with-szlib=<szip_path>
Alternatively, you can set the environment variables instead of suppying the above options. In csh or tcsh, you run the following commands:
Figure 7 Configure HDF-EOS5 with enviornment varibles for csh or tcsh
%setenvCC <hdf5_path>/bin/h5cc

or

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

or

$exportCC='<hdf5_path>/bin/h5cc -Df2cFortran' # For Fortran Support
$exportCFLAGS=-DH5_USE_16_API
$./configure--with-szlib=<szip_path>
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. If you downloaded test drivers, 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 AUTOCONF_INSTALL under doc directory of the source distribution of the HDF-EOS5 library.


Last modified: 10/06/2010
About Us | Contact Info | Archive Info | Disclaimer
Sponsored by NASA Cooperative Agreement Grant Number NNX08AO77A / Maintained by The HDF Group