Building the OpenCMISS Suite¶
Note
If you encounter any troubles, don’t miss reading the Build support section!
The base for the installation is a folder called OPENCMISS_ROOT
.
We’ll use <manage>
as shorthand to <OPENCMISS_ROOT>/manage
.
Prerequisites¶
In order to build OpenCMISS or any part of it, you need:
- A compiler toolchain
(gnu/intel/clang/...)
- CMake 3.3.2 or higher.
- If you are on Linux/Mac and already have an older version installed (higher than 2.6), the build procedure will automatically provide a target “cmake” to build the required CMake version and prompt you to re-start the configuration with the new binary.
- On Windows just download the current installer, e.g. http://www.cmake.org/files/v3.3/cmake-3.3.2-win32-x86.exe
- Only for Linux/Mac without Git: OpenSSL. This is required to enable CMake to download files via the
https
protocol from GitHub. OpenSSL will automatically be detected & built into CMake if the setup script triggers the build, for own/a-priori cmake builds please use theCMAKE_USE_OPENSSL=YES
flag at cmake build configuration time.- Disk space! Make sure to have at least 5 GB of free disk space if you plan to build everything in Release and Debug modes.
- [Optional] Git version control. This is recommended as cloning the repositories makes contributing back easier from the start!
- [Iron only] A MPI implementation - some are shipped with OpenCMISS and can be automatically built for you. If you want a different one, no one holds you back.
- [Python bindings only] Python and various libraries. This is only relevant if you want to build Python bindings.
- Python itself (
python
), minimum version 2.7.9.- The SWIG interface generator (e.g. Windows download)
- The Python libraries and development packages (
libpython, python-dev
)- [Iron only] The NumPy library (
python-numpy
), see SourceForge- [Optional] For multi-architecture builds, the Python virtualenv mechanism allows to easily switch between different configurations.
- Linux/Mac: Install via your package management system (
python-virtualenv
)- Windows: See http://pymote.readthedocs.org/en/latest/install/windows_virtualenv.html
Building on Linux¶
Default steps for Users (terminal/command line)¶
- Create the
OPENCMISS_ROOT
folder somewhere and enter it- Clone the setup git repo into that folder via
git clone https://github.com/OpenCMISS/manage
. Alternatively, if you don’t have Git, go to GitHub and download a zip file- Enter the
OPENCMISS_ROOT/manage/build
folder- Type
cmake ..
- optional Make changes to the configuration, see by changing the OpenCMISSLocalConfig file in the current build directory.
- Build the
opencmiss
target viamake | nmake | .. opencmiss
(or whatever native build system you have around). Multithreading is used automatically, no-j4
or so needed.- Have a coffee.
- Coming back from the coffee and something failed? Checkout the Build support.
This will compile everything using the default compiler and default mpi - if you only want a certain component of OpenCMISS, please refer to Building only Iron or Zinc. Basic warnings will be in place for all known erroneous system configurations. The OpenCMISS-Examples are a competely different package/project and if you want to build them after you’ve finished building the OpenCMISS libraries please see Building OpenCMISS examples (Unix/terminal).
Default steps for Developers (terminal/command line)¶
- The default steps are the same as for users, but with two changes:
- At step 4, invoke
cmake -DEVIL=<YES|your_freely_chooseable_evilness_value> ..
- In addition to the changes you can make at step 5, change the OpenCMISSInstallationConfig file according to your OpenCMISS development needs.
- At step 4, invoke
Note
Ideally, the first step for developers is to fork any components of OpenCMISS that should be worked on at GitHub (or to some other git-aware location) and modify the developer config script accordingly to have the build system checkout the repos from your own location. You can still change repository locations later, however that might require a complete re-build.
Building on Windows¶
Building on MS Windows is not recommended for anyone just running examples or building applications against the OpenCMISS Libraries. The documentation will be augmented to more specific instructions for various use cases later.
Prerequisites¶
In addition to the general prerequisites:
- Visual Studio 2013 Update 5. Other versions might work, they have not been tested yet. The Update 5 was necessary to fix some compiler issues for some dependencies.
- If you want to build Iron:
- A Fortran compiler that integrates with Visual Studio. We use the Intel Composer Framework (license costs!)
- MPI: We use MPICH2, MSMPI can be configured but there are known compatibility issues regarding the MSVCRT.
- Make sure that any pre-installed programs (MPI, Git, ..) are available on the PATH (either User or System scope). Path entries must be without quotation marks in order to have CMake pick them up correctly!
Visual Studio (32/64bit)¶
- Create the
OPENCMISS_ROOT
folder somewhere and enter it- Clone the setup git repo into that folder via
git clone https://github.com/OpenCMISS/manage
. Alternatively, if you don’t have Git, go to GitHub and download a zip file- Open CMake GUI
- Use the “Browse Source” button and select the
OPENCMISS_ROOT/manage
folder- Use the “Browse Build” button and select the
OPENCMISS_ROOT/manage/build
folder- If you want to use MPI, you need to specify the MPI cache variable to “msmpi” or “mpich2” in order to have the build system find the corresponding packages. Use the “Add entry” button for that (Type “STRING”).
- Click on “Configure”. CMake will prompt you to select a Toolchain. Make sure you choose the correct one, this also determines if you will build 32 or 64 bit versions.
- After the configuration finished, click “Generate”.
- Navigate to
OPENCMISS_ROOT/manage/build
and open the generated Visual Studio solution file “OpenCMISS”- Within Visual Studio, select the build type (it seems to default to “Debug”, you might want to select “Release”)
- Build the project “opencmiss”.
- Have a coffee or two.
Note
Building with Visual Studio in 32bit mode has not been tested yet.
Python bindings (64bit)¶
Make sure you download a 64bit Python installer (see e.g. general 2.7.11 download page).
Unfortunately, for NumPy, there is no official support for 64bit Windows binaries!
However, this article describes how to install unofficial 64bit Windows NumPy builds,
created and maintained by Christoph Gohlke. Woot!
Essentially, you need to download the binary package and use an Administrator-Mode Windows Command Prompt to
install the package via pip install <path-to-package.whl>
.
For the above Python 2.7.11 link, we use this build.
Python bindings (32bit)¶
For NumPy, there are 32bit Windows binaries available via SourceForge. For some reason newer releases don’t come with the ‘superpack’ .msi installers, Version 1.10.2 currently does.
MinGW and MSYS (64bit)¶
- Get CMake. Minimum version: 3.3.1
- Get MSYS2:
- Get installer from http://sourceforge.net/projects/msys2/
- Install (assume here:
C: MSYS2_64
), dont use spaces in the installation folder!- Follow the instructions in Section III to update your version http://sourceforge.net/p/msys2/wiki/MSYS2%20installation
- Get MinGW 64:
- Get installer from http://sourceforge.net/projects/mingw-w64/
- Choose you GCC version and threading model (use posix); the installer automatically suggests a suitable subfolder for your selection so you can have multiple versions in parallel.
- Install, (assume here: C:mingw-w64…)
- Create a directory junction to include the mingw64-folder into the msys directory tree
- Open a windows command prompt IN ADMINISTRATOR MODE
- Go into C:MSYS2_64
- Remove the old
mingw64
-folder (it should only contain an/etc
folder)- Type
mklink /J mingw64 C: mingw-w64 <your selection>