 
COMPILING A PROGRAM
                  
Following are instructions for compiling an application program on the 
platforms supported by HDF, using the binaries that we provide.  For
Unix, the information on options to specify comes from the configuration 
files (mh-*) in the HDF source code (under ../HDF4.1r4/config).   

In general, you compile your program as shown below.  If your platform is 
not specified in the section, "INSTRUCTIONS FOR SPECIFIC PLATFORMS", then 
use these instructions.  If you are unable to compile your program on Unix, 
please check the configuration file for your platform for the correct 
options.

C:
    cc -o <your program> <your program>.c -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

   or

    cc -o <your program> <your program>.c -I<path for hdf include directory> \
          <path for libmfhdf.a>  <path for libdf.a> \
          <path for libjpeg.a> <path for libz.a>

FORTRAN:
    f77 -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz
   
   or
   
    f77 -o <your program> <your program>.f  \
          <path for libmfhdf.a>  <path for libdf.a> \
          <path for libjpeg.a> <path for libz.a>

NOTE: The order of the libraries is important: libmfhdf.a first,
followed by libdf.a, then libjpeg.a and libz.a.  The libjpeg.a
library is optional.

INSTRUCTIONS FOR SPECIFIC PLATFORMS
===================================

Cray:
----
C:
    cc  -O -s -o <your program> <your program>.c \  
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f90 -O 1 -o <your program> <your program>.f  \
         -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

Dec Alpha/Digital Unix:
----------------------
C:
    cc -Olimit 2048 -std1 -o <your program> <your program>.c \
       -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz
 
Dec Alpha/OpenVMS AXP:
---------------------
   To compile your programs, prog.c and prog1.for, with the HDF library, 
   mfhdf.olb, df.olb, and libz.olb are required.  The libjpeg.olb library 
   is optional.

   cc/opt/nodebug/define=(HDF,VMS)/nolist/include=<dir for include> prog.c
   fort prog1.for
   link/nodebug/notraceback/exec=prog.exe  prog.obj, prog1.obj, -
         <dir for lib>mfhdf/lib -
         <dir for lib>df/lib, <dir for lib>libjpeg/lib,  -
         <dir for lib>libz/lib, sys$library:vaxcrtl/lib

   NOTE: The order of the libraries is important: mfhdf.olb first,
   followed by df.olb then libjpeg.olb and libz.olb.

Exemplar:
--------
C:
    cc -ext -nv -no <your program> <your program>.c \
       -I<path for hdf include directory> \
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    fc  -sfc -72 -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

   NOTE: These instructions are for Convex/HP Exemplar machines running
   versions of the OS ealier than 10.x.  For machines running version
   10.x of HP-UX, follow the instructions for HP-UX 10.2.

FreeBSD:
-------
C:
    cc -ansi -Wall -pedantic -o <your program> <your program>.c \  
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -O -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

 
HP-UX:
-----
C:
    cc -Ae -s -o <your program> <your program>.c \
       -I<path for hdf include directory> \
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -s -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz
 

IRIX 6.x:
--------
C:
    cc -ansi -n32 -mips3 -O -s -o <your program> <your program>.c  \
       -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f90 -n32 -mips3 -O -s -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

IRIX64 with 64-bit mode:
------------------------
C:
    cc -ansi -64 -mips4 -O -s -o <your program> <your program>.c  \
       -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -64 -mips4 -O -s -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

  
IRIX64 with n32-bit mode:
-------------------------
C:
    cc -ansi -n32 -mips4 -O -s -o <your program> <your program>.c \
     -I<path for hdf include directory> \
     -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -n32 -mips4 -O -s -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

Linux:
-----
C:
    gcc -ansi -D_BSD_SOURCE -o <your program> <your program>.c \  
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    g77 -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

Solaris:
-------
   The -lnsl is necessary in order to include the xdr library.

C:
    cc -Xc -xO2 -o <your program> <your program>.c  \
       -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz \
       -L/usr/lib -lnsl

FORTRAN:
    f77 -O -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz \
        -L/usr/lib -lnsl

Solaris_x86 (C only):
--------------------
    The -lnsl is necessary in order to include the xdr library.

    gcc -ansi -O -o <your program> <your program>.c \
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz  \
        -L/usr/lib -lnsl

SP:
---
C:
    xlc -qlanglvl=ansi -O -o <your program> <your program>.c \
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f77 -O -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz


T3E:
---
C:
    
    cc -X m -s -o <your program> <your program>.c \
       -I<path for hdf include directory>\
       -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    f90 -X m -Wl"-Dpermok=yes" -Wl"-s" -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz


Windows NT/98/2000:
------------------
Using Microsoft Visual C++ version 6.x:

Under Tools->Options, select the folder, Directories:
   Under "Show directories for", select "Include files".
   Add the following directories:
      C:<path to HDF includes>\INCLUDE  

Under "Show directories for", select "Library files":
   Add the following directories:
      C:<path to HDF libs>\LIB        

Under Project->Settings, select folder, Link:
   Add the following libraries to the beginning of the list of
   Object/Library Modules:
         hd414.lib hm414.lib (single-threaded release version)
         hd414d.lib hm414d.lib (single-threaded debug version)

         hd414m.lib hm414m.lib (multi-threaded release version)
         hd414md.lib hm414md.lib (multi-threaded debug version)



