Robotics Library

Build RL on Windows

CMake GUI
The Robotics Library uses CMake as a build system. It can generate project files for various platforms, e.g., Visual Studio solution files.

Prerequities

In order to compile RL and the dependencies on Windows, you need to install a compiler (e.g., the free Visual Studio 2010 Express Edition) and the cross-platform build system CMake ≥ 2.8.11. With Visual Studio, ensure you have the latest updates installed, including at least SP1. If not specified otherwise, the following commands will build 64-bit binaries for Visual Studio 2010. Commands for other versions will have to be modified accordingly.

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. Make sure that the Boost installation can be found by setting the BOOST_ROOT variable to the correct directory.

set BOOST_ROOT=%ProgramFiles%\Boost

Build and install the library by executing the following commands.

mkdir Default
cd Default
cmake -G "Visual Studio 10 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\rl" ..
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.

doxygen
ctest

Build Configuration

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 cmake-gui.

Option Description Values
-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

Building the Dependencies

Robotics Library Components
The Robotics Library uses a number of external dependencies, some of which are optional. For definite and current information of the exact dependencies, please refer to the build files in the source code.

The CMake scripts included in RL will by default look for 32-bit binaries in subdirectories with the name of the corresponding library in the C:\Program Files (x86) folder and for 64-bit binaries in the C:\Program Files folder. However, you may also place them in other directories and set the matching environment variables for the library in question. In case you are not able to find suitable binaries for your configuration, please follow the build documentation of the individual package or the short howto below.

Boost

The Boost project provides pre-compiled binaries for several compiler versions and platform architectures.

Some components of the Boost are header-only and can be used without compiling the libraries. Many advanced features however require the building of the corresponding binaries. The following steps will explain briefly how to build these binaries from the Boost source code. For the most current and full documentation please have a look at the Boost homepage.

Download the Boost source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the directory of the extracted source. Compile the build system Boost.Build by executing the following command.

bootstrap.bat

In order to compile the complete set of 32-bit libraries and install them run the following command. Afterwards, make sure to add the folder C:\Program Files (x86)\Boost\lib to the system's PATH variable.

b2 install address-model=32 --build-type=complete --prefix="C:\Program Files (x86)\Boost"

In order to compile the complete set of 64-bit libraries and install them run the following command. Afterwards, make sure to add the folder C:\Program Files\Boost\lib to the system's PATH variable.

b2 install address-model=64 --build-type=complete --prefix="C:\Program Files\Boost"

Bullet

Download the Bullet source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the directory of the extracted source. Build and install the library by executing the following commands.

mkdir Default
cd Default
cmake -G "Visual Studio 10 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\bullet" -D INSTALL_EXTRA_LIBS=ON -D INSTALL_LIBS=ON ..
cmake --build . --config Release --target INSTALL

CGAL

Download the CGAL source code and extract the archive. Set the environment variable BOOST_ROOT to point to the root directory of this library. Build and install the library by executing the following commands.

mkdir Default
cd Default
cmake -G "Visual Studio 10 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\cgal" -D WITH_CGAL_ImageIO=OFF -D WITH_CGAL_Qt3=OFF -D WITH_CGAL_Qt4=OFF ..
cmake --build . --config Release --target INSTALL

CGAL depends on GMP and MPFR by default. Newer CGAL versions support disabling GMP via the environment variable CGAL_DISABLE_GMP, e.g., via the command set CGAL_DISABLE_GMP=1. For older versions, you can try to disable GMP and MPFR by setting the CMake flags -D WITH_GMP=OFF -D WITH_MPFR=OFF. On some versions it might work to modify the CMakeLists.txt file in the following way.

--- CGAL-4.1.orig/CMakeLists.txt
+++ CGAL-4.1/CMakeLists.txt
@@ -534,7 +534,7 @@
 set_special_prefix(Coin3D COIN3D)
 
 # some libraries are essential (stl and Boost.Thread are treated in another way)
-list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR)
+#list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR)
 hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES)
 
 foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})

Coin3D

