ChasteGuides/DeveloperBuildGuide

Developer 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.

To start a build, simply run scons from within the trunk directory; this will build all Chaste components, but not user projects. "scons -c ." will do a clean build (note the '.' - this is necessary to do a full clean).

Other build targets can be selected, rather than just running the default.

Various options can be passed to customise the build. Some also have short forms, shown in brackets.

The build argument is used to control what type of build to perform. The different possible values for this option correspond to classes defined in the source:trunk/python/BuildTypes.py file. The GetBuildType function in this module will always have the most up-to-date information on what is available, but a summary is also given here for convenience.

A build type string can be just a class name, in which case that class is used. Certain options can also be specified, separated by an underscore '_'. Current options are:

The various classes specify such things as what compiler and flags to use for building C++ code, and also what tests to run by default. They also contain methods which the build (and test summary) scripts use to determine whether a test passed or failed, and where to store the output of tests. Unless you're working on the infrastructure you shouldn't have to worry about that. All methods contain documentation on their function.

Note that different build types, if they use different compilation flags, cause the compiled object files to be stored in different directories. Doing a clean build (scons -c . build=<whatever>) will only remove object files in the directories corresponding to the given build type.

Some of the classes (and hence valid values for the build parameter) are: