

                          Build instructions for VisIt
                         ==============================

VisIt relies on several external libraries which must be built and installed
prior to building VisIt.  This document provides detailed step by step
instructions for building VisIt and each of the dependent libraries.  The
instructions have been designed so that you can cut and paste most of the
commands needed to build the libraries and VisIt from this file into your
shell prompt.


    Library  Version   Description            For More Information
    =======  =======   ===========            ====================
    Mesa     7.5       3-D Graphics Library   http://www.mesa3d.org/
    Python   2.5       Scripting Language     http://www.python.org
    Qt       4.4.3     GUI Toolkit            http://www.trolltech.com
    VTK      5.0.0d    Visualization Toolkit  http://www.kitware.com


The public version of VisIt has been built with the above listed versions
of the libraries, so it is known to work properly with those versions.  For
all the packages except VTK and Qt, you can probably use newer versions of the
packages and VisIt should work properly.  For Mesa, you must build a mangled
version of Mesa.  The distribution provided has already been set up to build
a mangled version so no additional work is required if you use it.  For VTK,
you must use the March 23, 2004 distribution provided. The version of Qt
used to build VisIt must be greater than or equal to 4.4.0.

VisIt also contains many database readers which are also built on external
libraries.  If you want to make use of these readers you will also need to
build and install those libraries prior to building VisIt.


    Library  Version  Description            For More Information
    =======  =======  ===========            ====================
    Silo     4.7      File I/O library       http://silo.llnl.gov
    Boxlib   ???      An AMR I/O library     ???
    ExodusII 4.46     File I/O library       http://www.sourceforge.net/projects/exodusII
    H5Part   1.3.3    Fili I/O library       https://codeforge.lbl.gov/projects/h5part/
    HDF4     2.4.1    File I/O library       http://hdf.ncsa.uiuc.edu/hdf4.html
    HDF5     1.6.5    File I/O library       http://hdf.ncsa.uiuc.edu/HDF5/
    Mili     1.10     File I/O library       (none)
    netCDF   3.6.0    File I/O library       http://www.unidata.ucar.edu/packages/netcdf/
    CGNS     2.4      File I/O library       http://www.cgns.org
    GDAL     1.3.2    GIS reader library     http://www.gdal.org
    CFITSIO  3006     File I/O library       http://heasarc.gsfc.nasa.gov/docs/heasarc/fits.html
    CCMIO    2.6.1    File I/O library       ftp://ftp.adapco.com/pub/outgoing/libccmio-2.6.1.tar.gz

Most of the third party libraries necessary to build VisIt are available for
download from ftp://ftp.llnl.gov/pub/visit/3rd_party.  It is suggested that
you start there and then go to the "For More Information" web sites for
any remaining libraries.


Building VisIt
===============

VisIt can currently be built on aix, irix, mac os x, linux, solaris, tru64
and windows operating systems.  The following instructions only apply to
building VisIt on Unix systems and does not apply to Mac OS X or Windows.

We currently build VisIt using the following compilers on the following
operating systems.  It is suggested that you use the same compilers.


   Operating System                        Compiler
   ================                        ========
   AIX 5.1                                 xlc
   IRIX64 6.5                              MIPSpro 7.41
   Redhad Enterprise Linux 3 (x86)         g++ 3.2.3
   Redhad Enterprise Linux 4 (x86, ia64)   g++ 3.2.3 or icc 9.1
   Redhad Enterprise Linux 4 (x86_64)      g++ 3.4.4
   Solaris 7                               (g++ 4.x would probably work)
   Tru64 5.1                               g++ 3.3.3

The following compilers will *NOT* work with VisIt.  They will either not
compile VisIt, one or more third party libraries, or will generate bad code.

   Operating System                        Compiler
   ================                        ========
   AIX 5.1                                 g++
   All                                     g++ earlier than 3.2
   Solaris 7                               g++ 3.2

It is essential that you build all the dependent packages and VisIt using
the same c++ compiler or you will encounter linking problems because different
compilers or different versions of the same compiler may use different name
mangling schemes.

If you want to specify the compiler for a particular package that is
using configure, the typical way to do so is by setting the CC and CXX
environment variables.  This is done as follows:

   setenv CC "your C compiler"
   setenv CXX "your C++ compiler"

where some common values for CC and CXX are:

    Operating System      CC               CXX
    ================      ========         ======     
    Various               gcc              g++
    Linux (x86, ia64)     icc              icpc
    AIX                   xlc              xlC
    IRIX64 6.5            cc               CC

If you are using gmake or are building on an SGI and your machine has
multiple CPUs, you may speed up the build process for many of the products
by doing a parallel make.  For gmake, the command would be

   make -j "# of processors"

and for an SGI the command would be

   env PARALLEL="# of processors" make -P

Lets go ahead and build VisIt.  Start off by creating a directory to hold
VisIt and the installed versions of each of the dependent libraries.

mkdir visit
setenv VISITDIR `pwd`/visit

Typically a single directory will hold the binaries and libraries for
multiple machine architectures.  Lets create an environment variable to
hold the name of the architecture specific directory.  Some examples
include:

setenv VISITARCH aix_5_ll_xlc_32
setenv VISITARCH aix_5_fed_64_xlc_64
setenv VISITARCH altix_gcc_3.3.3
setenv VISITARCH altix_gcc_4.1.2
setenv VISITARCH chaos_3_ia64_elan4_gcc_3.2.3
setenv VISITARCH chaos_3_x86_64_ib_gcc_3.4.4
setenv VISITARCH chaos_3_x86_elan3_gcc_3.2.3
setenv VISITARCH chaos_3_x86_elan3_icc_9.1
setenv VISITARCH irix64_cc_7.41_64
setenv VISITARCH linux_rhel3_gcc_3.2.3
setenv VISITARCH solaris_gcc_3.2
setenv VISITARCH tru64_5_gcc_3.3.3

Now build each of the dependent libraries followed by VisIt.