Download the Coin3D source code and extract the archive. Open the Visual Studio solution file build\msvc9\coin3.sln and convert the project to the new version. Select the desired configuration (DLL (Debug), DLL (Release), LIB (Debug), LIB (Release)) and platform (you will have to add a new one for "x64"), then compile the binaries via "Build/Build Solution".

Open a command prompt and change to the subdirectory build\msvc9, then run the appropriate command to install the binaries and headers. Afterwards, make sure to add the folder C:\Program Files\Coin\bin to the system's PATH variable.

mkdir "C:\Progam Files\Coin"
set COINDIR="C:\Progam Files\Coin"
..\misc\install-sdk.bat dll release msvc9 coin3

Depending on you compiler version, you may have to patch the file src/scxml/ScXMLStateMachine.cpp in the following way.

--- Coin-3.1.3.orig/src/scxml/ScXMLStateMachine.cpp
+++ Coin-3.1.3/src/scxml/ScXMLStateMachine.cpp
@@ -331,7 +331,7 @@
       PRIVATE(this)->initializer.reset(new ScXMLTransition);
       PRIVATE(this)->initializer->setTargetAttribute(PRIVATE(this)->description->getXMLAttribute("initialstate"));
     }
-    transitions.push_back(PImpl::StateTransition(NULL, PRIVATE(this)->initializer.get()));
+    transitions.push_back(PImpl::StateTransition(nullptr, PRIVATE(this)->initializer.get()));
   } else {
     for (int c = 0; c < static_cast<int>(PRIVATE(this)->activestatelist.size()); ++c) {
       // containers are also active states and must be checked

Eigen

Eigen is header-only and can be installed by extracting the source code into the preferred location, but an installation with CMake is supported as well. Download the Eigen source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the directory of the extracted source. Build and install the library by executing the following commands.

mkdir Default
cd Default
cmake -G "Visual Studio 10 Win64" -D CMAKE_INSTALL_PREFIX="C:\Program Files\eigen" ..
cmake --build . --config Release --target INSTALL

libxml2

The iconv library is optional and can provide support for additional charsets. The support for Visual Studio has been discontinued, however, a guide on how to patch it accordingly can be found here.

Download the libxml2 source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the subdirectory win32 of the extracted source.

For a release build, run the following command.

cscript configure.js compiler=msvc iconv=no prefix="C:\Program Files\libxml2"

For a debug build, run the following command.

cscript configure.js compiler=msvc debug=yes iconv=no prefix="C:\Program Files\libxml2"

Build the binaries and install them to the specified location with the following command. Afterwards, make sure to add the folder C:\Program Files\libxml2\bin to the system's PATH variable.

nmake /f Makefile.msvc
nmake /f Makefile.msvc install

ODE

Download the ODE source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the subdirectory build of the extracted source. Run the following command in order to generate a solution file for Visual Studio.

premake4 vs2010

Open the Visual Studio solution file build\vs2010\ode.sln. Select the desired configuration (DebugDoubleDLL, DebugDoubleLib, DebugSingleDLL, DebugSingleLib, ReleaseDoubleDLL, ReleaseDoubleLib, ReleaseSingleDLL, ReleaseSingleLib) and platform (you will have to add a new one for "x64"), then compile the binaries via "Build/Build Solution".

Create a directory C:\Program Files\ode, copy the folder lib into this directory, and the folder include\ode into a subdirectory include.

Qt

The Qt project and the Qt64-NG project provide pre-compiled binaries for several compiler versions and platform architectures.

The following steps will explain briefly how to build binaries from the Qt source code. For the most current and full documentation please have a look at the Qt homepage or the included INSTALL file.

Download the Qt source code and extract the archive to the desired installation folder, e.g., C:\Qt. Please note that it cannot contain spaces and cannot be moved later easily as the path is hardcoded into the executables. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the directory of the extracted source. Compile the binaries by executing the following commands. Afterwards, make sure to create a system variable QTDIR pointing to the installation folder's subdirectory matching your Qt version, create another system variable QMAKESPEC with the value win32-msvc2010, and add the folder %QTDIR%\bin to the system's PATH variable.

configure -platform win32-msvc2010
nmake

simage

Download the simage source code and extract the archive. Open the Visual Studio solution file build\msvc9\simage1.sln and convert the project to the new version. Select the desired configuration (DLL (Debug), DLL (Release), LIB (Debug), LIB (Release)) and platform (you will have to add a new one for "x64"), then compile the binaries via "Build/Build Solution".

Open a command prompt and change to the subdirectory build\msvc9, then run the appropriate command to install the binaries and headers. Afterwards, make sure to add the folder C:\Program Files\Coin\bin to the system's PATH variable.

mkdir "C:\Progam Files\Coin"
set COINDIR="C:\Progam Files\Coin"
..\misc\install-sdk.bat dll release msvc9 simage1

SOLID

Download the SOLID source code and extract the archive. Open the Visual Studio solution file VisualC6\solid.dsw and convert the project to the new version. Select the project solid and set it as startup project via "Project/Set as StartUp Project", select the desired configuration (Debug, Release) and platform (you will have to add a new one for "x64"), then compile the binaries via "Build/Build solid".

Create a directory C:\Program Files\solid and copy the file VisualC6\solid\Release\solid.lib into a subdirectory lib and the files include\SOLID.h, include\SOLID_broad.h, and include\SOLID_types.h into a subdirectory include.

SoQt

Download the SoQt source code and extract the archive. Set the environment variables COINDIR and QTDIR to point to the root directory of these libraries. Open the Visual Studio solution file build\msvc9\soqt1.sln and convert the project to the new version. Select the desired configuration (DLL (Debug), DLL (Release), LIB (Debug), LIB (Release)) and platform (you will have to add a new one for "x64"), then compile the binaries via "Build/Build Solution".

Open a command prompt and change to the subdirectory build\msvc9, then run the appropriate command to install the binaries and headers. Afterwards, make sure to add the folder C:\Program Files\Coin\bin to the system's PATH variable.

mkdir "C:\Progam Files\Coin"
set COINDIR="C:\Progam Files\Coin"
..\misc\install-sdk.bat dll release msvc9 soqt1

In case you receive error messages about missing files such as moc_SoQtExaminerViewerP.icc, you have to manually run Qt's moc command on the following files.

"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\viewers\moc_SoQtExaminerViewerP.icc ..\..\src\Inventor\Qt\viewers\SoQtExaminerViewerP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\viewers\moc_SoQtFullViewerP.icc ..\..\src\Inventor\Qt\viewers\SoQtFullViewerP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\viewers\moc_SoQtPlaneViewerP.icc ..\..\src\Inventor\Qt\viewers\SoQtPlaneViewerP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\widgets\moc_QtNativePopupMenu.icc ..\..\src\Inventor\Qt\widgets\QtNativePopupMenu.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\widgets\moc_SoQtGLArea.icc ..\..\src\Inventor\Qt\widgets\SoQtGLArea.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\widgets\moc_SoQtThumbWheel.icc ..\..\src\Inventor\Qt\widgets\SoQtThumbWheel.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\moc_SoQtComponentP.icc ..\..\src\Inventor\Qt\SoQtComponentP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\moc_SoQtGLWidgetP.icc ..\..\src\Inventor\Qt\SoQtGLWidgetP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\moc_SoQtP.icc ..\..\src\Inventor\Qt\SoQtP.h
"%QTDIR%\bin\moc.exe" -o src\Inventor\Qt\moc_SoQtSignalThread.icc ..\..\src\Inventor\Qt\SoQtSignalThread.h

zlib

Download the zlib source code and extract the archive. Open a "Visual Studio x64 Win64 Command Prompt (2010)" and change into the directory of the extracted source. Compile the binaries by running the following command.

nmake -f win32\Makefile.msc

Create a directory C:\Program Files\zlib and copy the file zlib1.dll into a subdirectory bin, the files zconf.h and zlib.h into a subdirectory include, and the file zlib.lib into a subdirectory lib. Afterwards, make sure to add the folder C:\Program Files\zlib\bin to the system's PATH variable.