************************************************************************
         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.5.17 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.

   To build HDF4 on Cygwin, Devel package (including gcc,gcc-g++,
   gcc-g77, and gcc-java compiles, and gdb tool) should be installed.

2. Compilers Installed

   2.1 Compilers Supported

       gcc-3.4.4 is included in Cygwin, which includes: 
       gcc    : GNU C compiler
       gcc-g++: GNU C++ compiler
       g95    : GNU Fortran 95 compiler

   2.2 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.
       
3. Third Party Software Requirements

   3.1 Jpeg library (libjpeg.a)
   
       Jpeg 6b-11 was used to build and test HDF4 C library on Cygwin by 
       HDF group.

   3.2 Zlib Library (libz.a)

       zlib-1.2.2 or later is supported and tested with HDF4 on Cygwin.

   Notes: Run the following command and check the output file to see if
          jpeg library (libjpeg.a) and zlib library(libz.a) have been 
          installed or not. If not, users have to install these two 
          libraries before building HDF4 library on Cygwin.

          cygcheck -c > packages.cygwina


4. Optional SZIP compression Library
     
    HDF4.2r4 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.


Build, Test and Install HDF4 on Cygwin
--------------------------------------

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

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 <HDF4.2r4.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

       * When building Fortran libraries, the Fortran compiler may be specified
         by setting F77 in the environment prior to running configure.  Also,
         you must set the environment variable EXEEXT as empty.  This is due to
         a cygwin-specific bug in configure.
       * 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

        export EXEEXT=
        make -e check >& check.out
        
      Note: We must export EXEEXT and use the -e flag for make due to a bug in
            Cygwin and make.  This is especially important for testing Fortran 
            libraries.

5. To Install:

         make install

6.  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.

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

