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.
- For Eclipse 3.2:
- Click next not finish.
- Untick 'use default workspace location' and change '/home/chaste/eclipse/workspace' to '/home/chaste/eclipse/workspace/Chaste/projects' (NB: Adjust the value according to where Chaste is installed on your machine.)
- Click finish
- You may get the following error at the end of the checkout. If so, the checkout may still have worked - just click OK, then go back to the C/C++ view and refresh the projects folder to see if your project is there.
An internal error occurred during: "SVN Checkout". Attempted to beginRule: F/Chaste/projects/<PROJECTNAME>, does not match outer scope rule: P/<PROJECTNAME>
- For Eclipse 3.1 (probably works on 3.2 too):
- Click Finish.
- From a command line, do
cdchaste cd projects ln -s ../../YOUR_PROJECT_NAME
- If using the Eclipse 3.2 strategy above, it is sensible to make changes in Chaste/projects/YOUR_PROJECT_NAME, rather than the separate project that Eclipse will have open below, as subclipse gets confused (see below for more about this).
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.
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
If using the Eclipse 3.1 strategy, you should be able to do team operations on the separate Eclipse project representing your user project.
If you set the workspace for your user project to the projects folder of Chaste, then note that the fact that user projects are checked out into a subfolder of another project leads to subclipse getting a little confused. In order to commit changes to your project, you need to right-click on Chaste->projects->YOUR_PROJECT_NAME and select Commit. Similarly for Update, etc.
Note that committing/updating from the top Chaste directory only affects core chaste, not your project.
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