Installing multiple versions of Chaste's dependencies for testing compatibility

As part of Chaste's automated testing, we build and run our main test packs with a range of different library versions, to ensure we do not inadvertently break support. This page describes the steps used to set up the machine that runs these tests, and hence needs many different versions of the dependencies installed. Note that using different dependency versions also requires support in the hostconfig configuration, a snippet of which is included below (the definitive version is at source:trunk/python/hostconfig/machines/chaste64.py, and is not publicly accessible).

A pre-requisite to the instructions below is that a 'bob' account has been set up as a normal automated build account, and the .bashrc file of the account running the instructions contains the following (at the top):

export PATH=$HOME/mpi/bin:$HOME/hdf5/bin:$HOME/bin:$PATH
source /opt/intel/bin/compilervars.sh intel64
export INTEL_LICENSE_FILE="28519@flexlm.nsms.ox.ac.uk"

The following bash script was used to install the dependencies.

# Link to the existing bob account for some dependencies

# Either link to bob for MPICH / ParMetis or see below
#ln -s ~bob/mpi
#ln -s /home/bob/ParMetis-3.1
ln -s /home/bob/petsc-3.1-p8

mkdir -p ~/bin
# The folder where automated builds will take place
mkdir -p ~/eclipse/workspace

# Dependency sources go in ~/src
mkdir -p ~/src
cd ~/src

wget https://chaste.cs.ox.ac.uk/trac/raw-attachment/wiki/InstallGuides/NonRootDeveloper/mpich-1.2.7p1.tar.gz
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/OLD/ParMetis-3.1.tar.gz

wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-2.3.2-p4.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-2.3.3-p15.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.0.0-p12.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.1-p8.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.2-p7.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.3-p5.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.4.2.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.2.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.6.1.tar.gz

wget http://downloads.sourceforge.net/project/boost/boost/1.37.0/boost_1_37_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.40.0/boost_1_40_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.42.0/boost_1_42_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.46.1/boost_1_46_1.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.49.0/boost_1_49_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.56.0/boost_1_56_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2

wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.6.10/src/hdf5-1.6.10.tar.bz2
wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.9/src/hdf5-1.8.9.tar.bz2
wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.bz2
wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.14/src/hdf5-1.8.14.tar.bz2

wget http://mirror.ox.ac.uk/sites/rsync.apache.org/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz
wget http://mirror.ox.ac.uk/sites/rsync.apache.org/xerces/c/3/sources/xerces-c-3.1.1.tar.gz

wget http://www.codesynthesis.com/download/xsd/2.3/linux-gnu/x86_64/xsd-2.3.1-x86_64-linux-gnu.tar.bz2
wget http://www.codesynthesis.com/download/xsd/3.1/linux-gnu/x86_64/xsd-3.1.0-x86_64-linux-gnu.tar.bz2
wget http://www.codesynthesis.com/download/xsd/3.2/linux-gnu/x86_64/xsd-3.2.0-x86_64-linux-gnu.tar.bz2
wget http://www.codesynthesis.com/download/xsd/3.3/linux-gnu/x86_64/xsd-3.3.0-x86_64-linux-gnu.tar.bz2
wget http://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-x86_64-linux-gnu.tar.bz2
wget https://chaste.cs.ox.ac.uk/public/deps/xsd-setg.patch

wget https://chaste.cs.ox.ac.uk/public/deps/cvode-2.5.0.tar.gz
wget https://chaste.cs.ox.ac.uk/public/deps/cvode-2.6.0.tar.gz
wget https://chaste.cs.ox.ac.uk/public/deps/cvode-2.7.0.tar.gz
wget https://chaste.cs.ox.ac.uk/public/deps/cvode-2.8.1.tar.gz

wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
wget http://www.vtk.org/files/release/5.10/vtk-5.10.1.tar.gz
wget http://www.vtk.org/files/release/6.0/vtk-6.0.0.tar.gz
wget http://www.vtk.org/files/release/6.1/VTK-6.1.0.tar.gz

wget http://prdownloads.sourceforge.net/scons/scons-2.4.0.tar.gz

