=================================================================
To compile the CGNS library under Unix, Linux, Cygwin, Mac, .etc:
=================================================================

  chmod +x configure
  ./configure [options]
  make [target]

The arguments in [] are optional, and if given should be specified
without the [].

The recognized options to configure are:

***** basic options *****

--enable-gcc
  Normally, the configure script will search for the native C compiler (cc)
  before trying to find gcc. This option reverses this order.

--enable-debug[=OPTS]
  This enables a debug version of the library. Normally, this just sets the
  -g option for compiling, and prevents stripping the library and
  executables. If 'OPTS' is given, this is taken as the compile options
  to be used instead. i.e. --enable-debug=-g gives the default.

--with-system=XXX
  overrides the default system type (see below) and sets the system type
  to 'XXX'. If not given, the system type will be determined from the
  'cgsystem' script.

--enable-legacy
  build the code using legacy settings. Defines cgsize_t as int and
  turns of enumeration value scoping (CGNS_ENUM in cgnslib.h)

--enable-scope
  enables scoping of all enumeration values in cgnslib.h by
  prefixing them with a CG_. For example, ZoneType_t becomes CG_ZoneType_t
  and Structured becomes CG_Structured.

--enable-64bit
  This option turns on 64-bit compilation, where applicable. If legacy
  is turned off, then cgsize_t will be a 64-bit integer typedef,
  otherwise it will be typedef'd as an int.

--enable-lfs
  This enables large file support (files larger than 2 Gb), where
  applicable. Your kernel must also be capable of LFS for this to
  make a difference.

--with-fortran[=F2C]
  By default the Fortran interface is enabled, and the configure script
  trys to determine the proper Fortran to C interface. If you specify
  --without-fortran or --with-fortran=no, the Fortran interface will
  not be built. To change the Fortran to C interface, specify 'F2C' as
  one of LOWERCASE, LOWERCASE_, LOWERCASE__, UPPERCASE, UPPERCASE_, or
  UPPERCASE__.
*** NOTE ***
  If you are using g77, and want to use the compiler without the
  -fno-second-underscore flag, then use --with-fortran=LOWERCASE__.
  This should work fine with the MLL routines, but you will NOT
  be able to use the ADF routines, since you will get unresolved
  external references when you try to link. The reason is that g77
  appends 2 underscores to names which have an underscore in them
  (the cg_* routines), but only 1 underscore to names that don't
  (the adf* routines). I don't know why - but that what's
  happening (at least with my version of g77). You may play
  around with the test case in the f2c subdirectory and see if
  you can come up with a solution - if so, let me know.
************

--enable-shared[=all]
  This enables the building of a shared library. Currently, only Linux,
  HP, SGI and SUN OS's are supported. If you specify --enable-shared=all,
  then the script will also attempt to use shared libraries for HDF5,
  zlib, and sziplib if HDF5 support is being built.

***** HDF5 options *****

--with-hdf5[=DIR]
  This enables the CGNS interface to HDF5. If 'DIR' is specified,
  then it should be the top-level directory of the HDF5 distribution.
  If not given, the script will check if HDF5 is installed and use that.
  If not installed, then the script will search for a local distribution.

--with-zlib[=LIB]
  This specifies that zlib is to be used with HDF5. This is only needed
  if HDF5 was built with zlib support. If 'LIB' is given,it should be the
  pathname to the zlib library. If not given, the script will check for
  first an installed version, and then a local distribution.

--with-szip[=LIB]
  This specifies that szip is to be used with HDF5. This is only needed
  if HDF5 was built with szip support. If 'LIB' is given,it should be the
  pathname to the szip library. If not given, the script will check for
  first an installed version, and then a local distribution.

--with-mpi[=DIR or mpicc]
  This specifies that MPI is to be used with HDF5. This is only needed
  if HDF5 was built with MPI support. The script attempts to obtain the
  library information for the mpicc script. If 'DIR' is given, it should be
  the top-level directory of the MPI distribution. If 'mpicc' is given,
  it should be the pathname to the mpicc script. If neither are given,
  the script will check for first an installed version, and then a local
  distribution.

***** cgnstools options *****

--enable-cgnstools
  This enables the building of CGNStools. If built, a Tcl/Tk
  installation is required.

--with-tcl=TCLdir
--with-tk=TKdir
  This sets the path to the Tcl and/or Tk source distribution. If not
  given, 'configure' will try first to find an installed version to use,
  then locally for a source distribution. If only one of these are given,
  the other will be set from that value. For example:
    "--with-tcl=$HOME/tcl8.3.1" will automatically set
    "--with-tk=$HOME/tk8.3.1".
  The "tkConfig.sh" file from either the installed or source distribution
  version is used to set the link options to be used in linking the
  cgiowish, plotwish, and calcwish executable.

