Multimedia Computing and Computer Vision Lab

Compiling

This page summarizes the steps for compiling the entire library for all OSes. Even though tested thoroughly, if you feel that an important step is not explained, drop us a note on github and we will refine these instructions.

Prerequesites

All prerequesites are available on all platforms. For all steps, CMake 3.2 or newer is used to execute the build. The requirements are listed grouped by the build part that requires them:

Core library: Boost >=1.54 (older versions untested), eigen 3, (optional: OpenCV >= 2.4.8 (older versions untested), caffe)

Python bindings: core library, Boost >=1.54 (older versions untested), Python>=2.7 or Python>=3, Numpy >= 1.7 (older versions untested)

Matlab bindings: core library, Boost >=1.54 (older versions untested), Matlab R2012 or newer (older versions untested)

Documentation: doxygen

Configuring

Create a new subfolder (usually build) in the source folder and cd into it. Now call cmake .. and diagnose the output. CMake writes is configuration (if successful) to a file called CMakeCache.txt. You can repeatedly run the command with additional definitions (e.g., to change the variable WITH_PYTHON, run cmake -DWITH_PYTHON=OFF ..). Repeat this step as often as necessary to get your build configuration set up.

The following is a list of useful variables:

WITH_PYTHON

Whether to build the Python bindings.

PYTHON_EXECUTABLE

The path to Python.

PYTHON_INCLUDE_DIR

The Python include directory (contains Python.h).

PYTHON_LIBRARY

The Python library to link against.

EIGEN3_INCLUDE_DIR

The path to the Eigen include folder.

BOOST_ROOT

The path to the boost root folder.

WITH_MATLAB

Whether to build the MATLAB bindings.

Matlab_ROOT_DIR

Matlab root (case sensitive!

WITH_CAFFE

Whether to link against caffe.

CAFFE_ROOT_DIR

Where to find (the install folder of) caffe.

WITH_OPENCV

Build the OpenCV feature extraction.

Troubleshooting

If things go wrong without explanation, you can have a look at the reasons for failing by looking into CMakeFiles/CMakeOutput.log.

Architectures

The project can only be built with C++11. The only supported architecture is x64.

Execute the build

When having completed successfully, call

1
2
cmake --build .  # make as generator
cmake --build . --config Release  # MSBuild as generator

to build on any platform. If you are using make as generator, you can add -- -jX to parallelize the build with X jobs.

Run the tests

To run the tests, just add another

1
2
cmake --build . --target test  # make as generator
cmake --build . --config Release --target run_tests  # MSBuild as generator

Documentation

For building the documentation, just run cmake --build . --target doc. The documentation will be built in the folder documentation/html/html.

Installation

Installing is another CMake call as before:

1
2
cmake --build . --target install  # make
cmake --build . --config Release --target install  # MSBuild

Take into account that you might have to execute this command with elevated privileges, depending on where the files should be stored. If you built the Python bindings, they will be installed using setuptools. The MATLAB bindings can not really be installed, please move the bindings/matlab/fertilized folder from your build whereever you want to have it! :)