If you are building on AIX you should set the object mode to specify if you
are building a 32 or a 64 bit executable.  You should always build a 32 bit
version and then you may also optionally build a 64 bit version.  To set the
object mode issue one of the following two commands.

setenv OBJECT_MODE 32
setenv OBJECT_MODE 64

Mesa
=====

Mesa is a 3-D graphics library with an API which is very similar to that of
OpenGL.  It is used for performing off-screen rendering.

#
# Build Mesa
#
gunzip MesaLib-7.5.tar.gz
tar xf MesaLib-7.5.tar
cd Mesa-7.5

# You'll need to build Mesa twice, to get both "MesaGL" and "OSMesa"
# libraries.  The simplest way to do this is:
  ./configure \
    CFLAGS="${CFLAGS} -DUSE_MGL_NAMESPACE" \
    CXXFLAGS="${CXXFLAGS} -DUSE_MGL_NAMESPACE" \
    --prefix=/path/to/somewhere \
    --without-demos \
    --disable-gallium \
    --enable-gl-osmesa \
    --disable-glw \
    --disable-glu \
    --disable-egl \
    --with-driver=xlib
  # this fixes the library names
  cat configs/autoconf | \
     sed -e "s,GL_LIB = GL,GL_LIB=MesaGL,g" > configs/autoconf.edit \
     || return 1
  mv configs/autoconf.edit configs/autoconf
   cat configs/autoconf | \
     sed -e "s,GLU_LIB = GLU,GLU_LIB=MesaGLU,g" > configs/autoconf.edit \
     || return 1
  mv configs/autoconf.edit configs/autoconf
  make
  make install

  # And again, same deal but with a different --with-driver.
  ./configure \
    CFLAGS="${CFLAGS} -DUSE_MGL_NAMESPACE" \
    CXXFLAGS="${CXXFLAGS} -DUSE_MGL_NAMESPACE" \
    --prefix=/path/to/somewhere \
    --without-demos \
    --disable-gallium \
    --disable-glw \
    --disable-egl \
    --disable-glu \
  # this fixes the library names
  cat configs/autoconf | \
     sed -e "s,GL_LIB = GL,GL_LIB=MesaGL,g" > configs/autoconf.edit \
     || return 1
  mv configs/autoconf.edit configs/autoconf
   cat configs/autoconf | \
     sed -e "s,GLU_LIB = GLU,GLU_LIB=MesaGLU,g" > configs/autoconf.edit \
     || return 1
  mv configs/autoconf.edit configs/autoconf
  make
  make install

VTK
====

VTK is an object oriented library for visualizing 3D data.  VisIt uses it
for all its visualization functionality. Follow the directions listed below
to build VTK.  If you have any problems building or installing VTK, read the
VTK/README.html file included in the VTK distribution for more information.

#
# Build CMake which is used by VTK to configure its distribution
#
gunzip cmake-2.4.5.tar.gz
tar xf cmake-2.4.5.tar
cd cmake-2.4.5

#
# We have experienced problems building CMake on aix with g++/gcc.
# so for aix use the native compilers to build CMake: 
# env CXX=xlC CC=xlc CXXFLAGS="" CFLAGS="" ./bootstrap
# otherwise:
env CXXFLAGS=""  CFLAGS="" ./bootstrap

# We have experienced problems with CMake's build of its curses version,
# (ccmake) either with the curses header or library.  (Mainly with AIX).
# To prevent CMake from attempting to build ccmake, open CMakeCache.txt
# and set CURSES_LIBRARY:FILEPATH=   to ""
gmake

#
# Build VTK
#
cd ..
gunzip vtk-5.0.0d.tar.gz
tar xf vtk-5.0.0d.tar
cd VTK
#
# On irix systems we have experienced problems with CMake not using the
# -LANG:std for all the tests, so you will need to add it manually.
#
# env CXXFLAGS="-LANG:std" ../cmake-2.4.5/bin/cmake .
#
../cmake-2.4.5/bin/cmake .
#
# Edit CMakeCache.txt.  Turn BUILD_SHARED_LIBS and VTK_USE_MANGLED_MESA on.
# Turn BUILD_TESTING off.
#
# If you want to change the compilers you should modify CMAKE_CXX_COMPILER
# and CMAKE_C_COMPILER.  If you want to change the compiler flags you should
# modify CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.  You might want to specify "-O2"
# as a compiler flag to build an optimized version.
#
# On irix systems you will need to specify "-LANG:std" for the compiler and
# linker flags.  If you are building a 64 bit version you will also need
# to add "-64" to the compiler and linker flags.  These include CMAKE_C_FLAGS,
# CMAKE_CXX_FLAGS, CMAKE_EXE_LINKER_FLAGS, CMAKE_MODULE_LINKER_FLAGS, and
# CMAKE_SHARED_LINKER_FLAGS,
#
../cmake-2.4.5/bin/cmake .
#
# Edit CMakeCache.txt, setting MANGLED_MESA_INCLUDE_DIR, MANGLED_MESA_LIBRARY,
# MANGLED_OSMESA_INCLUDE_DIR, MANGLED_OSMESA_LIBRARY, to point to the
# appropriate files and directories in the mesa directory.
# For example:
#
# MANGLED_MESA_INCLUDE_DIR:PATH=$VISITDIR/mesa/7.5/$VISITARCH/include
# MANGLED_MESA_LIBRARY:FILEPATH=$VISITDIR/mesa/7.5/$VISITARCH/lib/libOSMesa.so
# MANGLED_OSMESA_INCLUDE_DIR:PATH=$VISITDIR/mesa/7.5/$VISITARCH/include
# MANGLED_OSMESA_LIBRARY:FILEPATH=$VISITDIR/mesa/7.5/$VISITARCH/lib/libMesaGL.so
#
# You might think that the above command is setting the MESA_LIBRARY and the
# OSMESA_LIBRARY in the opposite manner which it should, but this is actually
# correct!  The link order is very important.
#
../cmake-2.4.5/bin/cmake .

