InstallGuides/TestingMultipleVersions

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/

# 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.3-p15.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-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://downloads.sourceforge.net/project/boost/boost/1.37.0/boost_1_37_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://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.9.tar.bz2
wget http://www.hdfgroup.org/ftp/HDF5/prev-releases/hdf5-1.6.10/src/hdf5-1.6.10.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/3.2/linux-gnu/x86_64/xsd-3.2.0-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/2.3/linux-gnu/x86_64/xsd-2.3.1-x86_64-linux-gnu.tar.bz2

wget https://computation.llnl.gov/casc/sundials/download/code/old/cvode-2.6.0.tar.gz
wget https://computation.llnl.gov/casc/sundials/download/code/old/cvode-2.5.0.tar.gz
wget https://computation.llnl.gov/casc/sundials/download/code/cvode-2.7.0.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

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/



# 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 && 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 && 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 && 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 userpc58 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\/lofty\/mpi\/bin\/mpicc/' Makefile.in.orig > Makefile.in 
make 


# Boost
cd ~/src/boost_1_37_0/
./configure --prefix=$HOME/boost_1_37 && make && make install
cd ~/src/boost_1_42_0/
./bootstrap.sh --prefix=$HOME/boost_1_42 && ./bjam install
cd ~/src/boost_1_46_1/
./bootstrap.sh --prefix=$HOME/boost_1_46_1 && ./bjam install
cd ~/src/boost_1_48_0/
./bootstrap.sh --prefix=$HOME/boost_1_48 && ./b2 install
cd ~/src/boost_1_49_0/
./bootstrap.sh --prefix=$HOME/boost_1_49 && ./b2 install
cd ~/src/boost_1_51_0/
./bootstrap.sh --prefix=$HOME/boost_1_51 && ./b2 install
cd ~/src/boost_1_53_0/
./bootstrap.sh --prefix=$HOME/boost_1_53 && ./b2 install
cd ~/src/boost_1_54_0/
./bootstrap.sh --prefix=$HOME/boost_1_54 && ./b2 install
cd ~/src/boost_1_55_0/
./bootstrap.sh --prefix=$HOME/boost_1_55 && ./b2 install


# HDF5
export PATH=${PATH}:${HOME}/mpi/bin
cd ~/src/hdf5-1.6.10/
export CC=mpicc 
./configure --enable-parallel --prefix=${HOME}/hdf5 && make && make install
cd ~/src/hdf5-1.8.9/
./configure --enable-parallel --prefix=${HOME}/hdf5_1_8_9 && 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 --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 --with-debugging=0 -PETSC_ARCH=linux-gnu-opt --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-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, but lofty will not use this...
# It seems to be working however...
cd ~/petsc-3.2-p7/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --download-f2cblaslapack=1 --download-mpich=1 --download-hdf5=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-hdf5=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-hdf5=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


# "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

# Note: this is dangerous!  Since PETSc has its own MPICH it needs its own HDF5, but lofty won't use this... 
# It seems to be working however...
cd ~/petsc-3.3-p5/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --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 --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 --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

# As previous (3.3): this is dangerous!
cd ~/petsc-3.4.2/
export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --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 --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 --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



# VTK; needs recent CMake to build!
cd ~/src/cmake-2.8.12.2/
./bootstrap --prefix=$HOME/cmake --parallel=4 && make && 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 -j4 && 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 -j4 && 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 -j4 && make install

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'])
    # XSD
    prefs['xsd'] = prefs.get('xsd', '3.2')
    if 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')