for f in *gz; do tar -zxf $f; done
for f in *bz2; do tar -jxf $f; done


# Texttest, for acceptance testing
cd
wget http://downloads.sourceforge.net/project/texttest/texttest/3.19/texttest-3.19.zip
unzip texttest-3.19.zip
mv texttest-3.19.zip src/


# CodeSynthesis XSD
cd ~/src
mv xsd-*-linux-gnu ..
for ver in ~/xsd-3*; do
    cd $ver
    patch -p0 <~/src/xsd-setg.patch
done


# CVODE
cd ~/src
wget --no-check-certificate https://chaste.cs.ox.ac.uk/cgi-bin/trac.cgi/raw-attachment/wiki/InstallCvode/cvode.patch
cd ~/src/cvode-2.5.0/
patch -p0 < ../cvode.patch 
./configure --prefix=$HOME/cvode --with-cflags=-O3 --with-fflags=-O3 --disable-mpi --enable-shared && make && make install
cd ~/src/cvode-2.6.0/
patch -p0 < ../cvode.patch 
./configure --prefix=$HOME/cvode_2_6 --with-cflags=-O3 --with-fflags=-O3 --disable-mpi --enable-shared && make && make install
cd ~/src/cvode-2.7.0/
patch -p0 < ../cvode.patch 
./configure --prefix=$HOME/cvode_2_7 --with-cflags=-O3 --with-fflags=-O3 --disable-mpi --enable-shared && make && make install
# Note that CVODE 2.8 moved to a CMake build
cd ~/src/cvode-2.8.1/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/robert/cvode_2_8 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DEXAMPLES_ENABLE=OFF ..
make && make install


# MPI - option
# Note that on userpc58 this is a symbolic link to the bob MPI - see top of script
cd ~/src/mpich-1.2.7p1
CCFLAGS=-fPIC CFLAGS=-fPIC  ./configure --prefix=${HOME}/mpi --with-comm=shared --with-device=ch_shmem --enable-sharedlib --disable-f77
make
cd examples/test/
make testing
cd ../..
make install


# ParMETIS - option
# Note that on userpc59 this is a symbolic link to the bob ParMETIS - see top of script
cd ~/src/ParMetis-3.1/
export PATH=${HOME}/mpi/bin:${PATH}
cp Makefile.in Makefile.in.orig
sed 's/mpicc/\/home\/robert\/mpi\/bin\/mpicc/' Makefile.in.orig > Makefile.in 
make
cd
mv src/ParMetis-3.1 .
chmod -R a+rX ParMetis-3.1


# Boost
cd ~/src/boost_1_37_0/
./configure --prefix=$HOME/boost_1_37 && make && make install
cd ~/src/boost_1_40_0/
./bootstrap.sh --prefix=$HOME/boost_1_40 && ./bjam -j 10 install
cd ~/src/boost_1_42_0/
./bootstrap.sh --prefix=$HOME/boost_1_42 && ./bjam -j 10 install
cd ~/src/boost_1_46_1/
./bootstrap.sh --prefix=$HOME/boost_1_46_1 && ./bjam -j 10 install
cd ~/src/boost_1_48_0/
./bootstrap.sh --prefix=$HOME/boost_1_48 && ./b2 -j 10 install
cd ~/src/boost_1_49_0/
./bootstrap.sh --prefix=$HOME/boost_1_49 && ./b2 -j 10 install
cd ~/src/boost_1_51_0/
./bootstrap.sh --prefix=$HOME/boost_1_51 && ./b2 -j 10 install
cd ~/src/boost_1_53_0/
./bootstrap.sh --prefix=$HOME/boost_1_53 && ./b2 -j 10 install
cd ~/src/boost_1_54_0/
./bootstrap.sh --prefix=$HOME/boost_1_54 && ./b2 -j 10 install
cd ~/src/boost_1_55_0/
./bootstrap.sh --prefix=$HOME/boost_1_55 && ./b2 -j 10 install
cd ~/src/boost_1_56_0/
./bootstrap.sh --prefix=$HOME/boost_1_56 && ./b2 -j 10 install
cd ~/src/boost_1_57_0/
./bootstrap.sh --prefix=$HOME/boost_1_57 && ./b2 -j 10 install
cd ~/src/boost_1_58_0/
./bootstrap.sh --prefix=$HOME/boost_1_58 && ./b2 -j 10 install
cd ~/src/boost_1_59_0/
./bootstrap.sh --prefix=$HOME/boost_1_59 && ./b2 -j 10 install
cd ~/src/boost_1_60_0/
./bootstrap.sh --prefix=$HOME/boost_1_60 && ./b2 -j 10 install

