Introduction
------------

`make all' is used to compile/link the CDF distribution.  Several `make'
variables are used to configure the distribution for your particular operating
system and environment.  They are specified on the command line as part of the
`make' command.  The "Examples" section below illustrates how to specify `make'
variables.  If your operating system and/or environment is not supported,
please contact CDFsupport (cdfsupport@listserv.gsfc.nasa.gov).
We will either add the support or tell you how to patch the `make' file in the
top-level directory of the CDF distribution.  If your operating system and
environment is supported but you still have problems, refer to the section
"Possible Problems" below.  If that doesn't help simply contact CDFsupport with
a description of the problem (eg. operating system, environment, log of error
messages, etc.).

Make Variables
--------------

  The supported `make' variables consist of the following...

     OS            REQUIRED.  The operating system being used.
     ENV           REQUIRED.  The environment begin used (eg. C compiler).
     SHARED        Optional.  Should the shareable CDF library be built?
     CURSES        Optional.  Should Curses-based toolkit programs be built?
     FORTRAN       Optional.  Should the Fortran interface be tested?

  A detailed description of each variable follows...

     OS=<os>
     ENV=<env>
       These variables are REQUIRED and specify the operating system you are
       using and the environment in which to build the CDF distribution.  These
       variables are always specified as a pair.  In the following list each
       supported operating system is shown along with the possible environments
       for that operation system...

          OS=solaris   For SOLARIS on a Sun (SOLARIS 2.x == SunOS 5.x) or a PC.  The
                       possible environments are... (Note: 64-bit mode programs
                       always use 64-bit (off_t) offset while it is optional for
                       32-bit mode programs.)

                       ENV=sparc  For a Sun machine
                                  Compile using the System V flavored SPARC
                                  C compiler (/usr/lang/bin/cc), include
                                  files, and system libraries.  This C
                                  compiler may also be referred to as the
                                  ANSI C (SunOS/SVR4) compiler. This is
                                  for building 32-bit mode programs but using
                                  64-bit (off_t) offset, instead of 32-bit (size_t). 

                                  On some SOLARIS systems this C compiler
                                  may be named differently (for example,
                                  `/opt/SUNWspro/bin/cc').  If so, also specify...

                                          CC_solaris_sparc=<cc-loc>

                                  as part of the `make' command where <cc-loc>
                                  is the location of this C compiler (or just
                                  `cc' if this C compiler is in your path).

                       ENV=sparc64  For a Sun machine  
                                  This is similar to the above ENV by using System 
                                  V flavored SPARC C compiler (/opt/SUNWspro/bin/cc), 
                                  include files, and system libraries.  But, this 
                                  is for building 64-bit mode programs.

                                  As the aforementioned ENV=sparc, specify

                                          CC_solaris_sparc64=<cc-loc>

                                  as part of the `make' command where <cc-loc>
                                  is the location of this C compiler.

                       ENV=gnu    For a Sun machine
                                  Compile using Gnu C (gcc).  
                                  This is for building 32-bit mode programs
                                  but using the 64-bit (off_t) offset, instead 
                                  of 32-bit (size_t). 

                       ENV=gnu64  For a Sun machine
                                  This is similar to above ENV by using the Gnu C (gcc).
                                  But, it is for building 64-bit mode programs. Make
                                  sure that the gcc compiler supports the 64-bit.

                       ENV=x86    For a 32-bit x86 PC.
                                  This is similar to the above ENV=sparc setup.

                       ENV=x64    For a 64-bit PCs (AMD Opteron-based or Intel 
                                  EM64T-based systems)
                                  This is similar to above ENV=sparc64 setup.

          OS=osf       For OSF on a DEC Alpha.  The possible environments
                       are... 

                       ENV=dec   Compile using the DEC OSF C compiler (cc).
                                 This is for building Tru64 programs and
                                 using the 64-bit (off_t) offset, instead
                                 of 32-bit (size_t).

                       ENV=gnu   Compile using Gnu C (gcc).
                                 This is for building Tru64 programs and
                                 using the 64-bit (off_t) offset, instead
                                 of 32-bit (size_t).

          OS=irix6     For IRIX 6.x on an SGi.  The possible environments
                       are...
 
                       ENV=sgin32 Compile using the SGi-supplied C compiler
                                  (cc) in the new high performance 32-bit ABI mode.
                       ENV=sgi64  Compile using the SGi-supplied C compiler
                                  (cc) in the 64-bit mode.
                       ENV=gnu    Compile using Gnu C (gcc).

          OS=mach      For Mach on a Mac OS X Server.  The possible
                       environments are...
 
                       ENV=macosx Compile using the Apple-modified Gnu C
                                  compiler (cc) with 64-bit (off_t) offset, 
                                  instead of 32-bit (long).

          OS=linux     For Linux on an IBM PC (Intel 32/64 or AMD64), a Mac Power PC 
                       or a Dual Alpha.  The possible environments are...

                       ENV=gnu    Compile using Gnu C (gcc).  
                                  This is for building the programs using the
                                  64-bit (off_t) offset, instead of 32-bit (long), 

          OS=cygwin    For Cygwin on a PC. The possible environments are...

                       ENV=gnu    Compile using Gnu C (gcc).  This is the C 
                                  compiler for Cygwin systems.  The Curses-based 
                                  toolkit programs rely on `ncurses' being available.

          OS=mingw     For MinGW on a PC. The possible environments are...

                       ENV=gnu    Compile using Gnu C (gcc).  This is the C
                                  compiler for MinGW systems.  

    SHARED=yes|no
       This variable defaults to `yes' on those operating systems that
       support shareable libraries (in a reasonable way).  The operating
       systems that do not support shareable libraries are Ultrix (DECstation),
       IRIX 3.x and 4.x (SGi), Mach (NeXT or MacOS X server) and HP-UX (HP)
       if the "standard" C compiler is used.  Specifying `no' prevents the
       creation and testing of the shareable CDF library.

    CURSES=yes|no
       This variable defaults to `yes' on those operating system/environment
       combinations which support System V flavored Curses.  Specifying `no'
       prevents the compilation/linking of the toolkit programs which
       depend on the Curses full-screen management package.

     FORTRAN=yes|no
       This variable defaults to `no' if not specified.  Specifying `yes'
       causes the compilation/linking of test programs for the Fortran
       interfaces.  You must of course have a Fortran compiler installed
       on your system if you specify `yes'.  Note that the Fortran interfaces
       will always be present in the CDF library.

Examples
--------

  For example, to build the CDF distribution on a Sun running SunOS 4.1 using
  the System V C compiler environment use the command...

     make OS=sunos ENV=sysV all

  Note that `all' is at the end of each command line after any `make'
  variables.

Possible Problems
-----------------

  Non-System V Curses.
     If you get compiler errors when trying to build the Curses-based toolkit
     programs (CDFedit, CDFlist, and CDFwalk), it will most likely be because
     you are using Berkeley rather than System V Curses.  If System V Curses
     is not available, then specify `CURSES=no' (causing CDFedit, CDFlist, and
     CDFwalk to not be built).

  Undefined symbols when using Gnu C.
     When linking the Fortran test programs to a CDF library built with Gnu C
     you may get undefined symbols.  

  C compiler not found.
     This can occur if the C compiler being used is not installed in the
     expected location.  This is usually only a problem on those systems
     which support multiple C compilers (eg. SunOS/SOLARIS).  If you know
     the location of the C compiler also enter...

        CC_<os>_<env>=<cc-location>

     as part of the `make' command where <os> is the operating system, <env>
     is the environment, and <cc-location> is the location of the C compiler.
     Note that <cc-location> could simply be specified as `cc' if the C
     compiler being used is in your path.

  Shareable libraries.
     For those operating systems supporting shareable libraries, a
     shareable CDF library may be built.  On most of these systems a
     C compiler option is required specifying position-independent-code
     (PIC) which is necessary in a shareable library.  Unfortunately, PIC
     is not always supported as expected by a C compiler.  If compile-time
     or run-time errors occur, you may have to try using a different PIC
     option or no PIC option at all (because in some cases, believe it or
     not, PIC is the default and specifying the PIC option causes problems).
     The following list of operating systems and environments show the PIC
     options which will be used and the possible alternative PIC options
     you may have to try.

       O.S.       Environment(s)    Default PIC    Alternative PICs
       ------------------------------------------------------------
       sunos      bsd,bsd5,sysV     -pic
       sunos      gnu,gnu5          -fpic          (no PIC)
       solaris    bsd,bsd5          -pic           (no PIC)
       solaris    sparc,sysV        -K pic         (no PIC),-pic
       solaris    gnu,gnu5          -fpic          (no PIC)
       hpux       opt               +z             (no PIC)
       hpux       posix             +z             (no PIC)
       hpux       gnu               -fpic          (no PIC)
       aix        ibm               (no PIC)
       aix        gnu               -fpic          (no PIC)
       osf        dec               (no PIC)
       osf        gnu               -fpic          (no PIC)
       irix5      sgi               -KPIC
       irix5      gnu               -fpic
       irix6      sgi32,sgi64       -KPIC
       irix6      gnu               -fpic
       linux      gnu               -fPIC          (no PIC)

     To specify a PIC option other than the default, add a `make' variable
     definition to the `make all' command of the form...

       "PIC_<os>_<env>=<pic-option>"

     where <os> is the operating system, <env> is the environment, and
     <pic-option> is the alternative PIC option (which can be absent if no
     PIC option is desired).  Note that the double-quote marks are generally
     required if the `make' variable definition contains spacing.  For
     example, to change the PIC option to `-pic' for Solaris using the
     SPARC C environment use...

       "PIC_solaris_sparc=-pic"

     For no PIC option use...

       "PIC_solaris_sparc="

     If your operating system/environment is not listed in the above table,
     then the shareable CDF library is not supported.
