ChasteGuides/BuildingCardiacExecutable

Building the cardiac executable

From within the Chaste source folder, the following command generates the Chaste executable:

scons compile_only=1 chaste_libs=1 static=0 build=GccOpt exe=1 apps

(The distributed stand-alone executable uses "static=1", but it requires making sure that all the dependencies are available as static libraries.)

The executable Chaste can then be found in the apps/src folder.

To use the correct dynamic libraries you will need to make sure that LD_LIBRARY_PATH is set up correctly in your environment, to point to the locations where the libraries used in building Chaste are contained.

In order to run a simulation edit the ChasteParameters.xml file according to your needs and, from the Chaste directory, type

apps/src/Chaste ChasteParameters.xml

Please note that the output directory specified in the ChasteParameters.xml file is relative to a directory defined by the environmental variable CHASTE_TEST_OUTPUT. If this variable is not set, results will be found relative to the 'testoutput' folder in the main Chaste directory (unlike when scons is used to run tests). You can use a command like the following to change the location:

export CHASTE_TEST_OUTPUT="/path/to/desired/folder"

If you want to run Chaste in parallel manner you have to add mpirun to your PATH. You can for example type:

ln -s $CHASTE_LIBS/petsc-3.0.0-p8/linux-gnu/bin/mpirun ~/bin/

Now you can run Chaste in parallel on "N" processors, by typing

mpirun -np N apps/src/Chaste ChasteParameters.xml

Please note that the number of processes "N" should be less than or equal to the number of processors existing on your machine.