# HDF5
export OLD_PATH=$PATH
export PATH=${HOME}/mpi/bin:${PATH}
cd ~/src/hdf5-1.6.10/
export CC=mpicc 
./configure --enable-shared --enable-parallel --prefix=${HOME}/hdf5 && make -j10 && make install
cd ~/src/hdf5-1.8.9/
./configure --enable-shared --enable-parallel --prefix=${HOME}/hdf5_1_8_9 && make -j10 && make install
# Note: HDF5 1.8.13 doesn't like MPICH 1
#cd ~/src/hdf5-1.8.13
#./configure --enable-parallel --prefix=${HOME}/hdf5_1_8_13 && make -j10 && make install
export PATH=$OLD_PATH
unset CC


# Xerces
cd ~/src/xerces-c-src_2_8_0
export XERCESCROOT=`pwd`
cd $XERCESCROOT/src/xercesc
./runConfigure -plinux -cgcc -xg++ -P${HOME}/xercesc_2_8 && make && make install

cd ~/src/xerces-c-3.1.1
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_1 && make && make install


# PETSc
cd ~/src
mv petsc-[0-9]* ../

cd ~/petsc-2.3.2-p4/
export PETSC_DIR=`pwd`
unset PETSC_ARCH # Just in case!
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false -PETSC_ARCH=linux-gnu --with-clanguage=cxx --with-shared --with-fortran=0 && make all
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false -PETSC_ARCH=linux-gnu-opt --with-clanguage=cxx --with-shared --with-fortran=0 --with-debugging=0 && make all
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false -PETSC_ARCH=linux-gnu-profile --with-clanguage=cxx --with-shared --with-fortran=0 --CFLAGS=-pg -CXXFLAGS=-pg -LDFLAGS=-pg && make all
./config/configure.py --with-cxx=icpc --with-cc=icc --with-vendor-compiler=intel --with-mpi-dir=${HOME}/mpi --with-x=false  --with-debugging=0 -PETSC_ARCH=linux-intel-opt-mkl --with-clanguage=cxx --with-blas-lapack-dir=/opt/intel/composerxe/mkl/lib/intel64/ --with-fortran=0 && make all

cd ~/petsc-2.3.3-p15/
export PETSC_DIR=`pwd`
unset PETSC_ARCH # Just in case!
./config/configure.py --with-make-np=10 --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false -PETSC_ARCH=linux-gnu --with-clanguage=cxx --with-shared --with-fortran=0 && make all
./config/configure.py --with-make-np=10 --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-debugging=0 -PETSC_ARCH=linux-gnu-opt --with-clanguage=cxx --with-shared --with-fortran=0 && make all
./config/configure.py --with-make-np=10 --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false -PETSC_ARCH=linux-gnu-profile --with-clanguage=cxx --with-shared --with-fortran=0 --CFLAGS=-pg -CXXFLAGS=-pg -LDFLAGS=-pg && make all

cd ~/petsc-3.0.0-p12/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-clanguage=cxx --with-shared --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-debugging=0 --with-clanguage=cxx --with-shared --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-clanguage=cxx --with-shared --with-fortran=0 --CFLAGS=-pg -CXXFLAGS=-pg -LDFLAGS=-pg && make all

