ChasteGuides/UserBuildGuide

User build guide

We use  SCons to control the build process. The source:trunk/SConstruct file configures what needs to be built, and is worth a look if this document leaves unanswered questions. The file source:trunk/python/SConsTools.py also contains much of the build logic.

scons can be used to run a single test, or multiple tests, in debug or optimised mode, and with number of other options. This page lists the scons commands that users should be aware of. In order to run scons, open a terminal, cd into the main chaste directory, and run one of the following commands. Or better, create a 'Make target' in eclipse using that given command.

This runs all the tests

scons

To run a single test, say heart/test/bidomain/TestBidomainProblem.hpp, do

scons test_suite=heart/test/bidomain/TestBidomainProblem.hpp

The path is relative to the main chaste directory.

To run all the tests in, say, the heart folder, do

scons heart

The above all compile with debug flags. To compile optimised code you must have to provide a build option, for example

scons build=GccOpt test_suite=heart/test/bidomain/TestBidomainProblem.hpp          # optimised build
scons build=GccOpt_ndebug test_suite=heart/test/bidomain/TestBidomainProblem.hpp   # highly optimised with NDEBUG set to true, recommended for longer-running simulations
scons build=IntelProduction test_suite=heart/test/bidomain/TestBidomainProblem.hpp # (see below)

Building with IntelProduction requires an Intel compiler and extra libraries (see the install guide). This provides the fastest code but the compilation time can be very long.

Other options that are worth knowing

Abbreviations can be used:

For example

scons co=1 b=GccOpt_ndebug ts=heart/test/bidomain/TestBidomainProblem.hpp

See ChasteGuides/DeveloperBuildGuide for a complete list of options.