netCDF  4.3.0
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Building with HDF4 Support

The netCDF-4 library can (since version 4.1) read HDF4 data files, if they were created with the SD (Scientific Data) API.

For this to work, you must build the HDF4 library with the configure option

  --disable-netcdf

to prevent it from building an HDF4 version of the netCDF-2 library that conflicts with the netCDF-2 functions that are built into the Unidata netCDF library.

Then, when building netCDF-4, use the

  --enable-hdf4

option to configure. The location for the HDF4 header files and library must be set in the CPPFLAGS and LDFLAGS options.

For HDF4 access to work, the library must be build with netCDF-4 features.

Here's an example, assuming the HDF5 library has been built and installed in H5DIR and you will build and install the HDF4 library in H4DIR (which could be the same as H5DIR):

# Build and install HDF4
cd ${HDF4_SOURCE_DIRECTORY}
./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
make
make install
# Build and install netCDF with HDF4 access enabled
cd ${NETCDF_SOURCE_DIRECTORY}
CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
./configure --enable-hdf4 --enable-hdf4-file-tests
make check
make install

Generated on Tue Jul 9 2013 19:18:06 for netCDF. NetCDF is a Unidata library.