#
# On tru64 systems using g++ 3.3.3, several files in the Imaging directory
# will not compile because of an internal compiler error.  You will need to
# comment out the code in the Execute method (with "#if 0" as the first
# line in the method and "#endif" as the last line in the method.)  The
# execute methods are named "classname"Execute, (e.g. for vtkImageVariance3D,
# the method would be vtkImageVariance3DExecute).
# The files are:
#    Imaging/vtkImageConvolve.cxx
#    Imaging/vtkImageRange3D.cxx
#    Imaging/vtkImageVariance3D.cxx
#

#
# On tru64 systems using g++ 3.3.3, you may get messages indicating that
# "-timplicit_local -no_implicit_include" are not supported compiler
# options when building cmake.  Ignore them, the options appear to be
# necessary for things to build properly.
#

#
# On linux systems using icc 9.0, ./Graphics/vtkQuadricClustering.cxx will
# not compile because of an internal compiler error.  You will need to
# replace lines 231 - 233:
#     this->NumberOfDivisions[0] = (int)x > 0 ? (int)x : 1;
#     this->NumberOfDivisions[1] = (int)y > 0 ? (int)y : 1;
#     this->NumberOfDivisions[2] = (int)z > 0 ? (int)z : 1;
# with the lines:
#     int ix = (int) ceil((bounds[1]-this->Bounds[0])/this->DivisionSpacing[0]);
#     int iy = (int) ceil((bounds[3]-this->Bounds[2])/this->DivisionSpacing[1]);
#     int iz = (int) ceil((bounds[5]-this->Bounds[4])/this->DivisionSpacing[2]);
#     this->NumberOfDivisions[0] = ix > 0 ? ix : 1;
#     this->NumberOfDivisions[1] = iy > 0 ? iy : 1;
#     this->NumberOfDivisions[2] = iz > 0 ? iz : 1;
#

# 
# On Altix systems using g++ 3.3.3, the VTK library exhibits a compiler bug.
# (The code works fine when print statements are added, but fails without them).
# The code is in /Common/vtkByteSwap.cxx, which VisIt uses indirectly with 
# reader and writer routines that are used to serialize data sets on the engine
# and send them to the viewer (all binary messages in VTK are big-endian, even
# when both sender and receiver are little-endian).  To get around this 
# compiler bug, modify the vtkByteSwap.cxx file on for the method:
#   template <class T>
#   inline void vtkByteSwapRangeWrite(const T* first, vtkIdType num,
#                                     ostream* os, long)
#  (located at ~line 130)
#
#  From:
#  for(const T* p=first; p != last; ++p)
#    {
#    T temp = *p;
#    vtkByteSwapper<sizeof(T)>::Swap(&temp);
#    os->write((char*)&temp, sizeof(temp));
#    }
#
#
#  To:
#   for(const T* p=first; p != last; ++p)
#    {
#    T temp = *p;
#    vtkByteSwapper<sizeof(T)>::Swap(&temp);
#    T temp2 = *p;
#    vtkByteSwapper<sizeof(T)>::Swap(&temp2);
#    if (temp != temp2)
#        cerr << "A COMPILER BUG HAS BEEN EXPOSED ... CONTACT VISIT TEAM" << endl;
#    os->write((char*)&temp, sizeof(temp));
#    }
#
#  Again, this change has only been found to be necessary for Altix systems 
#  gcc 3.3.3.
#
gmake

#
# Install it in the visit directory under the vtk directory.
#
make install

# On Mac OS X, you will need to do a series of install_name_tool
# invocations to fix library paths.  See the function build_vtk in
# svn_bin/build_visit for details.

#
# Several of the header files in MangleMesaInclude have absolute paths
# of other headers files that are located in the directories you built
# VTK in.  This means that even though the header files were copied to
# the visit/vtk directory, there are still references to header files
# in directories where you built VTK.  This may cause problems if you
# later remove the directories where you built VTK, or if someone else
# were to use your installation and the permissions in your directories
# were incorrect.
#

Qt
===

The Qt toolkit from Trolltech is a free (for non-commercial use), cross-
platform Graphical User Inteface toolkit that runs on X11, MS Windows, and
MacOS X. VisIt uses Qt as the basis of its GUI and Viewer.  Follow the
directions listed below to build Qt.  You can use Qt version 4.4.0 or later.
If you have any problems building or installing Qt, read the INSTALL file
in the Qt distribution for more information. You can also read more at
http://www.visitusers.org/index.php?title=Qt4_Build_Notes.

#
# Build Qt 4.4.3
#
gunzip qt-x11-opensource-4.4.3.tar.gz
tar xf qt-x11-opensource-4.4.3.tar
cd qt-x11-opensource-4.4.3

#
# Prepare an installation location for Qt before we build it so we can
# later use "make install" to install Qt since we need various helper
# applications in addition to the libraries that get built.
#
mkdir $VISITDIR/qt
mkdir $VISITDIR/qt/4.4.3
mkdir $VISITDIR/qt/4.4.3/$VISITARCH

#
# Use the appropriate configure command based on the operating system on
# which you are building Qt.  You should use the linux-g++ platform for
# all linux versions except for opteron systems, in which case you should
# use the linux-g++-64 platform.
#
setenv QTINSTALL $VISITDIR/qt/4.4.3/$VISITARCH
./configure --prefix=$QTINSTALL -platform aix-xlc      -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform aix-xlc-64   -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform irix-cc-64   -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform linux-g++    -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform linux-g++-64 -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform linux-icc    -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform solaris-g++  -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng
./configure --prefix=$QTINSTALL -platform tru64-g++    -make libs -make tools -fast -no-separate-debug-info -no-qt3support -no-dbus -no-sql-mysql -no-sql-sqlite -qt-libpng

#
# Build Qt
#
make -j 4

#
# Install Qt in the visit directory under the qt directory.
#
make install
cd ..

