 
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.1r1/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:
    gcc -ansi -Wall -Wpointer-arith -Wcast-qual -Wcast-align \
        -Wwrite-strings -Wmissing-prototypes -Wnested-externs -pedantic -O2 \
        -o <your program> <your program>.c \  
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

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

HP-UX 9.03:
----------
C:
    cc -Ae -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
 
HP-UX 10.2:
----------
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 5.3:
--------
C:
    cc -ansi -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 -O -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:
    f77 -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 -o <your program> <your program>.c \  
        -I<path for hdf include directory> \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz

FORTRAN:
    fort77 -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

SP2:
----
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

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

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

T3E:
---
C:
    
    cc -X 1 -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 1 -Wl"-Dpermok=yes" -Wl"-s" -o <your program> <your program>.f  \
        -L<path for hdf libraries> -lmfhdf -ldf -ljpeg -lz


VAX OpenVMS:
-----------
   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/DECC/STANDARD=VAXC/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:deccrtl/lib

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


Windows NT/95:
-------------
Using Microsoft Visual C++ version 4.x:

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

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

Under Build->Settings, select folder, Link:
   Add the following libraries to the beginning of the list of
   Object/Library Modules:
       libsrc.lib src.lib jpeg.lib zlib.lib xdr.lib 

   The following libraries may (or may not) need to be included: 
       kernel32.lib user32.lib gdi32.lib winspool.lib comdig32.lib
       advapi32lib shell32.lib ole32.lib oleaut32.lib uuid.lib
       odbc32.lib odbccp32.lib

Under Build->Settings, select folder C/C++:
   For the Preprocessor Definitions add:  INTEL86
   The following were already there:   WIN32,_CONSOLE


