Skip to content

Build from Source

Christoph Rösmann edited this page Mar 17, 2020 · 5 revisions

Install Control-Box-RST

If you only want to build this package to integrate it into your ROS workspace, please read this page instead.

Ubuntu

Prerequisites

Mandatory

  • CMake: Required to create the platform depenent build files (sudo apt-get install cmake).

Optional but recommended

  • Ipopt: Allows to solve nonlinear programs using the IPOPT (sparse large scale interior point) hard-constraint solver (check build instructions below)

Optional

  • Doxygen: Necessary, if the documentation should be compiled (sudo apt-get install doxygen).

  • SuiteSparse: Enables the usage of a wider range of sparse direct linear solvers (sudo apt-get install libsuitesparse-dev).

  • QT5 (optional): Build and extend the GUI (sudo apt-get install qt5-default)

Ipopt

If you want to include IPOPT, please refer to the IPOPT section.

Note that you can speedup IPOPT essentially by compiling it with custom linear solvers!

Compile and install control-box-rst from source

Build control-box-rst:

Before compiling, check the CMakeLists.txt. Make sure that CMAKE_BUILD_TYPE is set to Release as long as you do not need to develop new code.

cd some_folder
git clone https://github.com/rst-tu-dortmund/control_box_rst.git
cd some_folder/control_box_rst
mkdir build
cd build
cmake ../src
make

You can also use a Cmake gui in order to switch some features on and off. If you also want to compile the library with debug information, change CMAKE_BUILD_TYPE to Debug.

Install control-box-rst

If you want to install the software, e.g. for packages that depend on it, invoke

sudo make install

Run unit tests

Same as above, but:

 cd build
 cmake -D"BUILD_UNIT_TESTS=TRUE" ../src
 make check

Mac OSX

Prerequisites

  • XCode: Download the newest x-code version from the app store or from the OS X developer page.
  • CMake: Required to create the platform depenent build files (http://www.cmake.org).
  • Doxygen (optional): Necessary, if the documentation should be compiled (http://www.stack.nl/~dimitri/doxygen/download.html).
  • Ipopt (optional): Allows to solve nonlinear programs using the IPOPT (sparse large scale interior point) hard-constraint solver (check setup instructions below)
  • QT5 (optional): Build and extend the GUI (check setup instructions below)

Usage

Open CMake and select the CMakeLists.txt inside the project folder. Select x-code as the underlying compiler, configure and generate the project into a "build" folder. You can find the x-code project files now inside the newly created build folder.

You might adjust paths and variables (qt setup, boolean flags for compiling examples etc.) in the cmake gui.

Windows

Prerequisites

  • Visual Studio 2013+: Download Visual Studio (At least Version 12 / 2013)
  • CMake: Required to create the platform depenent build files (http://www.cmake.org).
  • Perl: Since October 2018, we require this as a dependency for gRPC (http://strawberryperl.com/)
  • Doxygen (optional): Necessary, if the documentation should be compiled (http://www.stack.nl/~dimitri/doxygen/download.html).
  • MikTex (optional): Only necessary to create a pdf documentation from the latex source generated by doxygen.
  • QT5 (optional): Build and extend the GUI (check setup instructions below)

Visual Studio 2013+

Usage

Open CMake and select the C++ project folder. Select Visual Studio 12 (2013) 64 Bit as the underlying compiler, configure and generate the project into a specified "build" folder.

You can find the Visual-Studio project files now inside the newly created build folder.

Qt

Install Qt using the installer from the website and make sure to install the visual studio package.

Set the CMake QT5-Path variable (e.g. using the Cmake GUI):

QT5_PATH=C:/Qt5/5.5/msvscXXX/ 

Ipopt

It's difficult to compile Ipopt successfully using VS2013 (maybe switch to the MinGW solution)

MinGW

To be done...

MinGW with QT Support

  1. https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
  2. http://stackoverflow.com/questions/27759754/qt-5-4-static-build-produces-unresolved-external-symbol-link-error-in-visual-s (Already included in the CMakeLists.txt)
  3. Run CMake with MinGW Config

In case of Ipopt: ../configure --enable-static=yes --enable-shared=no --prefix=/mingw ADD_FFLAGS="-fopenmp -static-libgcc" --disable-pthread-mumps

Copy the following files from the mingw folder to the executable:

  • libgfortran-3.dll
  • libstdc++-6.dll
  • libgcc_s_dw2-1.dll
  • libgomp-1.dll
  • libquadmath-0.dll
  • libwinpthread-1.dll