#
# On AIX systems you will need to add an additional link to the lib
# directory so that the loader can find the library. These steps
# ONLY NEED TO BE DONE ON AIX.
#
pushd .
cd $QTINSTALL
ln -s libQtAssistantClient.a libQtAssistantClient.so
ln -s libQtCLucene.a libQtCLucene.so
ln -s libQtCore.a libQtCore.so
ln -s libQtDesigner.a libQtDesigner.so
ln -s libQtDesignerComponents.a libQtDesignerComponents.so
ln -s libQtGui.a libQtGui.so
ln -s libQtHelp.a libQtHelp.so
ln -s libQtNetwork.a libQtNetwork.so
ln -s libQtOpenGL.a libQtOpenGL.so
ln -s libQtScript.a libQtScript.so
ln -s libQtSvg.a libQtSvg.so
ln -s libQtTest.a libQtTest.so
ln -s libQtXml.a libQtXml.so
popd 


Silo
=====

Silo is a self-describing, machine-independent scientific file format.
Silo is one of the file formats supported by VisIt.  Follow the directions
listed below to build Silo.  If you have any problems building or installing
Silo, read the BUILD_NOTES file in the Silo distribution for more information.

#
# Build Silo
#
gunzip < silo-4.7.tar.gz | tar xvf -
cd silo-4.7

#
#
# On itanium (ia64) systems, the -fPIC flag is needed.  You can replace
# CFLAGS=-O2 with CFLAGS="-fPIC -O2" in the configure command below.
#
# On opteron systems, the -fPIC and -m64 flags are needed. You can replace
# CFLAGS="-O2" with CFLAGS="-m64 -fPIC -O2". You will also need to disable
# SDX by adding --disable-sdx to the end of the configure command.
#
# On irix systems, if you want to build a 64 bit version you can replace
# CFLAGS=-O2 with CFLAGS="-64 -O2" in the configure command below.
#
# If you want to build silo with hdf5 support then use the commented configure
# line.  If you want to build silo with hdf5 support you must first build hdf5,
# which is described later in this document.  The hdf5 library you use must
# be a serial version.  VisIt will not work with a parallel version.
#
# env CFLAGS=-O2 ./configure --without-readline -with-hdf5=$VISITDIR/hdf5/1.6.5/$VISITARCH/include,$VISITDIR/hdf5/1.6.5/$VISITARCH/lib
#
env CFLAGS=-O2 ./configure --without-readline --without-hdf5
make

#
# Install it in the visit directory under the silo directory.
#
mkdir $VISITDIR/silo
mkdir $VISITDIR/silo/4.7
mkdir $VISITDIR/silo/4.7/$VISITARCH
mkdir $VISITDIR/silo/4.7/$VISITARCH/{include,lib}
cp silo/silo/silo.{h,inc}   $VISITDIR/silo/4.7/$VISITARCH/include
cp lib/libsilo.a            $VISITDIR/silo/4.7/$VISITARCH/lib
cp lib/libsiloh5.a          $VISITDIR/silo/4.7/$VISITARCH/lib
cd ..


Python
=======

Python is a powerful, free scripting language that is used to drive VisIt's
viewer when running VisIt without a GUI. Python is cross platform and runs on
many UNIXes as well as MS Windows and other platforms. VisIt can be configured
to run without Python if scripting features are not desired.  Follow the
directions listed below to build Python.  If you have any problems building
or installing Python, read the README file in the Python distribution for more
information.

Building Python 2.5
======================

On itanium (ia64) systems, the -fPIC flag is needed.  On opteron systems,
the "-m64 -fPIC" flags are needed.  To add flags to python's build, do the
following:  (1) Follow the commands below until the configure step.  Execute
configure as given.  (2) Look at the Makefile and find the value of the
variable OPT.  (3) Re-execute configure with OPT specified through the env
command, with the additional flags added to OPT.  For example:

env OPT="-fPIC -O2" ./configure --prefix=$VISITDIR/python/2.5/$VISITARCH

where the "-O2" was the value of OPT in the makefile.  (4) Continue with
the commands below as given.

On irix systems, if you want to build a 64 bit version will need to override
the default compiler and linker options.  This is done in a similar fashion
as described above but -64 is added to OPT and LDFLAGS.  For example:

env OPT="-64 -O2" LDFLAGS="-64" ./configure --prefix=$VISITDIR/python/2.5/$VISITARCH

When you need to specify a C compiler other than the default gcc compiler 
that Python's configure process will detect, you should also specify a 
compatible C++ compiler so you can build C++ Python extensions. You can
specify compilers using the following example command lines:

env CXX=CC ./configure --with-gcc=cc --with-cxx=CC --prefix=$VISITDIR/python/2.5/$VISITARCH     # irix
env CXX=xlC ./configure --with-gcc=xlc --with-cxx=xlC --prefix=$VISITDIR/python/2.5/$VISITARCH  # aix

On AIX systems, you may want to build using the vendor xlc compiler in 64 bit mode.
Use the following command line to do so:

env CXX=xlC ./configure --with-gcc="xlc -q64 -O2" --with-cxx="xlC -q64 -O2" --disable-ipv6 AR="ar -X64" --prefix=$VISITDIR/python/2.5/$VISITARCH 

#
# Build and install it in the visit directory under the python directory.
#
gunzip Python-2.5.tgz
tar xf Python-2.5.tar
cd Python-2.5
./configure --prefix=$VISITDIR/python/2.5/$VISITARCH
make
make install

