== 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 `/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: {{attachment:roadrunner_build_01_-_terminal.app.png}} i.e. `CC= CXX= cmake ` which ensures that cmake will use the specified C and C++ compilers for the build process: {{attachment: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: {{attachment: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: * `CMAKE_BUILD_TYPE` to `Release` * `CMAKE_INSTALL_PREFIX` to your install directory (in our case it is `/Users/Shared/CC3Ddev/RoadRunner`) * `CMAKE_OSX_ARCHITECTURES` to `x86_64` (unless you're running on 32-bit hardware) * `ENABLE_UNIVERSAL` can be left unchecked, since we're not building multiple-architecture binaries. {{attachment: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 }}} {{attachment: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: {{attachment: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: * `CMAKE_BUILD_TYPE` to `Release` * `CMAKE_INSTALL_PREFIX` to your install directory (in our case it is `/Users/Shared/CC3Ddev/RoadRunner`) * `THIRD_PARTY_INSTALL_PREFIX` to where the ''!ThirdParty'' libraries were installed (in our case it is `/Users/Shared/CC3Ddev/RoadRunner`) * `CMAKE_OSX_ARCHITECTURES` to `x86_64` (unless you're running on 32-bit hardware) * `BUILD_CC3D_EXTENSION` needs to be checked {{attachment:roadrunner_build_07_-_CMake.app.png}} Click ''Configure'' again, then change the following values in the CMake.app list of build settings: * `CC3D_INSTALL_PREFIX` needs to be changed to the base CC3D directory, (in our case it is `/Users/Shared/CC3Ddev/CC3D370build/CC3D_3.7.0_MacOSX_10.8`) {{attachment:roadrunner_build_08_-_CMake.app.png}} ==== ''RoadRunner'' compilation and install: ==== Compiling and installing ''!RoadRunner'' is very similar to the ''!ThirdParty'' libraries compilation above. {{attachment: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.