Starting with Cornerstone 2.0.3, the source code for Cornerstone is provided with the SDK.
A precompiled version is also shipped so normal usage of runtime or SDK does not require building Cornerstone yourself. The source code is provided for reference. However, it is possible to modify and compile Cornerstone on each supported platform.
The source code includes everything in the SDK except for the core computer vision algorithm library and some specific applications.
Building Cornerstone requires some additional dependencies on all platforms. They can be either downloaded from download section of Cornerstone site or from package repositories. Comphrehensive instructions for each platform are described in their own sections.
Cornerstone uses environment variables for choosing the libraries used with the execution and compilation. Each Cornerstone installation sets CORNERSTONE_ROOT_X_Y_Z environment variable to point to the root directory of the installation. Letters X,Y and Z correspond to the version number of Cornerstone. The applications built with version X.Y.Z of the SDK will use the libraries pointed out by corresponding environment variable. This behaviour can be overriden by setting environment variable CORNERSTONE_SDK_ROOT to point different directory. This variable is set to point to src folder by env.bat (Windows) and env.sh (OS X, Linux). It will be the root folder when compiling Cornerstone. Running env.bat or env.sh updates also the values of %PATH% / $LD_LIBRARY_PATH / $DYLD_LIBRARY_PATH on Windows / Linux / OSX.
Running Cornerstone applications requires that a folder called data exists in the root of the Cornerstone. This folder is located in the root of the installation packages. When compiling Cornerstone the root directory changes to src directory. The data folder must be copied or linked to this root directory from the installation folder if applications are executed from the build tree directly.
Install Visual Studio 2015 with C++ support.
Download and install Cornerstone SDK from the download section.
Navigate the src folder in Cornerstone SDK (by default C:\Cornerstone-SDK-<version>/src) using VS2015 x64 Native Tools command prompt and execute env.bat script:
This script will set up the environment variables used during compilation and execution of compiled programs. Note that if you have set these environment variables then Cornerstone applications will use libraries compiled from source code when the applications are executed.
After setting up the environment variables you must generate Makefiles by running the following command in the src directory:
Now Cornerstone can be compiled by executing
in the src folder.
Depending on your setup, you might get an error C1902: "Program database manager mismatch; please check your installation" when trying to compile debug version of the SDK. Cornerstone uses multi-process compiling which requires program database manager to handle PDB file writes. Sometimes this is not started automatically, so you might need to start it manually by running mspdbsrv.exe -start -spawn.
Download and install Cornerstone SDK from the download section.
Copy the src folder from Cornerstone SDK to desired workspace that you have write permissions to (e.g. home folder):
Navigate to src/Scripts directory and run install-sdk-build-deps with root priviledges:
This script will install additional dependencies that are required to build the SDK. Note that if you have node.js or V8-engine installed from repositories this script will replace them with different custom version provided by MultiTouch Ltd.
Navigate back to the src folder and source variables from env.sh:
This will set correct environment variables for building Cornerstone.
Now execute command
to create Makefiles for the libraries. For Ubuntu 14.04 use command:
Finally build Cornerstone using command
(to make the build faster, use make -jN, where N is at most slightly greater than the number of CPU cores you have).
Cornerstone is built using clang on OS X, see here for instructions on how to setup the build environment.
Download Cornerstone SDK package from Cornerstone website download section.
Install the SDK
Copy src folder under the SDK to desired workspace (e.g. home folder):
Navigate to src folder and source the environment variables:
This will set correct environment variables for building Cornerstone.
Now execute command
to create makefiles for the libraries.
Finally build Cornerstone using command
(to make the build faster, use make -jN, where N is at most slightly greater than the number of CPU cores you have).
If you want to create a custom install of a Cornerstone that you have built yourself, you can use the following commands once Cornerstone has been built:
OS X and Linux:
Windows:
Replace <path> with the path you want to install to.
The install target will create a folder structure similar to the official Cornerstone release packages from MultiTouch Ltd. Please keep in mind that some applications are not available in custom-built SDK. Also if you want to provide both debug and release versions of libraries, you must combine them manually.