#
# You will also need to create a shared version of the python library.
#
mkdir tmpdir
cd tmpdir
ar -x ../libpython2.5.a
# Use the appropriate command based on the operating system on which
# you are creating the shared library.
xlc -qmkshrobj -o ../libpython2.5.so ../libpython2.5.a -lm           # aix / xlc
g++ -Wl,-G -shared -o ../libpython2.5.so *.o                         # aix / gcc
g++ -shared -o ../libpython2.5.so *.o                                # irix
CC  -shared -o ../libpython2.5.so *.o                                # irix
CC  -64 -shared -o ../libpython2.5.so *.o                            # irix 64
g++ -shared -o ../libpython2.5.so *.o                                # linux
g++ -m64 -shared -o ../libpython2.5.so *.o                           # opteron
g++ -Wl,-G -o ../libpython2.5.so *.o                                 # solaris
g++ -Wl,-expect_unresolved -Wl,'*' -shared -o ../libpython2.5.so *.o # tru64
cd ..
rm -rf tmpdir
cp libpython2.5.so $VISITDIR/python/2.5/$VISITARCH/lib/python2.5/config/libpython2.5.so
cd ..


Mili (Optional)
================

Mili uses GNU's autoconf system to provide platform independence when
building Mili in a UNIX environment.  It requires both a C and Fortran
compiler.  Its compiler flags are built directly into the configure script
based on platform.  In order to change the flags you must edit the configure
script.

#
# Build Mili.
#
gunzip mili-1.10.tar.gz
tar xf mili-1.10.tar
cd mili

#
# To get mili to build its library without a fortran compiler you will
# need to remove the fortran object files from the libmili dependencies.
# Remove "${MILI_f_SRC:.f=.o} ${MILI_F_SRC:.F=.o}" from src/Makefile.in.
#
# If you want to use a C compiler other than cc do the following:
#
#   In the file configure.in, change the line:
#   dnl AC_PROG_CC
#   to:
#   AC_PROG_CC
#
#   Run autoconf:
#   autoconf
#
#   Add the line:
#   CC = @CC@
#
#   to the files src/Makefile.in and test/Makefile.in before the line:
#   CFLAGS = @CFLAGS@
#
#   When you run configure you will need to set CC to the desired compiler.
#
# On irix systems, if you want to build a 64 bit version will need to override
# the default compiler options.  You will need to replace all occurances of
# "-n32" with "-64" in the configure script.
#
# On itanium (ia64) systems you will need to add -fPIC to the compiler options
# in the configure script.  Add -fPIC to CFLAGS and FFLAGS below the line
# containing "-unknown-linux" in the configure script.
#
# On opteron systems you will need to add "-m64 -fPIC" to the CFLAGS and
# FFLAGS.
#
# If you do not have a fortran compiler on your system then the fortran
# test examples will fail to build.  This is ok.
#
./configure
make

#
# Install it in the visit directory under the mili directory.
#
mkdir $VISITDIR/mili
mkdir $VISITDIR/mili/1.10
mkdir $VISITDIR/mili/1.10/$VISITARCH
cp src/mili.h      $VISITDIR/mili/1.10/$VISITARCH
cp src/mili_enum.h $VISITDIR/mili/1.10/$VISITARCH
cp src/libmili.a   $VISITDIR/mili/1.10/$VISITARCH
cd ..

HDF4 (Optional)
================

HDF4 is a data storage library that lets you write large volumes of data to
disk files and it is the predecessor of HDF5.

#
# Build HDF4.
#
gunzip HDF4.2r1.tar.gz
tar xf HDF4.2r1.tar
cd HDF4.2r1

#
# On itanium (ia64) systems, you will need to add "-fPIC" to the CFLAGS.  On
# opteron systems, you will need to add "-fPIC -m64" to the CFLAGS.
#
env CFLAGS="-O2" LIBS="-lm" ./configure --disable-fortran -prefix=$VISITDIR/hdf4/2.4.1/$VISITARCH

#
# Install it in the visit directory under the hdf4 directory.
#
mkdir $VISITDIR/hdf4
mkdir $VISITDIR/hdf4/2.4.1
mkdir $VISITDIR/hdf4/2.4.1/$VISITARCH
make install
cd ..

HDF5 (Optional)
================

HDF5 is an I/O library that is used by many of the VisIt database plugins.

#
# Build HDF5.
#
gunzip hdf5-1.6.5.tar.gz
tar xf hdf5-1.6.5.tar
cd hdf5-1.6.5

HDF5 can be built as a serial or a parallel library.  Always build the
serial version of HDF5 for VisIt.  Both the serial and parallel versions
of VisIt use the serial version of HDF5.

If HDF5 is already installed on your system in a standard location such
as /usr/local then it may conflict with the version you are now building.
The problem is that a compile line may have include (-I) or library (-L)
directives so that either the header files or library are coming from the
system location and the other is coming from the location where you are
installing the version you are now building.  If this occurs you will have
a run time failure of any plugins that depend on HDF5.  The solution is to
make sure that neither the header files nor the library are coming from
the system location.

HDF5 will by default want to use the vendor supplied compiler so you will
probably need to specify the compiler.  This can be done by preceding the
configure command with "env CC=compiler_name".

On irix systems if you want to build a 64 bit version you will need to
precede the configure command with "env CC="cc -O2 -64" CFLAGS="-O2 -64".
The CC part is to get around a bug in their make system.

On aix systems you will need to specify the appropriate flags to build
either a 32 bit or 64 bit version.  To build a 32 bit version, preceed the
configure command with "env CC="xlc -q32" AR="ar -X 32"".  To build a 64
bit version, preceed the configure command with "env CC="xlc -q64" AR="ar
 -X 64"".

On itanium (ia64) systems you will need to add -fPIC to the compile flags.
This can be done by preceding the configure command with "env CFLAGS=-fPIC".

On opteron systems you will need to add "-m64 -fPIC" to the compile
flags.  This can be done by preceding the configure command with
"env CFLAGS="-m64 -fPIC"".

./configure --disable-shared -prefix=$VISITDIR/hdf5/1.6.5/$VISITARCH
make

#
# Install it in the visit directory under the hdf5 directory.
#
mkdir $VISITDIR/hdf5
mkdir $VISITDIR/hdf5/1.6.5
mkdir $VISITDIR/hdf5/1.6.5/$VISITARCH
make install
cd ..

