
    Installation Instructions for HDF4.2r4 on UNIX and MacOSX Platforms
    ===================================================================
                             January 25, 2009


CONTENTS

0. Third party software requirements
1. Optional SZIP compression Library
2. HDF4 source code and precompiled binaries 
3. UNIX and MacOSX configuration and build
4. Using HDF/MFHDF libraries with original netCDF library


0. Third party software requirements
   =================================

   x JPEG distribution release 6b(libjpeg.a). The "official" site
     for this is 
         ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz

   x ZLIB 1.1.4(libz.a) or later. Source code and binaries may be 
     downloaded from this site:
         http://www.gzip.org/ 
     They are also available on The HDF Group's FTP server:
         ftp://ftp.hdfgroup.org/lib-external/zlib/

1. Optional SZIP compression Library
   =================================

   x HDF4.2r4 may be configured to use the SZIP compression Library.
     For more information about the SZIP library, see this site:

         http://hdfgroup.org/doc_resource/SZIP/ 

     The SZIP compression library is free for non-commercial use; 
     see http://hdfgroup.org/doc_resource/SZIP/Commercial_szip.html
     for information regarding commercial use.
     
2. HDF4 source code and precompiled binaries
   =========================================
   The HDF Group (THG) provides a "tar source ball" and precompiled 
   binaries from the THG FTP server: 

         ftp://ftp.hdfgroup.org/HDF/HDF_Current/src
         ftp://ftp.hdfgroup.org/HDF/HDF_Current/bin 

   IMPORTANT:
   ==========
   HDF4 prebuilt binaries come with SZIP compression. To use these binaries, 
   you must install the SZIP Library on your system. 

   You may download precompiled SZIP binaries from the THG FTP site:
         ftp://ftp.hdfgroup.org/lib-external/szip/2.0/bin/
   Source code for the SZIP library can be found on the same server:
         ftp://ftp.hdfgroup.org/lib-external/szip/2.1/src

   To build the library, follow the instructions in the SZIP source code 
   distribution.

3. UNIX and MacOSX configuration and build
   =======================================

   0)  See RELEASE.txt in the release_docs/ subdirectory for platforms 
       tested for this release.

   Before you start:

   1)  Make sure that the ZLIB and JPEG Libraries are installed on your
       system.

   2)  Optional: Install the SZIP version 2.1 Library (you may use 
       SZIP 2.0 binaries). 

   3)  Extract the source from the hdf4.2r4.tar file and change
       directory to hdf4.2r4.

   To Configure:

   4)  Use the configure command in the top level HDF4 directory hdf4.2r4:

       ./configure --with-zlib=/path_to_ZLIB_install_directory 
                   --with-jpeg=/path_to_JPEG_install_directory 
                   <--with-szlib=/path_to_SZIP_install_directory>
                   --prefix=/path_to_HDF4_install_directory

       * Please note that when the szlib option is not used, the SZIP 
         Library will not be configured in and SZIP compression will not 
         be enabled.
       * If your system has ZLIB and/or JPEG libraries installed under a
         system library directory (such as /usr/lib), configure will
         automatically find the library. In this case, the corresponding
         configure flag may be ommitted.
       * Note that --prefix defines where the installation path is.
         The default is set as <hdf4_build_directory>/hdf4.

   To Build and Test:

   5)  To build the library:

       gmake >& gmake.out

   6)  To build and run the tests:

       gmake check >& check.out

   To Install:

   7)  To install the HDF4 library and tools:

       gmake install

   8)  By default, the current configuration uses vendor compilers; to use
       another compiler, run the following commands before running configure: 

       setenv CC   "foo -flags"
       setenv F77  "fffoo -flags"

       See the configure help page (configure --help) for a list of
       environment variables that have an affect on building the library.

   9)  You may build HDF4 in a directory other than hdf4.2r4 by using
       the "srcdir" option. Simply create a build directory and type:

       <path_to_hdf4.2r4>/configure ...

       where "..." are your configuration options.

4. Using HDF/MFHDF libraries with original netCDF library 
   ======================================================

   To use the HDF/MFHDF libraries (libdf.a, libmfhdf.a) with the original
   netCDF library (libnetcdf.a), the HDF4 distribution must be configured 
   with the --disable-netcdf configuration flag.  This will rename the HDF 
   version of the C interface (ncxxx) of the HDF4 netCDF APIs to sd_ncxxx 
   and will disable the HDF4 NC Fortran interfaces to avoid name clashes 
   with the original netCDF C and Fortran APIs from libnetcdf.a.  
   HDF4.2r3 and later DO NOT require the presence of the NetCDF-3 
   header files on the system.



   Please report all problems to help@hdfgroup.org.

