************************************************************************
         HDF4 Build and Install Instructions for Cygwin
************************************************************************

This document is a instruction on how to build, test and install HDF4 libary on 
Cygwin.  See detailed information in hdf4/INSTALL. 

Preconditions:
--------------

1. Installed Cygwin 1.7.1 or higher

   To install the Cygwin net release, go to http://www.cygwin.com and 
   click on "Install or update now!" icon. This will download a GUI 
   installer called setup.txt which can be run to download a complete 
   Cygwin installation via the internet. Then follow the instructions 
   on each screen to install Cygwin.

   Cygwin uses packages to manage installing various software. Users can 
   choose to install or uninstall certain packages by running setup.exe.
   http://www.cygwin.com/packages/ provides detailed information about 
   Cygwin packages.

   Most required dependencies can be satisfied by installing all packages in
   the "Devel" category.  However, please verify that you have installed all
   packages listed below.

2. Compilers, Libraries and Utilities Installed

   2.1 Compilers Supported
    
    The following compilers are supported by HDF4 and included in the Cygwin
    package system:
       gcc (4.3.4), which includes:
            gcc4-core    : C compiler
            gcc4-g++     : C++ compiler
            gcc4-fortran : fortran compiler
            

   2.1.1 Using Compilers Not Supported
       
       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.
        
    2.2 Libraries Installed
    
    The following libraries are required to build HDF4:
    
        libjpeg-devel   : JPEG library
        sunrpc          : RPC library
        zlib            : Zlib compression library

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

               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.   

    The szip library is not distributed with the Cygwin packaging system.
    However, a recent Cygwin binary can be found at:
        ftp://ftp.hdfgroup.org/lib-external/szip/2.0/bin/cygwin/

    
    2.3 Additional Utilities
    
    The following standard utilities are also required to build and test HDF4:
        
        bison           : yacc implementation
        diffutils       : diff command
        flex            : flex utility
        make            : make utility
        
        
        
Build, Test and Install HDF4 on Cygwin
--------------------------------------

Notes: Use the configure command in the top level HDF4 directory.

1. HDF4 Source code and precompiled binaries
     
   HDF provides "tar source ball" and precompiled binaries from 
   the HDF ftp server (ftp.hdfgroup.org) in the directories:

         ftp://ftp.hdfgroup.org/HDF/HDF_Current/src
         ftp://ftp.hdfgroup.org/HDF/HDF_Current/bin 
  
2. Unpacking the distribution

   gzip -cd <HDF-X.Y.Z.tar.gz>| tar xvf -

3. To configure 
     
       ./configure <--disable-fortran> 
                   --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 

4. To Build and Test:

  4.1 To build the library

        make >& make.out

  4.2 To build and run the tests

        make check >& check.out

5. To Install:

         make install

6.  You may build HDF4 in a directory other than hdf-X.Y.Z by
      using the "srcdir" option. Simply create a build directory and
      type:

        <path_to_hdf4>/configure ...

        where "..." are your configuration options.

Acknowledgements:
-----------------
HDF group would like to thank xinmin Hua(NASA/GSFC) for his help to 
make HDF4 work on Cygwin.  

-----------------------------------------------------------------------

Need Further assistance, email help@hdfgroup.org