--disable-cut
  This sets the NO_CUTTING_PLANE compiler flag to disable a cutting plane
  is cgnsplot. A cutting plane results in more memory being used by the
  program since the entire volume mesh is saved rather than just the
  boundary mesh.

--disable-mesh
  This sets the NO_MESH_BOUNDARIES compiler flag to disable the generation
  of imin,imax,jmin,jmax,kmin and kmax boundary regions for structured
  zones.

***** installation options *****

--prefix=PREFIX
--exec_prefix=EPREFIX
--libdir=LIBDIR
--includedir=INCLUDEDIR
  These set the installation directories for the CGNS library, headers and modules.
  By default, the library will be installed as:
    /usr/local/lib/libcgns.a
  and the headers as:
    /usr/local/include/cgnslib.h
    /usr/local/include/cgnswin_f.h
  and the modules as:
    /usr/local/include/cgns.mod
  See the autoconf documentation for a description of these options, or
  run './configure --help' for a brief overview. Use absolute paths or
  shell environment variables when specifying a directory, since the
  'configure' is interpreted by 'sh' not 'csh'. i.e: use --prefix=$HOME
  instead of --prefix=~ .

In addition to creating the required Makefiles, the configure script
will create the file 'make.defs', which contains all the system
specific information for building the library. If problems are
encountered, this is the file to edit.

Make will build put all the object modules in the subdirectory 'lib'
along with the CGNS library.

The main make targets are:

all
  This is the default target (if target is not given). This builds
  the CGNS library, the executables in the 'tools' subdirectory, and
  CGNStools if the --enable-cgnstools option to the script was given.

cgns
  Builds just the CGNS library

test
  Builds and runs the executables in the 'tests' subdirectory

install
  Installs the CGNS library and header files. If the --enable-cgnstools
  option was given, this will also install the executables in the
  'tools' subdirectory and CGNStools. You will need write permission
  to the installation directories.

clean
  This removes all the object files. The library is not affected.

allclean
distclean
  Removes the object files, library and files generated by 'configure'
  and any generated,object or execuatble files in the subdirectories

uninstall
  Uninstalls the library and headers and CGNStools if installed. You
  will need write permission to the installation directories.

Additional targets:
 
tools
  builds the code in the tools subdirectory

tests
  builds the code in the tests subdirectory

cgnstools
  builds the code in the cgnstools subdirectory

install-cgns
  Installs library and headers

install-tools
  Installs the executables in the 'tools' subdirectory

install-cgnstools
  Installs CGNStools

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

The system type is determined by executing the 'cgsystem' script.

  ./cgsystem [[-][enable-]64[bit]] [[-]cur[rent]] [[-]conf[igure]]

Again, everything in [] are optional, and the [] are not included.
If no arguments are given, then 'cgsystem' returns the default
system type. The '[-][enable-]64[bit]' option enables 64-bit as for
the 'configure' script. The '[-]cur[rent]' option returns the
current system type, which is that defined in 'make.system', and
the '[-]conf[igure]' option will update the 'make.system' file.

Currently defined system types are:

  ALPHA		DEC Alpha/OSF
  APOLLO	HP 300 running Domain/OS
  BSD386	80[345]86 running BSD
  BSDM68K	Motorola 68K running NetBSD
  BSDMIPS	Mips running NetBSD
  CONVEX	Convex
  CRAY		Cray, Cray-2, Cray XMP
  CYGWIN	POSIX emulation on top of Windows
  DARWIN	Macintosh running Darwin
  DEC		DEC
  FREEBSD	FreeBSD
  HPPA		HP 9000 PA-Risc
  HPPA10	HP 9000 PA-Risc running OS 10.x
  HPPA11	HP 9000 PA-Risc running OS 11.x (32-bit)
  HPPA64	HP 9000 PA-Risc running OS 11.x (64-bit)
  HPIT		HP with 64-bit Intel processor (32-bit)
  HPIT64	HP with 64-bit Intel processor (64-bit)
  HP		HP
  I860		Intel Hypercube
  IBM		IBM running AIX
  IBM64		IBM with AIX 4.3 or above (64-bit)
  LINUX		Linux
  LINUX64	64-bit Linux
  M88K		Motorola M88100 running Real/IX
  MACOSX	Power Macintosh runing OSx
  NETBSD	NetBSD not defined elseware
  NEXT		NeXT
  OS2		OS/2
  PGON		Intel Paragon
  SGI5		Silicon Graphics running OS 5.x
  SGI6		Silicon Graphics running OS 6.x
  SGI64		Silicon Graphics (64-bit)
  SGI		Silicon Graphics
  SUN3		Sun 3
  SUN4		Sun 4, 4c, sparc, .etc
  SUN64		Sun 4 (64-bit)
  SUN		Sun
  VAX		DEC/Microvax
  UNKNOWN	couldn't determine system type

Executing './cgsystem [-]help', will display the above information.

=================================================================
To compile under MS Windows:
=================================================================

  configure.bat [options]
  nmake [target]

