
    Installation instructions for HDF4.2r1 on UNIX and MacOSX platforms
    ====================================================================
                          February 2005


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 w/ 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) Source code and binaries may be downloaded from
     http://www.gzip.org/ or from the NCSA ftp server  
     ftp://hdf.ncsa.uiuc.edu/lib-external/gzip/
     Newest ZLIB 1.2 may also be used.


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

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

               http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/ 

     The SZIP compression library is free for non-commercial use; 
     see http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/Commercial_szip.html
     for information regarding commercial use.
     
2. HDF4 Source code and precompiled binaries
   ==========================================
     HDF provides "tar source ball" and precompiled binaries from 
     the NCSA ftp server (ftp.ncsa.uiuc.edu) in the directories:

         ftp://hdf.ncsa.uiuc.edu/HDF/HDF_Current/src
         ftp://hdf.ncsa.uiuc.edu/HDF/HDF_Current/bin 

   IMPORTANT:
   ==========
   HDF4 prebuilt binaries come with the SZIP compression. In order to use
   the binaries install SZIP Library on your system. You may download SZIP
   precompiled binaries from 
         http://hdf.ncsa.uiuc.edu/doc_resource/SZIP


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

   0)  The HDF4.2r1 Library was tested on the following platforms

       AIX 5.1, 5.2 (32 and 64-bit versions)
       SunOs 5.7 (32 and 64-bit versions) 
       SunOS 5.8 (32 and 64-bit versions) 
       SunOS 5.9 (32 and 64-bit versions) 
       HPUX 11.00
       Linux 2.4 
       IRIX64-6.5 (32 and 64-bit versions)
       MacOSX
       Crays SV1 and T90
       True64 (OSF1 V5.1)
       Windows 2000 and XP
       FeeBSD
       IA32 and IA64
       Altix
       AMD Opteron

       For more information, see the release_notes/RELEASE.txt file, "Platforms
       tested" section.
      
   Before you start:
 
   1)  Make sure that the ZLIB and JPEG Libraries are installed on your
       system.
   2)  Optional: install the SZIP version 2.0 Library. 
   3)  Extract the source from the hdf4.2r1.tar file and change
       directory to hdf4.2r1

   To Configure:

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

       ./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 szlib option is not used, 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>/NewHDF 

    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.2r1 by
        using the "srcdir" option. Simply create a build directory and
        type:

        <path_to_hdf4.2r1>/configure ...

        where "..." are your configuration options.
 
4. Using HDF/MFHDF libraries w/ original netCDF library 
   ====================================================

        To use the HDF/MFHDF libraries(libdf.a, libmfhdf.a) with the
        original netCDF library(libnetcdf.a) the HDF/MFHDF distribution
        must be compiled with the option '-DHAVE_NETCDF'. This will
        rename the HDF version of the C-interface(ncxxx) of the netCDF API
        to sd_ncxxx to avoid clashing with the original netCDF API from
        libnetcdf.a. Currently there is no support for renaming the 
        netCDF Fortran interface stubs. As such the HDF/MFHDF distribution 
        must be compiled without fortran support. HDF Users can still access
        HDF/netCDF files through the SDxxx interface but not through the
        ncxxx interface unless the renamed interface is used(sd_ncxxx).



   Report all problems to hdfhelp@ncsa.uiuc.edu

