No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

FlexBox - A Flexible Primal-Dual ToolBox


This repository contains the C++ module for FlexBox. Please refer to the main repository for licensing and citation.

The main repository can be found under


*Institute for Computational and Applied Mathematics University of Muenster, Germany


FlexBox is copyright ©2016-2017 by Hendrik Dirks. If you plan to distribute the software (commercially or not), please contact Hendrik Dirks for more information.



In order to use the MEX interface the following requirements should be met:

  • Matlab >= R2015b
  • Image Processing Toolbox
  • CMake >= 3.0.2
  • OpenMP >= 2.0 when building with OpenMP support (optional)
  • CUDA >= 7.5 when building with CUDA support (optional)

In order to use the stand-alone version the following requirements should be met:

  • CMake >= 3.0.2
  • OpenMP >= 2.0 when building with OpenMP support (optional)
  • CUDA >= 7.5 when building with CUDA support (optional)

Quick start

git clone --recursive   #or "cd flexBox" and "git submodule update --init --recursive" if you cloned flexBox w/o CPP already
cd flexBox_CPP/source
mkdir build
cd build
cmake -D <variable1>=<value1> ../  #modify as desired see table below
make install                      #recommended but optional

The install target copies the compiled MEX-file and executables to build/bin where Matlab should find it. Check the variable params.relativePathToMex if it doesn't and set accordingly.

CMake Variable Default Value Description
BUILD_MATLAB ON compiles MEX-interface if ON
BUILD_EXAMPLES ON compiles C++ stand-alone if ON
USE_OPENMP OFF enables OpenMP support if ON
USE_CUDA OFF enables CUDA support if ON

Known Problems


'GLIBCXX' not found

The MEX-Interface is built with the Compiler found by CMake and thus could be unsupported by MathWorks (see Supported Compilers). This could result in an issue similiar to If this happens, you could either set a supported compiler in CMake via export C=/usr/bin/supportedCompilerC and export CXX=/usr/bin/supportedCompilerCXX, or try to preload the correct libraries before starting Matlab like LD_PRELOAD=/usr/bin/lib/ matlab (see Matlab Answers). The real path and correct name depends on your specific environment. The error message should give you a hint which library is missing and the concrete library should be under /usr/lib, /usr/lib32 or /usr/lib64. If you still can't make the MEX-Interface work, feel free to add another issue at


We recommend to look at the provided examples in the folder examples/. In the examples we use the CImg Library to process images.

The Doxygen documentation for the C++ module is available under the following link:

Reporting Bugs

In case you experience any problems, please create an issue at or