cd ~/petsc-3.1-p8/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-clanguage=cxx --with-shared --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-debugging=0 --with-clanguage=cxx --with-shared --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --download-c-blas-lapack=1 --with-mpi-dir=${HOME}/mpi --with-x=false --with-clanguage=cxx --with-shared --with-fortran=0 --CFLAGS=-pg -CXXFLAGS=-pg -LDFLAGS=-pg && make all

# Note: this is dangerous!  Since PETSc has its own MPICH it needs its own HDF5, which will be used in preference to any lofty/_hostconfig specification
# See e.g. https://chaste.cs.ox.ac.uk/tests.py/testsuite?buildType=_hostconfig,petsc=3-2,hdf5=1-8,boost=1-40,xsd=4-0,cvode=2-7&machine=userpc59.cs.ox.ac.uk&revision=23319&runtime=0&status=OK&testsuite=global-test-TestChasteBuildInfo&timestamp=1420204242.7705&type=nightly which reports using HDF5 1.8.6 (despite 1.8.9 being installed above),
# and https://chaste.cs.ox.ac.uk/tests.py/testsuite?buildType=_hostconfig,petsc=3-3,hdf5=1-6,boost=1-54,xsd=3-1,cvode=2-7,parmetis=4&machine=userpc59.cs.ox.ac.uk&revision=23315&runtime=0&status=OK&testsuite=global-test-TestChasteBuildInfo&timestamp=1419722101.4278&type=nightly which reports using HDF5 1.8.8.
cd ~/petsc-3.2-p7/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --download-f2cblaslapack=1 --download-mpich=1 --download-parmetis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 && ./config/builder.py
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --download-f2cblaslapack=1 --download-mpich=1 --download-parmetis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --with-debugging=0 && ./config/builder.py
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --download-f2cblaslapack=1 --download-mpich=1 --download-parmetis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --CFLAGS="-fno-omit-frame-pointer -pg" -CXXFLAGS="-fno-omit-frame-pointer -pg" -LDFLAGS=-pg && ./config/builder.py

# Build HDF5 1.8.13 as a replacement for the HDF5 1.8.6 that PETSc 3.2 would install itself
export PETSC_DIR=$HOME/petsc-3.2-p7
cd ~/src/hdf5-1.8.13
OLD_PATH=$PATH
for build in linux-gnu linux-gnu-opt linux-gnu-profile ; do
    export PATH=$PETSC_DIR/$build/bin:$OLD_PATH
    export CC=$PETSC_DIR/$build/bin/mpicc
    if [ $build == "linux-gnu-profile" ] ; then
        export CFLAGS="-fno-omit-frame-pointer -pg"
    else
        unset CFLAGS
    fi
    make clean && ./configure --enable-parallel --prefix=$PETSC_DIR/$build && make -j10 && make install
done
unset CFLAGS
export PATH=$OLD_PATH

# "ParMetis updated to 4.0.2 and split from Metis 5.0.2 which is now separate." on http://www.mcs.anl.gov/petsc/documentation/changes/33.html
# ParMETIS now requires METIS --download-parmetis=1
# METIS requires cmake

# As previous (3.2): this is dangerous!
cd ~/petsc-3.3-p5/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 && ./config/builder.py
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --with-debugging=0 && ./config/builder.py
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --CFLAGS="-fno-omit-frame-pointer -pg" -CXXFLAGS="-fno-omit-frame-pointer -pg" -LDFLAGS=-pg && ./config/builder.py

