Current Dependency Configurations in Portability Builds

See also MachineNames#DependencyVersions for the defaults on the different build machines.

Mon Tue Wed Thu Fri Sat Sun
Boost 1.61 1.69 1.58 1.60 1.66 1.62 1.67
cvode 2.7.0 2.8.0 none 3.1.0 4.1.0 2.7.0 2.9.0
HDF5 1.8.11 1.8.13 1.8.15 1.8.17 1.8.16 1.8.20 1.10.2
PETSc 3.5.4 3.5.4 3.6.4 3.6.4 3.7.6 3.8.4 3.9.2
VTK 5.10 none 6.1 6.2 6.3 7.1 8.1
Xerces 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.1
XSD 3.3 3.3 3.3 4.0.0 4.0.0 4.0.0 4.0.0
Notes Oldest1 Newest

1 Oldest versions tested in the portability rotation. Some yet-older versions may be tested in continuous and nightly builds.

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 - see InstallGuides/DependencyVersions. 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/dizzy.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"

Bundling PETSc and HDF5

Note that in June 2017, we decided to "bundle" PETSc and HDF5 on Lofty such that there is an installation for each pairwise combination we want to test against. This is made straightforward because PETSc allows an HDF5 version to be specified during configuration. The benefit of this is much-increased compatibility, particularly with MPI, while the downside is an inability to specify arbitrary combinations. See later for the script to install the combinations.

Main installation script

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://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.7.2.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://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.64.0/boost_1_64_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.65.1/boost_1_65_1.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.67.0/boost_1_67_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.68.0/boost_1_68_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.69.0/boost_1_69_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.70.0/boost_1_70_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://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.16/src/hdf5-1.8.16.tar.bz2
wget http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.17/src/hdf5-1.8.17.tar.bz2
wget http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.bz2

# The mirror site only seems to retain the most recent release, but the archive.apache.org seems to have the lot
# 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://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.bz2
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.3.tar.bz2
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.4.tar.bz2
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.0.tar.bz2
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.1.tar.bz2
wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.2.tar.bz2

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 https://chaste.cs.ox.ac.uk/public/deps/cvode-2.9.0.tar.gz
wget https://chaste.cs.ox.ac.uk/public/deps/cvode-3.1.0.tar.gz
wget https://computing.llnl.gov/projects/sundials/download/cvode-4.1.0.tar.gz
wget https://computing.llnl.gov/projects/sundials/download/cvode-5.0.0-dev.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://www.vtk.org/files/release/6.2/VTK-6.2.0.tar.gz
wget https://github.com/Kitware/VTK/archive/v6.3.0.tar.gz
wget https://github.com/Kitware/VTK/archive/v7.0.0.tar.gz
wget https://github.com/Kitware/VTK/archive/v7.1.1.tar.gz
wget https://github.com/Kitware/VTK/archive/v8.0.1.tar.gz
wget https://github.com/Kitware/VTK/archive/v8.1.1.tar.gz
wget https://github.com/Kitware/VTK/archive/v8.2.0.tar.gz
wget https://cmake.org/files/v3.9/cmake-3.9.1.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

# CMake: cmake > 3.3 was needed to build VTK 8.0, and you can use an older Cmake to build a new one
cd ~/src/cmake-3.9.1
cmake -DCMAKE_INSTALL_PREFIX=$HOME/cmake-3.9 . && make -j10 && make install


# 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
cd ~/src/cvode-2.9.0/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/robert/cvode_2_9 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DEXAMPLES_ENABLE=OFF ..
make && make install
cd ~/src/cvode-3.1.0/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/robert/cvode_3_1 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DEXAMPLES_ENABLE=OFF ..
make && make install
cd ~/src/cvode-4.1.0/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/robert/cvode_4_1 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DEXAMPLES_ENABLE=OFF ..
make && make install
cd ~/src/cvode-5.0.0-dev.1/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/robert/cvode_5_0 -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  : Note that all versions of Boost should be compiled with (at least) C++11.
# This can be done explicitly (e.g. ./b2 -j 10 cxxflags="-std=c++11" install), but 
# is now unnecessary as newer GCC use -std=gnu++14 by default
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
cd ~/src/boost_1_61_0/
./bootstrap.sh --prefix=$HOME/boost_1_61 && ./b2 -j 10 install
cd ~/src/boost_1_62_0/
./bootstrap.sh --prefix=$HOME/boost_1_62 && ./b2 -j 10 install
cd ~/src/boost_1_63_0/
./bootstrap.sh --prefix=$HOME/boost_1_63 && ./b2 -j 10 install

cd ~/src/boost_1_64_0/
./bootstrap.sh --prefix=$HOME/boost_1_64 && ./b2 -j 10 install
# Post-installation fix of this Boost (https://github.com/boostorg/serialization/commit/1d86261581230e2dc5d617a9b16287d326f3e229)
sed -i.bak '25i\#include <boost/serialization/array_wrapper.hpp>' $HOME/boost_1_64/include/boost/serialization/array.hpp

cd ~/src/boost_1_65_1/
./bootstrap.sh --prefix=$HOME/boost_1_65 && ./b2 -j 10 install
cd ~/src/boost_1_66_0/
./bootstrap.sh --prefix=$HOME/boost_1_66 && ./b2 -j 10 install
cd ~/src/boost_1_67_0/
./bootstrap.sh --prefix=$HOME/boost_1_67 && ./b2 -j 10 install
cd ~/src/boost_1_68_0/
./bootstrap.sh --prefix=$HOME/boost_1_68 && ./b2 -j 10 install
cd ~/src/boost_1_69_0/
./bootstrap.sh --prefix=$HOME/boost_1_69 && ./b2 -j 10 install
cd ~/src/boost_1_70_0/
./bootstrap.sh --prefix=$HOME/boost_1_70 && ./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 the MPICH which is on Ubuntu 14.04 by default.  Installed inside PETSc (see below), and later versions installed after PETSc.
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

cd ~/src/xerces-c-3.1.2
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_1_2 && make && make install
cd ~/src/xerces-c-3.1.3
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_1_3 && make && make install
cd ~/src/xerces-c-3.1.4
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_1_4 && make && make install
cd ~/src/xerces-c-3.2.0
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_2_0 && make && make install
cd ~/src/xerces-c-3.2.1
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_2_1 && make && make install
cd ~/src/xerces-c-3.2.2
./configure --enable-netaccessor-socket --prefix=${HOME}/xercesc_3_2_2 && 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 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries && 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 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --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 --download-hypre=1 --with-x=false --with-clanguage=cxx --with-shared-libraries --CFLAGS="-fno-omit-frame-pointer -pg" --CXX_CXXFLAGS="-fno-omit-frame-pointer -pg" --LDFLAGS=-pg && make all


cd ~/petsc-3.6.1/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./configure --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 && make all
export PETSC_ARCH=linux-gnu-opt
./configure --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-debugging=0 && make all
export PETSC_ARCH=linux-gnu-profile
./configure --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 --CFLAGS="-fno-omit-frame-pointer -pg" --CXX_CXXFLAGS="-fno-omit-frame-pointer -pg" --LDFLAGS=-pg && make all


cd ~/petsc-3.7.2/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./configure --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-shared-libraries && make all
export PETSC_ARCH=linux-gnu-opt
./configure --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-shared-libraries --with-debugging=0 && make all
export PETSC_ARCH=linux-gnu-profile
./configure --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-shared-libraries --CFLAGS="-fno-omit-frame-pointer -pg" --CXX_CXXFLAGS="-fno-omit-frame-pointer -pg" --LDFLAGS=-pg && make all
# (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
./configure --with-make-np=5 --with-cxx=icpc --with-cc=icc --with-fc=ifort --with-vendor-compilers=intel --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1 --download-hypre=1 --with-x=false && make all
export PETSC_ARCH=linux-intel-opt-mkl
./configure --with-make-np=5 --with-cxx=icpc --with-cc=icc --with-fc=ifort --with-vendor-compilers=intel --download-mpich=1 --download-hdf5=1 --download-parmetis=1 --download-metis=1  --download-hypre=1 --with-x=false --with-debugging=0 --with-blas-lapack-dir=/opt/intel/composerxe/mkl/lib/intel64/ && make all


