CompuCell3D:

Compiling ''LibRoadRunner'' for CC3D on Mac OS X (tested on OS X 10.8 "Mountain Lion")

The CC3D git repository contains a version of the RoadRunner library customized for CC3D use. The source code is available at <CC3D_Git_root>/RoadRunner. For the purposes of this guide, the local CC3D git repository is located at /Users/Shared/CC3Ddev/git_CC3D/CompuCell3D/.

The compilation of RoadRunner takes two separate steps. First we build the ThirdParty libraries, as found in the /Users/Shared/CC3Ddev/git_CC3D/CompuCell3D/RoadRunner/ThirdParty/ directory. Then we build the RoadRunner library from the source code in the /Users/Shared/CC3Ddev/git_CC3D/CompuCell3D/RoadRunner/ directory.

Building the ''ThirdParty'' libraries

Cmake Configuration and Makefile generation

Due to a bug in cmake, the C/C++ compiler's location can not be changed once cmake/ccmake is run on a specific CMakeCache.txt configuration. Since we want to specify the standard gcc to compile RoadRunner on Mac OS X, just as we do for CC3D, we have to explicitly define the CC and CXX shell environment variables before calling cmake, otherwise cmake would default to Mac OS X's default compiler Clang/LLVM. From Terminal.app using the bash shell, type:

roadrunner_build_01_-_terminal.app.png

i.e. CC=<gcc C compiler location>  CXX=<gcc C++ compiler location>  cmake  <ThirdParty source code location> which ensures that cmake will use the specified C and C++ compilers for the build process:

roadrunner_build_02_-_terminal.app.png

Once cmake has completed its first run, we proceed with specifying further build settings in Cmake.app. If it's the first time CMake.app is run, there will be no predefined path values for source code and binaries:

roadrunner_build_03_-_CMake.app.png

Click on Browse Source... and locate the ThirdParty source directory (in our case it is /Users/Shared/CC3Ddev/git_CC3D/CompuCell3D/RoadRunner/ThirdParty), then click on Browse Build... and locate the build directory (in our case it is /Users/Shared/CC3Ddev/builds/roadrunner/ThirdPartyBuild). Click on Configure, and once CMake completes its initial configuration, change the following values in the CMake.app list of build settings:

roadrunner_build_04_-_CMake.app.png

Then click on Generate in the CMake.app window to generate Makefile files for the ThirdParty build. Some build values may change when Generate is invoked: double-check that all build values are as needed, e.g. that the CMAKE_INSTALL_PREFIX points to our specified install directory, etc. and click on Generate again if necessary. Once CMake.app completes its Generate process, you can quit CMake.app and resume the build process in the Terminal.app window.

''ThirdParty'' build

Return to the Terminal.app window, and cd to the directory where the Makefiles have been generated, in our case the /Users/Shared/CC3Ddev/builds/roadrunner/ThirdPartyBuild directory. Once in that directory, run make and make install (if building on multi-processor, make can take advantage of parallel gcc compilation, by specifying the number of parallel compilation instances: e.g. make -j4 for 4 CPU cores, etc.) :

cd /Users/Shared/CC3Ddev/builds/roadrunner/ThirdPartyBuild
make
make install

roadrunner_build_05_-_terminal.app.png

This installs the required ThirdParty libraries in /Users/Shared/CC3Ddev/RoadRunner.

Building ''RoadRunner'' for CC3D on Mac OS X (tested on OS X 10.8 "Mountain Lion")

Cmake Configuration and Makefile generation

Similarly to how we configured cmake for building the required ThirdParty libraries above, to configure the RoadRunner build we specify the standard gcc for compilation on Mac OS X before calling cmake, otherwise cmake would default to Mac OS X's default compiler Clang/LLVM. From Terminal.app in the bash shell:

roadrunner_build_06_-_terminal.app.png

Once cmake has completed its first run, we proceed with specifying further build settings in Cmake.app. As for building the ThirdParty libraries, select the correct source (/Users/Shared/CC3Ddev/git_CC3D/CompuCell3D/RoadRunner) and build (/Users/Shared/CC3Ddev/builds/roadrunner/RoadRunnerBuild) directories. Click on Configure, then after CMake completes its initial configuration, change the following values in the CMake.app list of build settings:

roadrunner_build_07_-_CMake.app.png

Click Configure again, then change the following values in the CMake.app list of build settings:

roadrunner_build_08_-_CMake.app.png

''RoadRunner'' compilation and install:

Compiling and installing RoadRunner is very similar to the ThirdParty libraries compilation above.

roadrunner_build_09_-_terminal.app.png

1) from Terminal.app in the bash shell, cd to the /Users/Shared/CC3Ddev/CC3D370build/CC3D_3.7.0_MacOSX_10.8 directory:

cd /home/m/CODE_TGIT_build/RoadRunnerBuild

2) start the build process with make:

make

3) finally, install RoadRunner in the CC3D base directory:

make install

Now your CC3D installtion should have RoadRunner installed and all SBMLSolver based simulations should run.

CompuCell3D: SrcBin/RoadRunnerMac (last edited 2013-07-02 20:15:12 by 156-56-195-231)