Chaste on Mountain Lion

Warning this currently experimental with OSX Mavericks let us know if you have issues.

Xcode

Install Xcode from app store.

  • In Xcode select preferences->downloads and install "Command Line Tools"
    • Xcode command line tools comes with Subversion version 1.6. Alternatively, Homebrew has version 1.8 of Subversion.
    • Xcode command line tools provides the "g++" compiler

Home Brew

see http://mxcl.github.com/homebrew/

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Later libraries (PETSc, METIS, VTK and parMETIS) need a "science" repository
brew tap homebrew/science

You can roll the next few installs together if you wish. However, some of these (PETSc and Sundials) need some configuration to build in the correct way (see below). It will take a while.

brew install wget scons boost gfortran openmpi valgrind xerces-c petsc parmetis metis vtk sundials
brew install hdf5 --enable-parallel

SCons

Homebrew has version 2.3.0 of Scons:

brew install scons

Boost

Homebrew has version 1.53.0 of boost:

brew install boost

OpenMPI

Homebrew has version 1.6.5 of OpenMPI: needs fortran compiler

brew install gfortran
brew install openmpi

Xerces-c

Xerces-c 3.1.1 is available on homebrew:

brew install xerces-c

wget

To simplify later downloads install wget (v1.14):

brew install wget

PETSc (from home-brew/science)

Homebrew has version 3.3.p5 of PETSc.

Important: Some parts of Chaste require shared libraries so you should edit the configuration of PETSc to build shared libraries for you.

brew edit petsc

Add the --with-shared-libraries flag at line 13:

-      system "./configure", "--with-debugging=0", "--prefix=#{prefix}"
+      system "./configure", "--with-debugging=0", "--with-shared-libraries", "--prefix=#{prefix}"

Now install:

brew install petsc

ParMETIS and METIS

Building ParMETIS also builds METIS so, if the installer worked better, you ought to be able to install both in a single line. However here we take the dangerous approach of install both separately. This is only dangerous if the versions go out of sync. Calls into METIS are soon to be deprecated...

Important: Some parts of Chaste require shared libraries so you should edit the configuration of ParMETIS and METIS to build shared libraries for you.

ParMETIS 4.0.2

brew edit parmetis

Add the shared=1 flag at line 12:

-   system "make", "config", "prefix=#{prefix}"
+   system "make", "config", "shared=1", "prefix=#{prefix}"

METIS 5.0.2

brew install parmetis
brew edit parmetis

Add the shared=1 flag at line 14:

-   system "make", "config", "prefix=#{prefix}"
+   system "make", "config", "shared=1", "prefix=#{prefix}"
brew install metis

VTK

VTK 5.10.1

brew install vtk

NOTE if you are using Mavericks then you should install VTK5 as the default version (6.0) has some incompatibilities

brew install vtk5

You will also need to edit the local.py file to replace the line

ldflags='-framework vecLib'

with

ldflags='-framework Accelerate'

and to remove vtkFiltering and vtkzlib from the other_libraries.

CVODE (Sundials)

Sundials 2.5.0

Important: Some parts of Chaste require shared libraries so you should edit the configuration of Sundials to build shared libraries for you.

brew edit sundials

Add the -enable-shared flag at line 10:

    system "./configure", "--disable-debug", "--disable-dependency-tracking",
-                          "--prefix=#{prefix}"
+                          "-enable-shared", "--prefix=#{prefix}"
brew install sundials

HDF5

Homebrew has version 1.8.11 of HDF5:

brew install hdf5 --enable-parallel

Codesynthesis XSD

Codesynthesis XSD is not available in Macports and must be installed directly:

wget http://www.codesynthesis.com/download/xsd/3.3/macosx/i686/xsd-3.3.0-i686-macosx.tar.bz2
tar xvfz xsd-3.3.0-i686-macosx.tar.bz2
#These instructions assume that homebrew has created /usr/local/ and that the current user has permission to write to it.
cp xsd-3.3.0-i686-macosx/bin/xsd /usr/local/bin/
cp -r xsd-3.3.0-i686-macosx/libxsd /usr/local/opt/

You also need to change the call setg (b, b, e) on line 35 of xsd/cxx/zc-istream.txx like this:

bash-3.2$ diff -u /usr/local/opt/libxsd/xsd/cxx/zc-istream.txx.orig /usr/local/opt/libxsd/xsd/cxx/zc-istream.txx
--- /usr/local/lib/libxsd/xsd/cxx/zc-istream.txx.orig   2013-07-10 11:00:23.000000000 +0100
+++ /usr/local/lib/libxsd/xsd/cxx/zc-istream.txx        2013-07-10 11:00:59.000000000 +0100
@@ -32,7 +32,7 @@
       C* b (const_cast<C*> (str_.data ()));
       C* e (b + str_.size ());
 
-      setg (b, b, e);
+      std::streambuf::setg (b, b, e);
     }

Python XML tool support

Libraries needed by PyCml, the heart component and the Functional Curation bolt-on project.

# Note that Amara at version 2 is not suitable, so version 1.2 is forced.
sudo easy_install https://pypi.python.org/packages/2.5/A/Amara/Amara-1.2.0.2-py2.5.egg
sudo easy_install rdflib
sudo easy_install lxml

Host Config

Use attachment:local.py (experimental) for your host config. Save it as python/hostconfig/local.py.


More for the developer

Eclipse

  • Download the Eclipse IDE for C++ developers (or a more appropriate file) from http://www.eclipse.org/downloads/
  • Open the resulting tar file to produce a folder named "eclipse"
  • Drag and drop the "eclipse" folder to "Applications" in FileFinder
  • Open from Applications -> eclipse -> Eclipse
    • (You might be prompted to install a Java runtime when you first run Eclipse)
  • If you want to alias or add the path, the location is /Applications/eclipse/eclipse

Valgrind

Valgrind version 3.8.1 (not necessary, but useful to the serious developer)

brew install valgrind

Handy things

To be able to see the tmp folder in finder use

sudo chflags nohidden /tmp

Useful aliases to add to ~/.bashrc

alias eclipse=/Applications/eclipse/eclipse
alias cdchaste='cd /Users/chaste/eclipse/workspace/Chaste' #Or similar