# Notes for future PETSc: check the names of options rather than assuming they're the same!
# Consider setting COPTFLAGS and CXXOPTFLAGS



# Build HDF5 1.8.16+ using the MPICH from petsc-3.7.2 (above).  This gets around the incompatible default MPICH on Ubuntu 14.04, but is unnecessary on Ubuntu 16.04.

export OLD_PATH=$PATH
export PATH=$HOME/petsc-3.7.2/linux-gnu-opt/bin:${PATH}
export CC=$HOME/petsc-3.7.2/linux-gnu-opt/bin/mpicc

cd ~/src/hdf5-1.8.16
./configure --enable-shared --enable-parallel --prefix=${HOME}/hdf5_1_8_16 && make -j10 && make install
cd ~/src/hdf5-1.8.17
./configure --enable-shared --enable-parallel --prefix=${HOME}/hdf5_1_8_17 && make -j10 && make install
cd ~/src/hdf5-1.10.0-patch1
./configure --enable-shared --enable-parallel --prefix=${HOME}/hdf5_1_10_0-p1 && make -j10 && make install

export PATH=$OLD_PATH
unset CC


# 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: note BUILD_SHARED_LIBS seems to default to OFF for this build, so flag is explicitly added
# From 6.2 it seems to be necessary to specify CMAKE_INSTALL_RPATH, or certain .so files will not be found.  See #2892.

mkdir ~/src/vtk-build-5.10
cd ~/src/vtk-build-5.10
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$HOME/vtk-5.10 -DCMAKE_INSTALL_RPATH=$HOME/vtk-5.10/lib/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 -DCMAKE_INSTALL_RPATH=$HOME/vtk-6.1/lib ../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 -DCMAKE_INSTALL_RPATH=$HOME/vtk-6.1/lib ../VTK-6.1.0 && make -j10 && make install
# 6.2
mkdir ~/src/vtk-build-6.2
cd ~/src/vtk-build-6.2
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-6.2 -DCMAKE_INSTALL_RPATH=$HOME/vtk-6.2/lib ../VTK-6.2.0 && make -j10 && make install
# 6.3
mkdir ~/src/vtk-build-6.3
cd ~/src/vtk-build-6.3
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-6.3 -DCMAKE_INSTALL_RPATH=$HOME/vtk-6.3/lib ../VTK-6.3.0 && make -j10 && make install
# 7.0
mkdir ~/src/vtk-build-7.0
cd ~/src/vtk-build-7.0
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-7.0 -DCMAKE_INSTALL_RPATH=$HOME/vtk-7.0/lib ../VTK-7.0.0 && make -j10 && make install
# 7.1
mkdir ~/src/vtk-build-7.1
cd ~/src/vtk-build-7.1
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-7.1 -DCMAKE_INSTALL_RPATH=$HOME/vtk-7.1/lib ../VTK-7.1.1 && make -j10 && make install
# 8.0 (note - this requires a newer CMake than the system (2.8.12)
mkdir ~/src/vtk-build-8.0
cd ~/src/vtk-build-8.0
$HOME/cmake-3.9/bin/cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-8.0 -DCMAKE_INSTALL_RPATH=$HOME/vtk-8.0/lib ../VTK-8.0.1 && make -j10 && make install
# 8.1 (note - this requires a newer CMake than the system (2.8.12)
mkdir ~/src/vtk-build-8.1
cd ~/src/vtk-build-8.1
$HOME/cmake-3.9/bin/cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-8.1 -DCMAKE_INSTALL_RPATH=$HOME/vtk-8.1/lib ../VTK-8.1.1 && make -j10 && make install

###### 8.2 and newer installed since lofty upgrade to Ubuntu 18.04
# 8.2
mkdir ~/src/vtk-build-8.2 && cd ~/src/vtk-build-8.2
cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-8.2 -DCMAKE_INSTALL_RPATH=$HOME/vtk-8.2/lib ../VTK-8.2.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

Installing "bundled" combinations of PETSc and HDF5

# Get the PETSc versions
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.6.4.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.7.7.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.8.4.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.9.4.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.10.5.tar.gz
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.11.1.tar.gz


# Define variables for downloading dependencies
MPICH_3_3=https://www.mpich.org/static/downloads/3.3/mpich-3.3.tar.gz
HDF5_8_16=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.16/src/hdf5-1.8.16.tar.bz2
HDF5_8_21=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.21/src/hdf5-1.8.21.tar.bz2
HDF5_10_0=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.bz2
HDF5_10_1=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.1/src/hdf5-1.10.1.tar.bz2
HDF5_10_2=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.2/src/hdf5-1.10.2.tar.bz2
HDF5_10_3=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.bz2
HDF5_10_4=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.bz2
HDF5_10_5=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.bz2

# Extract PETSc and move to desired directories

# Ubuntu 16.04 default versions
tar -zxf petsc-lite-3.6.4.tar.gz
mv petsc-3.6.4 ~/petsc-3.6.4_h5-1_8_16

# Ubuntu 18.04 default versions
tar -zxf petsc-lite-3.7.7.tar.gz
mv petsc-3.7.7 ~/petsc-3.7.7_h5-1_10_0

tar -zxf petsc-lite-3.8.4.tar.gz
mv petsc-3.8.4 ~/petsc-3.8.4_h5-1_8_21

tar -zxf petsc-lite-3.9.4.tar.gz
mv petsc-3.9.4 ~/petsc-3.9.4_h5-1_10_3

tar -zxf petsc-lite-3.10.5.tar.gz
mv petsc-3.10.5 ~/petsc-3.10.5_h5-1_10_4

tar -zxf petsc-lite-3.11.1.tar.gz
mv petsc-3.11.1 ~/petsc-3.11.1_h5-1_10_5


cd ~/petsc-3.6.4_h5-1_8_16 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_8_16 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_8_16 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

cd ~/petsc-3.7.7_h5-1_10_0 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_0 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_0 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

cd ~/petsc-3.8.4_h5-1_8_21 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_8_21 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_8_21 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

cd ~/petsc-3.9.4_h5-1_10_3 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_3 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_3 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

cd ~/petsc-3.10.5_h5-1_10_4 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_4 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_4 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

cd ~/petsc-3.11.1_h5-1_10_5 && export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-Og --CXXOPTFLAGS=-Og --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_5 --download-parmetis=1 --download-metis=1 --with-shared-libraries && make all test
export PETSC_ARCH=linux-gnu-opt && ./configure --with-make-np=10 --with-cc=gcc --with-cxx=g++ --with-fc=0 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-x=false --with-ssl=false --download-f2cblaslapack=1 --download-mpich=$MPICH_3_3 --download-hdf5=$HDF5_10_5 --download-parmetis=1 --download-metis=1 --with-shared-libraries --with-debugging=0 && make all test

Hostconfig configuration

import glob
import os
import subprocess

# Check which version of Ubuntu this is
fp = open('/etc/issue')
ubuntu_ver = fp.read().split()[1]
fp.close()
ubuntu_ver = map(int, ubuntu_ver.split('.')[0:2]) 

# We've installed PETSc ourselves, and got it to install OpenMPI, ParMETIS, and HDF5
petsc_ver = 3.1
petsc_path = '/home/bob/petsc-3.1-p8/'
petsc_build_name = 'linux-gnu'
petsc_build_name_profile = 'linux-gnu-profile'
petsc_build_name_optimized = 'linux-gnu-opt'

# Intel paths etc.
petsc_build_name_production = 'linux-intel-opt-mkl'
intel_path = '/opt/intel'
blas_lapack_production = ['mkl_intel_lp64', 'mkl_core', 'mkl_sequential']
other_libpaths = [os.path.join(petsc_path, 'external_packages', 'f2cblaslapack', petsc_build_name), '/opt/intel/composerxe/mkl/lib/intel64']

# Includes should all be under /usr/include or PETSc
other_includepaths = []

# Default extra compiler & linker flags
ccflags = ''
ldflags = ''

# Basic boost libraries we use
boost_libs = ['boost_serialization', 'boost_filesystem']

# Add this to enable compression of boost archives
#boost_libs.append('boost_iostreams')
# Add an extra flag to tell project that boost_iostreams is available.
# ccflags+=' -DCHASTE_BOOST_IOSTREAMS '

if ubuntu_ver >= [10,10]:
    boost_libs.append('boost_system')
if ubuntu_ver >= [9,10] and ubuntu_ver <= [12,10]:
    boost_libs = map(lambda l: l+'-mt', boost_libs)

# Determine installed version of Xerces
try:
    xerces3 = bool(subprocess.check_output(['dpkg-query', '-W', '-f', '${version}', 'libxerces-c-dev'], stderr=subprocess.STDOUT))
except:
    xerces3 = False
if xerces3:
    # Xerces 3.1
    xerces_lib = 'xerces-c-3.1'
else:
    # Xerces 2.8
    xerces_lib = 'xerces-c'

other_libraries = boost_libs + [xerces_lib,
                                'hdf5', 'z',
                                'parmetis', 'metis']

def MaybeAdd(libname, libpath, incpath):
    found = False
    if os.path.isdir(libpath) and os.path.isdir(incpath):
        other_libraries.append(libname)
        other_libpaths.append(libpath)
        other_includepaths.append(incpath)
        found = True
    return found

# Use R if it's available
if (MaybeAdd('R', '/usr/lib/R', '/usr/share/R/include/') and
    MaybeAdd('Rcpp', '/usr/local/lib/R/site-library/Rcpp/lib', '/usr/local/lib/R/site-library/Rcpp/include/') and
    MaybeAdd('RInside', '/usr/local/lib/R/site-library/RInside/lib', '/usr/local/lib/R/site-library/RInside/include/')):
    # Add an extra flag to tell Gary's project that R is available.
    ccflags+=' -DCHASTE_R '

# Figure out which lapack/blas packages are actually installed!
if os.path.exists('/usr/lib/liblapack-3.so'):
    blas_lapack = ['lapack-3', 'blas-3']
else:
    blas_lapack = ['lapack', 'blas']

tools = {'texttest': '../../../texttest-3.19/source/bin/texttest.py',
         'xsd': '/usr/bin/xsdcxx'}

if os.path.exists('/usr/bin/google-pprof'):
    tools['pprof'] = '/usr/bin/google-pprof'

do_inf_tests = 1

def Configure(prefs, build):
    """Allow the user to specify which version of various libraries we're using."""
    import socket
    if socket.getfqdn().startswith('scoop'):
        BASE = '/home/lofty/'
    else:
        BASE = '/home/robert/'

    if build.CompilerType() == 'intel':
        # Might need a different PETSc build name!
        global petsc_build_name, petsc_build_name_optimized
        petsc_build_name = 'linux-intel'
        petsc_build_name_optimized = 'linux-intel'

    # PETSc
    global petsc_path
    global petsc_3_0_path
    global petsc_2_3_path
    external_packages = 'externalpackages'
    # We default to PETSc 3.1 as above (see hostconfig.py) if present for this user
    prefs['petsc'] = prefs.get('petsc', '3.1')
    petsc_ver = map(int, prefs['petsc'].split('.')[:2])

    # Note: these paths assume that PETSc 3.2 and above have their own MPI, 3.1 was built with the system MPI, and earlier versions used BASE/mpi
    if prefs['petsc'] == '3.6':
        petsc_path = BASE+'petsc-3.6.1'
    elif prefs['petsc'] == '3.5':
        petsc_path = BASE+'petsc-3.5.2'
    elif prefs['petsc'] == '3.4':
        petsc_path = BASE+'petsc-3.4.2'
    elif prefs['petsc'] == '3.3':
        petsc_path = BASE+'petsc-3.3-p5'
    elif prefs['petsc'] == '3.2':
        petsc_path = BASE+'petsc-3.2-p7'
    elif prefs['petsc'] == '3.1':
        assert(petsc_path == '/home/bob/petsc-3.1-p8/')
    elif prefs['petsc'] == '3.0':
        petsc_3_0_path = BASE+'petsc-3.0.0-p12'
        petsc_path = petsc_3_0_path
        tools['mpicxx'] = BASE+'mpi/bin/mpicxx'
        tools['mpirun'] = BASE+'mpi/bin/mpirun'
    elif prefs['petsc'] == '2.3.3':
        petsc_2_3_path = BASE+'petsc-2.3.3-p15' #For testing SUBMINOR=3
        petsc_path = petsc_2_3_path
        tools['mpicxx'] = BASE+'mpi/bin/mpicxx'
        tools['mpirun'] = BASE+'mpi/bin/mpirun'
    elif prefs['petsc'] == '2.3':
        petsc_2_3_path = BASE+'petsc-2.3.2-p4'
        petsc_path = petsc_2_3_path
        tools['mpicxx'] = BASE+'mpi/bin/mpicxx'
        tools['mpirun'] = BASE+'mpi/bin/mpirun'
    else:
        raise ValueError('Unsupported PETSc version "%s" requested' % prefs['petsc'])

    if petsc_ver >= [3,4]:
        # Add a path to the local version of h5dump for acceptance testing
        # h5dump should have the correct indentation (currently 1.8.10 or above) and the binary should match with any LD_LIBRARY_PATH .so files
        binpath = os.path.join(petsc_path, petsc_build_name, 'bin')
        assert os.path.isdir(binpath)
        os.environ['PATH'] = binpath + ':' + os.environ['PATH']

    if build.is_optimised:
        build_name = petsc_build_name_optimized
    else:
        build_name = petsc_build_name
    # This assumes that other_libpaths starts with a location (might be fake) to a PETSc external packages location
    assert 'f2cblaslapack' in other_libpaths[0]
    other_libpaths[0] = os.path.join(petsc_path, external_packages, 'f2cblaslapack', build_name)

    # Boost library version
    installed_boost = subprocess.check_output(['dpkg-query', '-W', '-f', '${version}', 'libboost-serialization-dev'], stderr=subprocess.STDOUT)[:4]
    prefs['boost'] = prefs.get('boost', installed_boost)
    if prefs['boost'] != installed_boost:
        boost_dir = BASE+'boost_' + prefs['boost'].replace('.', '_')
        if os.path.isdir(boost_dir):
            AddBoost(boost_dir, prefs['boost'], forceUseSystem=True)
        else:
            raise ValueError('Unsupported Boost version "%s" requested' % prefs['boost'])

    # HDF5.  Note that sometimes this is installed by PETSc, and so this setting will be ignored!
    if 'hdf5' in prefs:
        if prefs['hdf5'] == '1.8':
            AddHdf5(BASE+'hdf5_1_8_9/')
        elif prefs['hdf5'] == '1.8.13':
            assert prefs['petsc'] == '3.2', 'HDF5 1.8.13 is only available with PETSc 3.2'
        elif prefs['hdf5'] == '1.6':
            AddHdf5(BASE+'hdf5/')
        else:
            raise ValueError('Unsupported HDF5 version "%s" requested' % prefs['hdf5'])

    # Xerces
    if 'xerces' in prefs:
        if prefs['xerces'] == '2.8' and xerces3:
            AddXerces(BASE+'xercesc_2_8')
        elif prefs['xerces'] == '3.1' and not xerces3:
            AddXerces(BASE+'xercesc_3_1')

    # XSD
    #installed_xsd = subprocess.check_output(['dpkg-query', '-W', '-f', '${version}', 'xsdcxx'], stderr=subprocess.STDOUT)[:3]
    if 'xsd' in prefs:
        if prefs['xsd'] == '4.0':
            AddXsd(BASE+'xsd-4.0.0-x86_64-linux-gnu')
        elif prefs['xsd'] == '3.3':
            AddXsd(BASE+'xsd-3.3.0-x86_64-linux-gnu')
        elif prefs['xsd'] == '3.2':
            AddXsd(BASE+'xsd-3.2.0-x86_64-linux-gnu')
        elif prefs['xsd'] == '3.1':
            AddXsd(BASE+'xsd-3.1.0-x86_64-linux-gnu')
        elif prefs['xsd'] == '2.3':
            AddXsd(BASE+'xsd-2.3.1-x86_64-linux-gnu')
        else:
            raise ValueError('Unsupported XSD version "%s" requested' % prefs['xsd'])

    # Parmetis.  We often don't switch the libraries explicitly for this, since Parmetis 4 is obtained via PETSc 3.3, and Parmetis 3 by PETSc 3.1 & 3.2.
    # Instead we check that the requested PETSc version is suitable.
    if petsc_ver <= [3, 0]:
        prefs['parmetis'] = prefs.get('parmetis', '3')
    if 'parmetis' in prefs:
        global ccflags
        parmetis = prefs['parmetis']
        ccflags += ' -DCHASTE_PARMETIS_REQUIRED=' + str(parmetis)
        if parmetis == '3' and petsc_ver >= [3, 3]:
            raise ValueError('To use ParMETIS 2 you must install it using an older PETSc (<= 3.2)')
        if parmetis == '4' and petsc_ver < [3, 3]:
            raise ValueError('To use ParMETIS 4 you must install it using a recent PETSc (>= 3.3)')
        if parmetis == '3' and petsc_ver <= [3, 0]:
            other_includepaths.append(BASE+'ParMetis-3.1')
            other_libpaths.append(BASE+'ParMetis-3.1')

    # Determine the version of CVODE to be used
    global use_cvode
    use_cvode = int(prefs.get('use-cvode', 1))
    if use_cvode:
        if 'cvode' not in prefs:
            cvode_path = '/usr/' # Use the system installation
        elif prefs['cvode'] == '2.5':
            cvode_path = BASE+'cvode'
        elif prefs['cvode'] == '2.6':
            cvode_path = BASE+'cvode_2_6'
        elif prefs['cvode'] == '2.7':
                cvode_path = BASE+'cvode_2_7'
        elif prefs['cvode'] == '2.8':
            if os.path.exists('/opt/cvode-libs') and build.CompilerType() == 'intel':
                # CVODE 2.8.1 (Sundials 2.6.1) specially downloaded and compiled with intel optimisations on this machine,
                # these shared libraries link to intel libraries, so need to have intel paths set up to work...
                # N.B. we needed to hack the CMakeLists.txt slightly to get the version reported correctly - see #2479 for a copy.
                cvode_path = '/opt/cvode-libs'
            else:
                cvode_path = BASE+'cvode_2_8'
        else:
            raise ValueError('Unsupported CVODE version "%s" requested' % prefs['cvode'])
        cvode_inc = os.path.join(cvode_path, 'include')
        DetermineCvodeVersion(cvode_inc)
        if cvode_path != '/usr/':
            other_includepaths.append(cvode_inc)
            other_libpaths.append(os.path.join(cvode_path, 'lib'))
        other_libraries.extend(['sundials_cvode', 'sundials_nvecserial'])

    # Extra libraries for VTK output
    global use_vtk
    use_vtk = int(prefs.get('use-vtk', 1))
    if use_vtk:
        prefs['vtk'] = prefs.get('vtk', '5')
        if prefs['vtk'][0] == '6':
            vtk_ver = map(int, prefs['vtk'].split('.')[:2])
            subst = {'v': prefs['vtk']}
            other_includepaths.append(BASE+'vtk-%(v)s/include/vtk-%(v)s' % subst)
            other_libpaths.append(BASE+'vtk-%(v)s/lib' % subst)
            vtk_libs = ['CommonCore','CommonDataModel','IOXML','IOGeometry','CommonExecutionModel','FiltersCore','FiltersGeometry','FiltersModeling','FiltersSources']
            if vtk_ver >= [6,2]:
                vtk_libs[2:2] = ['IOParallelXML']
            vtk_libs = map(lambda l: 'vtk' + l + '-' + prefs['vtk'], vtk_libs)
            other_libraries.extend(vtk_libs)
        elif prefs['vtk'] == '5.10':
            other_includepaths.append(BASE+'vtk-5.10/include/vtk-5.10')
            other_libpaths.append(BASE+'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')

    # Check that adaptivity is NOT requested, as it is no longer supported (#2367)
    if int(prefs.get('use-adaptivity', 0)):
        raise ValueError('The adaptivity library is no longer supported (see ticket:2367)')

    # Support for GoogleProfile build
    if build.build_dir == 'google_profile':
        other_libraries.extend(['profiler'])