If you wish to have a personal projects folder for individual work using Chaste source code and the Chaste build system.
Create a NEW project in the repository
It is easiest to use the command line for this, run something like:
svn cp -m "[YOUR_PROJECT_NAME] Create new project." https://chaste.cs.ox.ac.uk/svn/chaste/projects/template https://chaste.cs.ox.ac.uk/svn/chaste/projects/YOUR_PROJECT_NAME
Obviously substituting in your new project name for YOUR_PROJECT_NAME!
Check out an EXISTING project
If you want access to the project in eclipse, then follow the first set of instructions, otherwise command line is simpler.
In Eclipse
- In Eclipse go to Window->Open Perspective->Other->SVN Repository Exploring
- If it isn't already there, add the repository location (by right-click the windowing, clicking 'New'):
- Internal developers - https://chaste.cs.ox.ac.uk/svn/chaste (internal developers should be able to browse through the projects folder to checkout the project they want)
- External developers/collaborators - https://chaste.cs.ox.ac.uk/svn/chaste/projects/<YOUR_PROJECT_NAME> (you need to specify the exact project if you aren't allowed to see this page https://chaste.cs.ox.ac.uk/trac/browser/projects).
- NB: you can't checkout projects from the location https://chaste.cs.ox.ac.uk/svn/chaste/trunk/projects.
- Right-click on the project folderyou want and click 'Checkout'
- choose a name, for example YOUR_PROJECT_NAME from above. Make sure there are no spaces or slashes.
- Click Finish.
- From a command line, do
cdchaste (this is an alias we have set up to 'cd' into the Chaste source folder) cd projects ln -s ../../YOUR_PROJECT_NAME
- You can then make changes in either the 'checked out project' or the projects inside Chaste/projects/YOUR_PROJECT_NAME.
- But to avoid subclipse confusion, you should do svn commit and updates fromthe separate YOUR_PROJECT_NAME eclipse project.
On the command line
It seems tidiest to check all of your projects out into the same location, then put a symbolic link to them from the Chaste/projects folder.
# Go to the folder that contains `Chaste` - the Chaste source code folder (not the source code folder itself, the one above!), then do: svn co "https://chaste.cs.ox.ac.uk/svn/chaste/projects/<YOUR_PROJECT_NAME>" cd Chaste/projects ln -s ../../<YOUR_PROJECT_NAME>
In either case
- It is sensible to edit the .project file in your new project, in order for a default Eclipse checkout of it to have a sensible name.
Important: to use existing Chaste code
As default the build system will only 'pull in' the core components of Chaste (ode solvers, meshes etc.). If you want to use 'crypt', 'cell_based', or 'heart' code then you need to alter a setting:
- Open projects/YOUR_PROJECT_NAME/SConscript and use the appropriate commented alternative. e.g. for a project that depends on 'heart' use:
# Chaste libraries used by this project. # Select which line to uncomment based on what your project needs, or alter as required. #chaste_libs_used = ['core'] #chaste_libs_used = ['cell_based'] chaste_libs_used = ['heart'] #chaste_libs_used = ['cell_based', 'heart']
- You can then commit the change to SConscript, you only need to do this once per project.
Making one user project depend on another
It is straightforward to make one user project depend on another, for ease of code re-use.
For example, suppose the user project User2 depends on the heart code, and we also want it to depend on the user project User1, then in the file projects/User2/SConscript we simply modify the line
chaste_libs_used = ['heart']
to
chaste_libs_used = ['heart', 'projects/User1']
NB - User1 project will have to be checked out before User2 project can build.
Building your project
To run tests in your project, go to the Chaste source folder, and either use
scons test_suite=projects/YOUR_PROJECT_NAME/test/TEST_FILE
or
scons projects/YOUR_PROJECT_NAME
The latter will run all the tests defined in projects/YOUR_PROJECT_NAME/test/ContinuousTestPack.txt. Note that no projects are run on the integration machine, either following a commit or nightly. If you want to run nightly tests locally on your machine, create a test pack called 'NightlyTestPack.txt' (although '<Something>TestPack.txt' would also work) and use
scons projects/YOUR_PROJECT_NAME build=_onlytests_Nightly
or perhaps
scons projects/YOUR_PROJECT_NAME build=GccOpt_onlytests_Nightly
See ChasteGuides/DeveloperBuildGuide for more information on how to build, including further options to scons.
Committing changes
You should be able to do team operations on the separate Eclipse project representing your user project.
Note that committing/updating from the top Chaste directory only affects core chaste, not your project, as everything in Chaste/projects is ignored.
Note that a commit to user project WILL FAIL with a message like this
Transmitting file data .svn: Commit failed (details follow): svn: 'pre-commit' hook failed with error output: Branch or project commit with no indication in log message
unless the commit has a comment starting with square brackets, e.g.
svn ci -m "[YourName] A description of your commit"
this is to avoid developers having to look through lists of user project changes.
Removing the checked-out project from a local machine
Because subclipse gets confused, it is best to use the command line to remove the files from your local machine. In Eclipse, select the project (not the folder under Chaste/projects, but the actual project in the navigator) and choose 'Delete', but make sure 'Do not delete contents' is selected. Then open up a terminal and do
cdchaste rm -rf projects/YOUR_PROJECT_NAME