## PETSc 3.4 is used in multiple versions of Ubuntu including 14.04 LTS.  We therefore use this version for optional compilation with HYPRE.
## NOTE: Compilation with Hypre requires a Fortran compiler.  For Intel compilation it also specifically requires {{{ifort}}} since {{{icpc/gfortran}}} compilation of HDF5 dependency is buggy.
# As previous (3.2): this is dangerous!
cd ~/petsc-3.4.2/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=1 && ./config/builder.py
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=1 --with-debugging=0 && ./config/builder.py
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=1 --CFLAGS="-fno-omit-frame-pointer -pg" -CXXFLAGS="-fno-omit-frame-pointer -pg" -LDFLAGS=-pg && ./config/builder.py
# (See above) Remember that Intel compilers require 
# source /opt/intel/bin/compilervars.sh intel64 ; export INTEL_LICENSE_FILE="28519@flexlm.nsms.ox.ac.uk"
export PETSC_ARCH=linux-intel
./config/configure.py --with-cxx=icpc --with-cc=icc --with-fc=ifort --with-vendor-compiler=intel --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-fortran=1 && make all
export PETSC_ARCH=linux-intel-opt-mkl
./config/configure.py --with-cxx=icpc --with-cc=icc --with-fc=ifort --with-vendor-compiler=intel --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1  --download-hypre=1 --with-x=false  --with-debugging=0 -PETSC_ARCH=linux-intel-opt-mkl --with-clanguage=cxx --with-blas-lapack-dir=/opt/intel/composerxe/mkl/lib/intel64/ --with-fortran=1 && ./config/builder.py


cd ~/petsc-3.5.2/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --with-debugging=0 && make all
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --CFLAGS="-fno-omit-frame-pointer -pg" -CXXFLAGS="-fno-omit-frame-pointer -pg" -LDFLAGS=-pg && make all


cd ~/petsc-3.6.1/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 && make all
export PETSC_ARCH=linux-gnu-opt
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --with-debugging=0 && make all
export PETSC_ARCH=linux-gnu-profile
./config/configure.py --with-make-np=10 --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --with-fortran=0 --CFLAGS="-fno-omit-frame-pointer -pg" -CXXFLAGS="-fno-omit-frame-pointer -pg" -LDFLAGS=-pg && make all


# VTK; needs recent CMake to build!
cd ~/src/cmake-2.8.12.2/
./bootstrap --prefix=$HOME/cmake --parallel=4 && make -j10 && make install
cd ~/bin
for f in ~/cmake/bin/*; do ln -s $f; done
# Note cmake calls below rely on defaults VTK_BUILD_ALL_MODULES=OFF, BUILD_SHARED_LIBS=ON
# 5.10
mkdir ~/src/vtk-build-5.10
cd ~/src/vtk-build-5.10
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-5.10 ../VTK5.10.1 && make -j10 && make install
# 6.0
mkdir ~/src/vtk-build-6.0
cd ~/src/vtk-build-6.0
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-6.0 ../VTK6.0.0 && make -j10 && make install
# 6.1
mkdir ~/src/vtk-build-6.1
cd ~/src/vtk-build-6.1
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-6.1 ../VTK-6.1.0 && make -j10 && make install


# SCons
cd ~/src/scons-2.4.0
python setup.py install --prefix=$HOME --no-scons-script
# Run it with scons-2.4.0, not scons

Hostconfig configuration

import glob
import os

petsc_2_2_path = '../../../petsc-2.2.1/'
petsc_2_3_path = '../../../petsc-2.3.2-p4/'
petsc_3_0_path = '../../../petsc-3.0.0-p12/'
petsc_build_name = 'linux-gnu'
petsc_build_name_profile = 'linux-gnu-profile'
petsc_build_name_optimized = 'linux-gnu-opt'
petsc_build_name_production = 'linux-intel-opt-mkl'
parmetis_path = '../../../ParMetis-3.1/'

intel_path='/opt/intel/composerxe'
icpc = 'icpc'

other_includepaths = ['../../../xsd-3.2.0-x86_64-linux-gnu/libxsd',
                      '../../../hdf5/include',
                      parmetis_path]

other_libpaths = [os.path.join(petsc_2_3_path, 'externalpackages/f2cblaslapack/linux-gnu/'),  
                  '../../../hdf5/lib',
                  parmetis_path]

blas_lapack = ['f2clapack', 'f2cblas']
blas_lapack_production = ['mkl_lapack', 'mkl', 'svml']
other_libraries = ['boost_serialization', 'boost_filesystem', 'xerces-c', 'hdf5', 'z', 'parmetis', 'metis']

ccflags = ''
ldflags = ''

tools = {'texttest': '../../../texttest-3.19/source/bin/texttest.py',
         'xsd': '../../../xsd-3.2.0-x86_64-linux-gnu/bin/xsd',
         'mpicxx': 'mpicxx',
         'mpirun': 'mpirun'}

def Configure(prefs, build):
    """Allow the user to specify which version of various libraries we're using."""
    # PETSc
    global petsc_path
    global petsc_2_3_path
    external_packages = 'externalpackages'
    # We default to PETSc 3 (see hostconfig.py) if present for this user
    if os.path.isdir(petsc_3_0_path):
        prefs['petsc'] = prefs.get('petsc', '3.0')
    else:
        prefs['petsc'] = prefs.get('petsc', '2.3')

    if prefs['petsc'] == '3.4':
        petsc_path = '/home/lofty/petsc-3.4.2'
    elif prefs['petsc'] == '3.3':
        petsc_path = '/home/lofty/petsc-3.3-p5'
    elif prefs['petsc'] == '3.2':
        petsc_path = '/home/lofty/petsc-3.2-p7'
    elif prefs['petsc'] == '3.1':
        petsc_path = '/home/lofty/petsc-3.1-p8'
    elif prefs['petsc'] == '3.0':
        petsc_path = petsc_3_0_path
    elif prefs['petsc'] == '2.3.3':
        petsc_2_3_path = '/home/lofty/petsc-2.3.3-p15/' #For testing SUBMINOR=3
        petsc_path = petsc_2_3_path
    elif prefs['petsc'] == '2.3':
        petsc_path = petsc_2_3_path
    elif prefs['petsc'] == '2.2':
        petsc_path = petsc_2_2_path
        external_packages = 'packages'
    else:
        raise ValueError('Unsupported PETSc version "%s" requested' % prefs['petsc'])
    if build.is_optimised:
        build_name = petsc_build_name_optimized
    else:
        build_name = petsc_build_name
    other_libpaths[0] = os.path.join(petsc_path, external_packages, 'f2cblaslapack', build_name)
    # Boost
    prefs['boost'] = prefs.get('boost', '1.40') # 1.40 is installed system-wide
    for ver in ['1.37', '1.42', '1.46.1', '1.48', '1.49', '1.51', '1.53', '1.54', '1.55']:
        if prefs['boost'] == ver:
            AddBoost('/home/lofty/boost_' + ver.replace('.', '_'), prefs['boost'])
            break
    else:
        if prefs['boost'] != '1.40':
            raise ValueError('Unsupported Boost version "%s" requested' % prefs['boost'])
    # HDF5
    prefs['hdf5'] = prefs.get('hdf5', '1.6')
    if prefs['hdf5'] == '1.8':
        AddHdf5('/home/lofty/hdf5_1_8_9/')
    elif prefs['hdf5'] == '1.6':
        AddHdf5('../../../hdf5/')
    else:
        raise ValueError('Unsupported HDF5 version "%s" requested' % prefs['hdf5'])
    # Xerces
    prefs['xerces'] = prefs.get('xerces', '3.1')
    if prefs['xerces'] == '2.8':
        AddXerces('/home/lofty/xercesc_2_8')
    # XSD
    prefs['xsd'] = prefs.get('xsd', '3.2')
    if prefs['xsd'] == '4.0':
        AddXsd('../../../xsd-4.0.0-x86_64-linux-gnu')
    elif prefs['xsd'] == '3.3':
        AddXsd('../../../xsd-3.3.0-x86_64-linux-gnu')
    elif prefs['xsd'] == '3.2':
        AddXsd('../../../xsd-3.2.0-x86_64-linux-gnu')
    elif prefs['xsd'] == '3.1':
        AddXsd('../../../xsd-3.1.0-x86_64-linux-gnu')
    elif prefs['xsd'] == '2.3':
        AddXsd('../../../xsd-2.3.1-x86_64-linux-gnu')
    else:
        raise ValueError('Unsupported XSD version "%s" requested' % prefs['xsd'])
    # Parmetis.  We don't switch the libraries explicitly for this, since Parmetis 4 is obtained via PETSc 3.3.
    # Instead we remove the version 3 includes if version 4 is requested.
    if 'parmetis' in prefs:
        global ccflags
        parmetis = prefs['parmetis']
        ccflags += ' -DCHASTE_PARMETIS_REQUIRED=' + str(parmetis)
        petsc_ver = map(int, prefs['petsc'].split('.')[:2])
        if parmetis == '3' and petsc_ver >= [3, 3]:
            raise ValueError('You cannot use both ParMETIS 3 and PETSc >= 3.3')
        if parmetis == '4':
            if petsc_ver < [3, 3]:
                raise ValueError('To use ParMETIS 4 you must install it using a recent PETSc (>= 3.3)')
            RemoveFromPath(other_includepaths, parmetis_path)
            RemoveFromPath(other_libpaths, parmetis_path)
    # Optional libraries
    global use_cvode
    global use_vtk
    global use_adaptivity
    use_cvode = int(prefs.get('use-cvode', 1))
    if use_cvode:
        prefs['cvode'] = prefs.get('cvode', '2.5')
        if prefs['cvode'] == '2.5':
            cvode_path = '../../../cvode'
        elif prefs['cvode'] == '2.6':
            cvode_path = '/home/lofty/cvode_2_6'
        elif prefs['cvode'] == '2.7':
            cvode_path = '/home/lofty/cvode_2_7'
        else:
            raise ValueError('Unsupported CVODE version "%s" requested' % prefs['cvode'])
        other_includepaths.append(os.path.join(cvode_path, 'include'))
        DetermineCvodeVersion(other_includepaths[-1])
        other_libpaths.append(os.path.join(cvode_path, 'lib'))
        other_libraries.extend(['sundials_cvode', 'sundials_nvecserial'])
    use_vtk = int(prefs.get('use-vtk', 1))
    # VTK is required for adaptivity to work, so if vtk was explicitly
    # turned off, turn off adaptivity too.
    use_adaptivity = int(prefs.get('use-adaptivity', 1)) and use_vtk
    # Todo #2367 - give a warning if adaptivity is requested, because it is no longer supported.
    # This has to come after the 'if use_adaptivity' block, because the libraries there depend on these
    if use_vtk:
        prefs['vtk'] = prefs.get('vtk', '5')
        if prefs['vtk'] == '6.1':
            other_includepaths.append('/home/lofty/vtk-6.1/include/vtk-6.1')
            other_libpaths.append('/home/lofty/vtk-6.1/lib')
            other_libraries.extend(['vtkCommonCore-6.1','vtkCommonDataModel-6.1','vtkIOXML-6.1','vtkCommonExecutionModel-6.1','vtkFiltersCore-6.1','libvtkFiltersGeometry-6.1'])
        elif prefs['vtk'] == '6.0':
            other_includepaths.append('/home/lofty/vtk-6.0/include/vtk-6.0')
            other_libpaths.append('/home/lofty/vtk-6.0/lib')
            other_libraries.extend(['vtkCommonCore-6.0','vtkCommonDataModel-6.0','vtkIOXML-6.0','vtkCommonExecutionModel-6.0','vtkFiltersCore-6.0','libvtkFiltersGeometry-6.0'])
        elif prefs['vtk'] == '5.10':
            other_includepaths.append('/home/lofty/vtk-5.10/include/vtk-5.10')
            other_libpaths.append('/home/lofty/vtk-5.10/lib/vtk-5.10')
            other_libraries.extend(['vtkGraphics','vtkFiltering','vtkIO','vtkCommon', 'vtksys', 'vtkexpat', 'vtkzlib'])
        else:
            vtk_include_path = filter(os.path.isdir, glob.glob('/usr/include/vtk-5*'))
            if len(vtk_include_path) != 1:
                raise ValueError("No or multiple system headers for VTK 5 found")
            vtk_version = float(vtk_include_path[0].split('-')[1])
            other_includepaths.append(vtk_include_path[0])
            other_libraries.extend(['vtkIO','vtkGraphics','vtkCommon', 'z'])
            if vtk_version >= 5.6:
                other_libraries.append('vtkFiltering')