Boxlib (Optional)
==================

Boxlib is an I/O library for reading and writing structured AMR mesh data.

#
# Build Boxlib.
#
gunzip boxlib.tar.gz
tar xf boxlib.tar
cd CCSEApps/BoxLib

Boxlib does not work on Solaris or Irix systems.  We had to modify boxlib
to use it with VisIt so you will need to contact us for the source code if
you wish to build it.

Boxlib does not build with icc since it includes fortran code which will
lead to unsatisfied externals at runtime.  Most of the fortran consists of
interface routines which could be removed by commenting out all the lines
after the comment "Fortran interface routines." near the bottom of the file
Make.package.  Unfortunately, the C routines call two fortran routines,
which could probably be fairly easily rewritten in C.  Unfortunately that
hasn't been done yet.  The routines are FORT_FASTCOPY and FORT_FASTSETVAL.

You should turn off subscript range checking with the g77 compiler. To do
this comment out the 2 lines that contain "-ffortran-bounds-check" from the
file ../mk/Make.Linux.

You will need to modify GNUmakefile so that it doesn't use MPI.  To do this
change "USE_MPI   = TRUE" to "USE_MPI   = FALSE".

On itanium (ia64) systems you will need to add -fPIC to the compile flags.
This can be done by adding the line "CXXFLAGS += -fPIC" and "FFLAGS += -fPIC"
near the top of the file GNUmakefile.

On opteron systems you will need to add "-m64 -fPIC" to the compile flags.
This can be done by adding the line "CXXFLAGS += -m64 -fPIC" and
"FFLAGS += -m64 -fPIC" near the top of the file GNUmakefile.  You also will
probably want to add optimization flags (i.e. -O2).

#
# Boxlib builds either a 2d or 3d version and VisIt needs both, so you will
# need to build the 3d version, install it and then build the 2d version and
# install it.
#
# You will need to modify GNUmakefile to set the compiler.  Typically, this
# will involve replacing "KCC" with the name of your c++ compiler in the
# line "COMP      = KCC".  If the compiler doesn't match one of the ones
# in the file ../mk/Make.defs, you will need to create an entry for it in
# that file.  The only values of COMP that it understands and are relevant
# for VisIt are g++ and Intel.  If the g++ compiler is referenced by anything
# other than g++, the easiest thing is to change all occurances of g++ with the
# other name in the file ../mk/Make.defs.  For example if the compiler is
# g++-3.2.3, then change all occurances of g++ to g++-3.2.3.
#
# If you are building with icc, you should change "COMP      = KCC" to
# "COMP      = Intel".
#
# If you are using icc 9.0 you should add the following lines
#
#    ifeq ($(findstring Version 9.0, $(__icc_version)), Version 9.0)
#        ICC_VERSION := 9.0
#        ICC_MAJOR_VERSION := 9
#        ICC_MINOR_VERSION := 0
#    endif
#
# to ../mk/Make.defs at the end of the section "ifeq ($(COMP),Intel)".
#
# If you are building with xlC, you should change "COMP      = KCC" to
# "COMP      = xlC" and add the following lines to ../mk/Make.defs.
#
# ifeq ($(COMP),xlC)
#     CXXPRFF    := -p
#     CXXOPTF    += -O2
#     CXXDEBF    += -g
#     CXX        := xlC -qrtti=dynamiccast
# endif
#

#
# Start off by building the 3d version.
#
gmake -f GNUmakefile
#
# If the make fails with complaints about the header file "limits", try
# moving the directory "std" to "std.old" and issuing another make command.
#

#
# Install the 3d version in the visit directory under the boxlib directory.
#
mkdir $VISITDIR/boxlib
mkdir $VISITDIR/boxlib/$VISITARCH
mkdir $VISITDIR/boxlib/$VISITARCH/{include,lib}
mkdir $VISITDIR/boxlib/$VISITARCH/include/{2D,3D}
cp libbox3d*.a $VISITDIR/boxlib/$VISITARCH/lib/libbox3D.a
tar cf Boxlib3D.h.tar *.H

#
# Now build the 2d version.
#
gmake clean

#
# You will need to modify the GNUmakefile to set the dimension to 2.  This
# will involve replacing "3" with "2" in the line "DIM       = 3".
#
gmake -f GNUmakefile

#
# Install the 2d version in the visit directory under the boxlib directory.
#
cp libbox2d*.a $VISITDIR/boxlib/$VISITARCH/lib/libbox2D.a
tar cf Boxlib2D.h.tar *.H

#
# Install the header files.
#
cp Boxlib2D.h.tar $VISITDIR/boxlib/$VISITARCH/include/2D
cp Boxlib3D.h.tar $VISITDIR/boxlib/$VISITARCH/include/3D
cd $VISITDIR/boxlib/$VISITARCH/include/2D
tar xf Boxlib2D.h.tar
cd $VISITDIR/boxlib/$VISITARCH/include/3D
tar xf Boxlib3D.h.tar
cd $VISITDIR
cd ..


netCDF (Optional)
==================

NetCDF (Network Common Data Form) is an interface for array-oriented data
access and a library that provides an implementation of the interface. The
netCDF library also defines a machine-independent format for representing
scientific data. Together, the interface, library, and format support the
creation, access, and sharing of scientific data. NetCDF uses GNU's autoconf
system to provide a platform-independent build process.

#
# Build netCDF (without Fortran support)
#
gunzip netcdf.tar.gz
tar xvf netcdf.tar
cd netcdf-3.6.0-p1/src

mkdir $VISITDIR/netcdf
mkdir $VISITDIR/netcdf/3.6.0
mkdir $VISITDIR/netcdf/3.6.0/$VISITARCH

#
# On itanium (ia64) systems, you should add "-fPIC" to the following CFLAGS
# and CXXFLAGS.  On opteron systems, you should add "-fPIC -m64" to the
# following CFLAGS and CXXFLAGS.
#
./configure --prefix=$VISITDIR/netcdf/3.6.0/$VISITARCH FC="" CFLAGS="-O2" CXXFLAGS="-O2"
make