The make targets are the same as above.

NOTE: This assumes that the cl compiler is in your path, and that the
      INCLUDE and LIB environment variables are set to include the
      directories containing the MSC include files and libraries.
      If not, you will need to use full path names to cl and link,
      and define INCLUDE and LIB in make.win32. You may also execute
      VCVARS32.BAT in the BIN directory of your VC installation to
      set these up prior to running nmake.

VC7 USERS: I have added code to cgnslib.c to handle the unresolved
      reference to __ftol2. You will need to add -DNEED_FTOL2 to
      your compile options for cgnslib.c to enable this, or add
      ftol2.obj to your link line.
      see http://www.manusoft.com/Resources/ARXTips/Main.stm

The options to configure are:

-MT
  Build library as multi-threaded using libcmt.lib (default)

-MD
  Build library as multi-threaded using run-time library mscvrt.lib

-debug
  Enable debug (-Zi) option for compiler and (/debug) for linker

-lfs
  Enable large file support (files larger then 2 Gb)

-legacy
  build the code using legacy settings. Defines cgsize_t as int and
  turns of enumeration value scoping (CGNS_ENUM in cgnslib.h)

-64
  This option turns on 64-bit compilation, where applicable. If legacy
  is turned off, then cgsize_t will be a 64-bit integer typedef,
  otherwise it will be typedef'd as an int.

-cgnstools
  Build cgnstools. This requires the Tcl/Tk to be available.

-scope
  enables scoping of all enumeration values in cgnslib.h by
  prefixing them with a CG_. For example, ZoneType_t becomes CG_ZoneType_t
  and Structured becomes CG_Structured.

-dll
  build the CGNS library as a DLL, instead of static

-f2c [type]
  Allows you to override the default Fortran to C interface, which
  is compatible with Visual Fortran. I you are using a Fortran
  compiler which uses Unix-type interfaces (i.e. Absoft Fortran),
  then specify the Fortran to C interface with 'type' as one of
  LOWERCASE, LOWERCASE_, LOWERCASE__, UPPERCASE, UPPERCASE_, or
  UPPERCASE__. If 'type' is not given, it defaults to LOWERCASE_,
  which is the most common. You may also disable the Fortran to C
  interface completely by setting 'type' to none.

-ifort
  Configure to use the Intel Fortran compiler, ifort. This option
  will set the UPPERCASE Fortran to C interface option, and replace
  the F77=f77 with F77=ifort in the make.WIN32 file.

-absoft
  Configure to use the absoft Fortran compiler. This option will
  set the LOWERCASE Fortran to C interface option. Since the absoft
  compiler is case-sensitive, you should use lowercase to call
  the CGNS routines from your Fortran code. If you want to use
  uppercase calls, then use the -f2c UPPERCASE option.

-hdf5 [hdf5dir]
  This enables CGNS interface to HDF5. If 'hdf5dir' is specified,
  then it should be the top-level directory of the HDF5 distribution.
  If not given, the script will search the current drive for a
  local distribution.

-zlib [zliblib]
  This specifies that zlib is to be used with HDF5. This is only needed
  if HDF5 was built with zlib support. If 'zliblib' is given,it should be
  the pathname to the zlib library. If not given, the script will search
  the current drive for the library.

-szip [sziplib]
  This specifies that szip is to be used with HDF5. This is only needed
  if HDF5 was built with szip support. If 'sziplib' is given,it should be
  the pathname to the szip library. If not given, the script will search
  the current drive for the library.

-mpi [mpidir]
  Defines the MPI location when building HDF5 with MPI support. If 'mpidir'
  is specified, then it should be the top-level directory of the MPI
  distribution. If not given, the script will search the current drive for
  a local distribution.

-tcl [TCLdir]
-tk [TKdir]
  This sets the path to the Tcl and/or Tk source distribution. If not
  given, the script will search the current driver a local distribution.
  If only one of these are given, the other will be set from that value.
  These are used only to build cgnstools.

-nocut
  This sets the NO_CUTTING_PLANE compiler flag to disable a cutting plane
  is cgnsplot. A cutting plane results in more memory being used by the
  program since the entire volume mesh is saved rather than just the
  boundary mesh.

-nomesh
  This sets the NO_MESH_BOUNDARIES compiler flag to disable the generation
  of imin,imax,jmin,jmax,kmin and kmax boundary regions for structured
  zones.

-install instdir
  Sets the installation directory to 'instdir'. The directory should
  be specified without spaces, i.e. use c:\Progra~1\CGNS instead
  of c:\Program Files\CGNS. The default is the root directory of the
  current drive. The library will be installed as:
    %installdir%\lib\libcgns.lib
  and the headers
    %installdir%\include\cgnslib.h
    %installdir%\include\cgnswin_f.h
  and the modules
    %installdir%\include\cgns.mod
----------------------------------------------------------------------

If you have any additions or corrections to make, please report them at:


