Installing Chaste on Oxford University Computing Laboratory machines

Last updated September 2013 for Fedora 18.

Where to install

We will install everything to /home/scratch/ as this is a local drive with plenty of space. Make a chaste-libs folder and set its path as an environment variable:

mkdir /home/scratch/chaste-libs
export base='/home/scratch/chaste-libs'

ccache directory

By default, ccache is installed and the directory is set to ~/.ccache. As a network location this is very slow! Enter the following lines into a terminal to make a new folder in /home/scratch, delete ~/.ccache if it exists, and redirect it to the new one using a symbolic link.

mkdir /home/scratch/.ccache
rm -rf ~/.ccache
ln -s /home/scratch/.ccache ~/.ccache

Also, you can add the following to the bottom of your ~/.bashrc to set the ccache directory explicitly:

export CCACHE_DIR=/home/scratch/.ccache

Note that this will cause havoc if you log in to a machine which doesn't have a /home/scratch directory.

Fedora packages

A large number of dependencies are available as packages. Some on this list will already be installed.

sudo yum install scons gcc-gfortran gcc-c++ boost-devel boost-serialization valgrind xerces-c-devel xsd subversion eclipse-subclipse eclipse-cdt eclipse-pydev subversion-javahl vtk-devel python-lxml python-amara python-rdflib python-dateutil

PETSc

The following are slightly modified from the PETSc install instructions in the main install guide. Other versions of PETSc should be very similar, but check compatibility first (InstallGuides/DependencyVersions).

cd $base
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.4.5.tar.gz
tar xzvf petsc-lite-3.4.5.tar.gz
rm -f petsc-lite-3.4.5.tar.gz
cd petsc-3.4.5/

export PETSC_DIR=`pwd`
export PETSC_ARCH=linux-gnu
./config/configure.py --download-fblaslapack --download-mpich --download-hdf5 --download-parmetis --download-metis --download-sundials --download-hypre --with-x=false --with-clanguage=cxx --with-shared-libraries
make all

We recommend you also make an optimised build.

export PETSC_ARCH=linux-gnu-opt
./config/configure.py --download-fblaslapack --download-mpich --download-hdf5 --download-parmetis --download-metis --download-sundials --download-hypre --with-x=false --with-clanguage=cxx --with-shared-libraries --CXXOPTFLAGS="-O3" --COPTFLAGS="-O3" --with-debugging=0
make all

Eclipse

When you first run eclipse it will ask you to set the workspace location. Set it to /home/scratch/workspace and let this be the default every time. On the splash screen go straight to the "workbench" by clicking the button at the top-right.

Set preferences:

  • Unclick Project -> Build Automatically
  • In Window->Preferences:
    • Go to General->Editors->Text Editors and select "Insert spaces for tabs". Please make sure you do this'''
    • Under C/C++->Code Style->Formatter, select 'BSD/Allman', then Edit... and set the Tab policy to 'Spaces only'. Please make sure you do this''' Alter the name of the Profile (e.g.g to "BSD/Allman Chaste") in order to save it.
    • Other options under C/C++->Editor are worth browsing through.

Set up Chaste

  • Use these guides to connect Eclipse to the subversion repository and checkout the source code: ChasteGuides/AccessCodeRepository
  • You may need to make changes to the hostconfig system if you used different versions or paths to the above. By default computers in the department will automatically pick up python/hostconfig/machines/comlab.py, so if you need to make changes either edit this file, or copy it to python/hostconfig/local.py and make changes there.
  • Very often, new users are unable to access the /python/hostconfig/machines directory to get the machines file. If this is you, copy and paste the following into python/hostconfig/local.py manually:
    # Configuration for machines following Comlab install guide located at
    # https://chaste.cs.ox.ac.uk/trac/wiki/InstallGuides/Comlab
    
    """Copyright (c) 2005-2014, University of Oxford.
    All rights reserved.
    
    University of Oxford means the Chancellor, Masters and Scholars of the
    University of Oxford, having an administrative office at Wellington
    Square, Oxford OX1 2JD, UK.
    
    This file is part of Chaste.
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
     * Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.
     * Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
     * Neither the name of the University of Oxford nor the names of its
       contributors may be used to endorse or promote products derived from this
       software without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
    GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    """
    
    import os
    
    chaste_libs = '/home/scratch/chaste-libs'
    petsc_path = os.path.join(chaste_libs, 'petsc-3.4.5')
    petsc_build_name = 'linux-gnu'
    petsc_build_name_profile = 'linux-gnu'
    petsc_build_name_optimized = 'linux-gnu-opt'
    
    use_cvode = True
    # Use system VTK
    use_vtk = True
    other_includepaths = ['/usr/include/vtk/']
    other_libpaths = ['/usr/lib64/vtk/']
    
    blas_lapack = ['flapack', 'fblas']
    
    other_libraries = ['boost_system', 'boost_serialization', 'boost_filesystem', 'xerces-c', 'hdf5', 'z', 'parmetis', 'metis']
    other_libraries.append(['vtkCommonCore','vtkCommonDataModel','vtkIOXML','vtkCommonExecutionModel','vtkFiltersCore','vtkFiltersGeometry'])
    other_libraries.append(['sundials_cvode', 'sundials_nvecserial'])
    
    tools = {'xsd': 'xsdcxx'}
    
    def Configure(prefs, build):
        DetermineCvodeVersion(os.path.join(petsc_path,petsc_build_name,'include'))
    
    
  • Happy Chasting!