#
# Install it in the visit directory under the netcdf directory
#
make install
cd ../..


CGNS (Optional)
================

The CFD General Notation System (CGNS) consists of a collection of 
conventions, and software implementing those conventions, for the storage
and retrieval of CFD (computational fluid dynamics) data. The principal 
target of CGNS is data normally associated with compressible viscous flow
(i.e., the Navier-Stokes equations), but the standard is also applicable
to subclasses such as Euler and potential flows.

#
# Build CGNS
#
gunzip cgnslib_2.4-3.tar.gz
tar xvf cgnslib_2.4-3.tar
cd cgnslib_2.4

mkdir $VISITDIR/cgns
mkdir $VISITDIR/cgns/2.4
mkdir $VISITDIR/cgns/2.4/$VISITARCH
mkdir $VISITDIR/cgns/2.4/$VISITARCH/include
mkdir $VISITDIR/cgns/2.4/$VISITARCH/lib

#
# On SGI, you may want to add -64 to the CFLAGS to build a 64 bit binary.
# Note that if you do that then after you configure, you will have to remove
# "-n32" from the make.SGI file that configure creates.
#
# On itanium (ia64) systems, you should add "-fPIC" to the CFLAGS.
#
# On opteron systems, you should add "-fPIC -m64" to the CFLAGS.
#

env CFLAGS="-O2" ./configure --prefix=$VISITDIR/cgns/2.4/$VISITARCH
make

#
# Install it in the visit directory under the cgns directory
#
make install
cd ..


GDAL (Optional)
================

GDAL is a translator library for raster geospatial data formats that presents
a single abstract data model to the calling application for all supported
formats. 

#
# Build GDAL
#
gunzip gdal-1.3.2.tar.gz
tar xvf gdal-1.3.2.tar
cd gdal-1.3.2

mkdir $VISITDIR/gdal
mkdir $VISITDIR/gdal/1.3.2
mkdir $VISITDIR/gdal/1.3.2/$VISITARCH

#
# On itanium (ia64) systems, you should add "-fPIC" to the CFLAGS, CXXFLAGS.
#
# On opteron systems, you should add "-fPIC -m64" to the CFLAGS, CXXFLAGS.
#
# On AIX systems where you build a 64 bit library using xlC, add the following
# to the front of the configure line:
#     env CC=xlc CXX=xlC CFLAGS="-q64 -qcpluscmt -O2" CXXFLAGS="-q64 -O2"
#
# Some systems may have problems building mysql support. If that is the case
# you will need to add "--without-mysql" at the end of the following configure
# command.
#
env CXXFLAGS="-O2" CFLAGS="-O2" ./configure --prefix=$VISITDIR/gdal/1.3.2/$VISITARCH --with-libtiff=internal --with-gif=internal --with-png=internal --with-jpeg=internal --with-libz=internal --with-netcdf=no --without-jasper --enable-static --disable-shared --without-python
make

#
# Install GDAL in the visit directory under the gdal directory
#
make install
cd ..


CFITSIO (Optional)
===================

