Build RL on Windows
In order to compile RL and the dependencies on Windows, you need to install a compiler (e.g., Visual Studio 2017) and the cross-platform build system CMake ≥ 2.8.11. With Visual Studio, ensure you have the latest updates installed (at least version 15.5). If not specified otherwise, the following commands will build 64-bit binaries for Visual Studio 2017. Commands for other versions will have to be modified accordingly.
A number of third-party libraries is required to build all components. It is recommended to get these dependencies from our Windows installer. If there is no installer for your Visual Studio version, please see below on how to build the dependencies yourself. After installation, please make sure to set the
CMAKE_PREFIX_PATH environment variables accordingly.
set PATH=C:\Program Files\Robotics Library\0.7.0\MSVC\14.1\x64\bin;%PATH% set CMAKE_PREFIX_PATH=C:\Program Files\Robotics Library\0.7.0\MSVC\14.1\x64;%CMAKE_PREFIX_PATH%
The installer only contains the runtime files for Qt in order to minimize the size. In order to build the demo applications with a GUI, you will also need the development files for Qt. Please download the official installer for Qt 5.9.2, install Qt's components for your Visual Studio version, and set the corresponding environment variables.
set PATH=C:\Qt\Qt5.9.2\5.9.2\msvc2017_64\bin;%PATH% set CMAKE_PREFIX_PATH=C:\Qt\Qt5.9.2\5.9.2\msvc2017_64;%CMAKE_PREFIX_PATH%
Visual Studio 2015 Update 2 and higher only requires the Boost header files included in our Windows installer. For older versions, please download and install the matching Boost binaries for your Visual Studio version.
For multi core compilation support (e.g., quad core), set these variables before running the other commands.
set VCBUILD_DEFAULT_OPTIONS=/M%NUMBER_OF_PROCESSORS% set CL=/MP
Building the Robotics Library
Download the source code and additional examples and extract the archives.
cmake -E tar x rl-0.7.0.zip cmake -E tar x rl-examples-0.7.0.zip cd rl-0.7.0
Create a build directory.
mkdir build cd build
Build and install the library by executing the following commands.
cmake -G "Visual Studio 15 2017 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\Robotics Library\0.7.0\MSVC\14.1\x64" .. cmake --build . --config Release --target INSTALL
Additionally, the following commands can be used to build the API documentation on demand and to run tests included in the project.
You can configure the build process by specifying a number of CMake options. Building of selected libraries, demos, or extra applications can be disabled in order to avoid certain dependencies if they are not required. The following table shows an overview of all RL specific parameters and their default values. These options can be directly appended to the
cmake command. For a detailed overview of all options, you can run the graphical user interface of CMake
|-D BUILD_DEMOS=ON||Enable/disable building the demo applications.||ON/OFF|
|-D BUILD_DOCUMENTATION=OFF||Enable/disable building the API documentation.||ON/OFF|
|-D BUILD_EXTRAS=ON||Enable/disable building the extra applications.||ON/OFF|
|-D BUILD_RL_HAL=ON||Enable/disable building the RL::HAL library and its dependencies.||ON/OFF|
|-D BUILD_RL_KIN=ON||Enable/disable building the RL::KIN library and its dependencies.||ON/OFF|
|-D BUILD_RL_MATH=ON||Enable/disable building the RL::MATH library and its dependencies.||ON/OFF|
|-D BUILD_RL_MDL=ON||Enable/disable building the RL::MDL library and its dependencies.||ON/OFF|
|-D BUILD_RL_PLAN=ON||Enable/disable building the RL::PLAN library and its dependencies.||ON/OFF|
|-D BUILD_RL_SG=ON||Enable/disable building the RL::SG library and its dependencies.||ON/OFF|
|-D BUILD_RL_UTIL=ON||Enable/disable building the RL::UTIL library and its dependencies.||ON/OFF|
|-D BUILD_RL_XML=ON||Enable/disable building the RL::XML library and its dependencies.||ON/OFF|
|-D BUILD_SHARED_LIBS=OFF||Enable/disable building shared libraries.||ON/OFF|
|-D BUILD_TESTS=ON||Enable/disable building the test applications.||ON/OFF|
|-D USE_QT5=ON||Prefer Qt5 over Qt4 if available.||ON/OFF|
Building the Dependencies
Instead of individually setting up RL's dependencies, you can build most of them automatically via the CMake scripts in the
3rdparty subdirectory. This uses CMake's
ExternalProject command to download, configure, and compile the required source code of each dependency to match your Visual Studio configuration. Only Qt and Boost (for Visual Studio 15 Update 1 and lower) will have to be installed separately.
After downloading RL's source code, create a build directory for the dependencies.
mkdir build cd build
bin directory inside your desired install folder to the
PATH environment variable.
set PATH=C:\Program Files\Robotics Library\0.7.0\MSVC\14.1\x64\bin;%PATH%
Build and install the dependencies via the following commands.
cmake -G "Visual Studio 15 2017 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\Robotics Library\0.7.0\MSVC\14.1\x64" -D CMAKE_TRY_COMPILE_CONFIGURATION=Release .. cmake --build . --config Release