Installation

Linux

Conda Package

The conda package is recommended. If you already have conda installed just do:

conda config --add channels conda-forge
conda config --add channels jmsgrogan
conda install microvessel-chaste
conda install libgcc

You should then be able to do:

import microvessel_chaste

in a python session.

If you need to install conda, the Miniconda package will suffice.

It may be necessary to run the following if you are starting with a 'clean' version of Ubuntu to install some typical packages:

sudo apt-get install build-essential lsb-release libgl1-mesa-dev:amd64 libxt-dev:amd64 libatlas-base-dev

Docker

A Docker image is also available. This image will launch a Jupyter notebook at http://localhost::8888 in a web browser, which can be used to try out the package. If you already have docker installed do:

docker pull jmsgrogan/microvessel-chaste
docker run -it -p 8888:8888 jmsgrogan/microvessel-chaste

and go to the above link in your browser. Alternatively do:

docker pull jmsgrogan/microvessel-chaste
docker run -it jmsgrogan/microvessel-chaste /bin/bash

to get access to the shell and launch Python yourself.

To install Docker follow the instructions here.

Windows/MacOS

Docker

Only Docker is supported on these platforms at the moment. Install Docker following the instructions here and proceed as per the Linux Docker instructions above.

Build From Source (Linux) - C++ and Python

It is reasonably straightforward to build the package from source on Linux.

First, Chaste dependencies need to be built following the Chaste Install Guide.

The project only supports the development version of Chaste. This can be obtained by doing:

git clone -b paper/MicrovesselChaste https://chaste.cs.ox.ac.uk/git/chaste.git $CHASTE_SOURCE_DIR

The project code itself can be obtained by doing:

git clone https://github.com/jmsgrogan/MicrovesselChaste.git $MICROVESSEL_PROJECT_SOURCE_DIR

The Microvessel project code needs to be included in the main Chaste source. This can be done with a symbolic link:

cd $CHASTE_SOURCE_DIR/projects
ln -s $MICROVESSEL_PROJECT_SOURCE_DIR

The C++ libraries can be built using the Chaste CMake build system. First, create a build directory outside the source tree and proceed as:

cd $CHASTE_BUILD_DIR
cmake $CHASTE_SOURCE_DIR
make project_MicrovesselChaste -j $NUM_AVAILABLE_CPUS

This will build the C++ library and all tests. To avoid building tests do:

make chaste_project_MicrovesselChaste -j $NUM_AVAILABLE_CPUS

as the final command. The Chaste CMake build system guide should be consulted for options related to generating optimized builds, running other types of test and installation as a system library.

To build the Python library it is neccessary to first build PyChaste, a Python wrapper for Chaste. Do:

git clone https://github.com/jmsgrogan/PyChaste.git $PYCHASTE_PROJECT_SOURCE_DIR
cd $CHASTE_SOURCE_DIR/projects
ln -s $PYCHASTE_PROJECT_SOURCE_DIR
cd $CHASTE_BUILD_DIR
cmake $CHASTE_SOURCE_DIR
make chaste_project_PyChaste -j $NUM_AVAILABLE_CPUS
make chaste_project_PyChaste_Python -j $NUM_AVAILABLE_CPUS
cd $CHASTE_BUILD_DIR/projects/PyChaste/python/chaste
python setup.py install

Similarly, for Microvessel Chaste do:

cd $CHASTE_BUILD_DIR
make project_MicrovesselChaste_Python -j $NUM_AVAILABLE_CPUS
cd $CHASTE_BUILD_DIR/projects/MicrovesselChaste/python/microvessel-chaste
python setup.py install

You can then import chaste and microvessel_chaste in a Python session.

Troubleshooting

  • Missing Boost Python when building from source: If you are building from source you may need to install Boost Python in addition to the Chaste dependencies. Do sudo apt-get install libboost-python-dev on Ubuntu to obtain it.
  • Missing librt.so when loading conda package: this is a problem with the version of VTK in conda-forge. Make sure you have added the conda channels in the order above.
  • GCC ABI errors when importing chaste from the conda package. The conda package is built with GCC 5 and needs the corresponding version of libstdc++. This library is easily hidden by the system version or other conda packages. It is suggested that chaste is run in its own conda environment and that the conda 'libgcc' package is installed on its own after chaste.