CFITSIO is a library for reading FITS files. FITS stands for `Flexible Image 
Transport System' and is the standard astronomical data format endorsed by 
both NASA and the IAU. FITS is much more than an image format (such as JPG 
or GIF) and is primarily designed to store scientific data sets consisting 
of multi-dimensional arrays (1-D spectra, 2-D images or 3-D data cubes) and
2-dimensional tables containing rows and columns of data.

#
# Build CFITSIO
#
gunzip cfitsio3006.tar.gz
tar xvf cfitsio3006.tar
cd cfitsio

mkdir $VISITDIR/cfitsio
mkdir $VISITDIR/cfitsio/3006
mkdir $VISITDIR/cfitsio/3006/$VISITARCH

#
# You should specify the compiler because otherwise CFITSIO's configure
# script will first look for a proprietary compiler before reverting to
# gcc. If you want to use gcc or another compiler from the beginning then
# you should provide it on the configure line.
#
# On AIX systems where you build 64 bit libraries using xlc, add the following
# to the front of the configure line:
#    CC=xlc CFLAGS="-q64 -O2"
#
#
env CC=gcc ./configure --prefix=$VISITDIR/cfitsio/3006/$VISITARCH 
make

#
# Install CFITSIO in the visit directory under the cfitsio directory
#
make install
cd ..


ExodusII (Optional)
====================

EXODUS II is a library for reading and writing data for finite element
analyses.  It is used for preprocessing (problem definition), postprocessing
(results visualization), as well as code to code data transfer.  An EXODUS II
data file is a random access, machine independent, binary file that is
written and read via C, C++, or Fortran routines.

The EXODUS II library depends on the NetCDF library, so you will need to
build it first.  When you build NetCDF, you can either modify the source
files as described in the README file that comes with EXODUS, or you can
use the NetCDF sources that we have already modified.

#
# Build and install the netcdf libraries.
#
gunzip netcdf-3.6.0-exodusii.tar.gz
tar xf netcdf-3.6.0-exodusii.tar
cd netcdf-3.6.0-exodusii/src

mkdir $VISITDIR/exodus
mkdir $VISITDIR/exodus/4.46
mkdir $VISITDIR/exodus/4.46/$VISITARCH
mkdir $VISITDIR/exodus/4.46/$VISITARCH/{inc,lib}

#
# On itanium (ia64) systems, you should add "-fPIC" to the following CFLAGS
# and CXXFLAGS.  On opteron systems, you should add "-fPIC -m64" to the
# following CFLAGS and CXXFLAGS.
#
./configure --prefix=$VISITDIR/netcdf/3.6.0/$VISITARCH FC="" CFLAGS="-O2" CXXFLAGS="-O2"
make

#
# Install it under the exodus directory.
#
cp libsrc/netcdf.h $VISITDIR/exodus/4.46/$VISITARCH/inc
cp libsrc/libnetcdf.a $VISITDIR/exodus/4.46/$VISITARCH/lib

cd ../..

#
# Build and install the exodus libraries.
#
gunzip exodusii-4.46.tar.gz
tar xf exodusii-4.46.tar
cd exodusii-4.46

#
# To modify the build flags you will need to modify Makefile.standalone.
# The top of the Makefile sets a collection of flags based on the operating
# system and compiler.  Add -I$(VISITDIR)/exodus/4.46/$(VISITARCH)/inc to
# CCOPTIONS under the appropriate target in the Makefile.
#
# On itanium (ia64) systems, you should add "-fPIC" to the CCOPTIONS.  On
# opteron systems, you should add "-fPIC -m64" to the CCOPTIONS.
#
make -f Makefile.standalone

#
# Install it under the exodus directory.
#
cp cbind/include/exodusII.h $VISITDIR/exodus/4.46/$VISITARCH/inc
cp cbind/include/exodusII_ext.h $VISITDIR/exodus/4.46/$VISITARCH/inc
cp libexoIIv2c.a $VISITDIR/exodus/4.46/$VISITARCH/lib

cd ..

H5Part (Optional)
====================

H5Part is a very simple data storage schema and provides an API that
simplifies the reading/writing of the data to the HDF5 file format.  It
is developed by the visualization group at the Lawrence Berkeley National
Laboratory.  Since H5Part uses HDF5, you will need to build a serial version
of the HDF5 library before building H5Part.  Instructions for building HDF5
are covered earlier in this document.

#
# Build H5Part
#
gunzip H5Part-1.3.3.tar.gz
tar xf H5Part-1.3.3.tar
cd H5Part-1.3.3

mkdir $VISITDIR/h5part
mkdir $VISITDIR/h5part/1.3.3
mkdir $VISITDIR/h5part/1.3.3/$VISITARCH

#
# On linux systems it will try to use the Intel C and C++ compilers.  If
# you want to use the GNU compilers instead you will need to specify
# "CC=gcc CXX=g++".
#
# On itanium (ia64) systems, you should add "-fPIC" to the following CFLAGS
# and CXXFLAGS.  On opteron systems, you should add "-fPIC -m64" to the
# following CFLAGS and CXXFLAGS.
#
./configure --with-hdf5path=$VISITDIR/hdf5/1.6.5/$VISITARCH --prefix=$VISITDIR/h5part/1.3.3/$VISITARCH
cd src
make

#
# Install CFITSIO in the visit directory under the cfitsio directory
#
make install


CCMIO (Optional)
================
libccmio is a library that can read Star-CD files.

#
# Unpack and build the code
#
tar zxvf libccmio-2.6.1.tar.gz
cd libccmio-2.6.1
make batch

# Make the appropriate target directories.
mkdir $VISITDIR/ccmio
mkdir $VISITDIR/ccmio/2.6.1
mkdir $VISITDIR/ccmio/2.6.1/$VISITARCH
mkdir $VISITDIR/ccmio/2.6.1/$VISITARCH/lib
mkdir $VISITDIR/ccmio/2.6.1/$VISITARCH/include
pushd .
cd $VISITDIR/ccmio/2.6.1/$VISITARCH/include
ln -s . libccmio
popd

# Copy the libraries and includes into the target directories.
cp `ls lib/*/release-static/libadf.a` $VISITDIR/ccmio/2.6.1/$VISITARCH/lib
cp `ls lib/*/release-static/libccmio.a` $VISITDIR/ccmio/2.6.1/$VISITARCH/lib
cp libccmio/ccmio*.h $VISITDIR/ccmio/2.6.1/$VISITARCH/include

# Change the file permissions
chgrp -R visit $VISITDIR/ccmio
chmod -R go+r $VISITDIR/ccmio
chmod -R g+w $VISITDIR/ccmio
foreach d (`find $VISITDIR/ccmio -type d`)
chmod go+x $d
end
cd ..


VisIt
======

VisIt uses the CMake build system to generate a cross-platform build system 
that works on Windows, MacOS X, and UNIX. CMake uses a file called CMakeLists.txt
to generate Makefiles or project files for your environment. We recommand using
the build_visit script since it will build all of VisIt's 3rd party dependencies
and it will generate a `hostname`.conf file that can be used to inform cmake
about the libraries that you will be using when compiling VisIt. Follow the 
directions listed below to build VisIt. More information about building VisIt 
follows after that.

#
# Build and install it
#
gunzip visit1.12.2.tar.gz
tar xf visit1.12.2.tar
cp `hostname`.conf visit1.12.2/src/config-site
cd visit1.12.2/src
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/where/to/install/visit .
make

#
# Install VisIt
#
make install

When running the configure script you can enable or disable certain dependent
packages.  All the configure options are listed at the beginning of the
configure script or can listed by the configure script by typing
"./configure -help".  The most commonly used options are:

  -DVISIT_PARALLEL:BOOL=ON            make the parallel version
  -DVISIT_JAVA:BOOL=ON                build the Java interface library
  -DVISIT_BUILD_ALL_PLUGINS:BOOL=ON   build all plugins

  -DVISIT_NETCDF_DIR:PATH=path        Location of NetCDF header and library
  -DVISIT_HDF5_DIR:PATH=path          Location of HDF5 header and library

The VISIT_PARALLEL option builds the parallel version of VisIt.  Parallel
versions are supported on SGI, IBM AIX, Tru64, MacOS X, and most linux systems.
The VISIT_BUILD_ALL_PLUGINS option builds all the VisIt plugins.  By default, 
only the most common plugins are built.

The second group of options are used when building with support for reading
netcf files or files based on hdf5. 

Many more options are available and you can find out more about them if you
run ccmake to configure VisIt.

If you have any problems send e-mail to visit-developers@ornl.gov.
