4. Windows installation from sources¶
4.1. Fast DDS library installation¶
This section provides the instructions for installing eProsima Fast DDS in a Windows environment from sources. The following packages will be installed:
foonathan_memory_vendor, an STL compatible C++ memory allocator library.
fastcdr, a C++ library that serializes according to the standard CDR serialization mechanism.
fastrtps, the core library of eProsima Fast DDS library.
The installation of eProsima Fast DDS in a Windows environment from sources requires the following tools to be installed in the system:
22.214.171.124. Visual Studio¶
Visual Studio is required to
have a C++ compiler in the system. For this purpose, make sure to check the
Desktop development with C++ option during the Visual Studio installation process.
If Visual Studio is already installed but the Visual C++ Redistributable packages are not,
open Visual Studio and go to
Get Tools and Features and in the
Workloads tab enable
Desktop development with C++. Finally, click
Modify at the bottom right.
Chocolatey is a Windows package manager. It is needed to install some of eProsima Fast DDS’s dependencies. Download and install it directly from the website.
126.96.36.199. CMake, pip3, wget and git¶
These packages provide the tools required to install eProsima Fast DDS and its dependencies from command line.
Download and install CMake, pip3, wget and git by following the instructions detailed in the respective
Once installed, add the path to the executables to the
PATH from the
Edit the system environment variables control panel.
GTest is a unit testing library for C++. By default, eProsima Fast DDS does not compile tests. It is possible to activate them with the opportune CMake configuration options when calling colcon or CMake. For more details, please refer to the CMake options section. Also add the Gtest repository into the workspace directory.
git clone https://github.com/google/googletest src/googletest-distribution
and add next argument to the colcon call
colcon build --cmake-args -Dgtest_force_shared_crt=ON
188.8.131.52. XML validation tool¶
XML validation is a new command introduced to validate the XML profiles against an XSD schema through Fast DDS CLI. That ensures the proper characterization of the entities using the xml profiles.
For more details, please refer to the xml section.
Install the xmlschema dependency to be able to use this optional tool.
eProsima Fast RTPS has the following dependencies, when installed from sources in a Windows environment:
184.108.40.206. Asio and TinyXML2 libraries¶
Asio is a cross-platform C++ library for network and low-level I/O programming, which provides a consistent asynchronous model. TinyXML2 is a simple, small and efficient C++ XML parser. They can be downloaded directly from the links below:
After downloading these packages, open an administrative shell with PowerShell and execute the following command:
choco install -y -s <PATH_TO_DOWNLOADS> asio tinyxml2
<PATH_TO_DOWNLOADS> is the folder into which the packages have been downloaded.
OpenSSL is a robust toolkit for the TLS and SSL protocols and a general-purpose cryptography library.
Download and install the latest OpenSSL version for Windows at this
After installing, add the environment variable
OPENSSL_ROOT_DIR pointing to the installation root directory.
220.127.116.11. Libp11 and SoftHSM libraries¶
Libp11 provides PKCS#11 support for OpenSSL. This is an optional dependency, that is needed only when eprosima Fast DDS is used with security and PKCS#11 URIs.
SoftHSM is a software implementation of an HSM (Hardware Security Module). If eProsima Fast DDS tests are activated and libp11 is installed on the system, SoftHSM is additionally required to run tests of PKCS#11 features.
OpenSSL access HSM and other hardware devices through its engine functionality. In order to set up a new engine the OpenSSL configuration files must be updated specifying the libp11 and hardware module (here SoftHSM) dynamic libraries location.
OpenSSL on Windows references its default configuration file through the OPENSSL_CONF environment variable. By default OpenSSL installs two identical default configuration files:
C:\Program Files\OpenSSL-Win64\bin\cnf\openssl.cnf mimics the Linux distributions one.
C:\Program Files\OpenSSL-Win64\bin\openssl.cfg kept for backward compatibility.
Neither of them are loaded by default. In order to direct OpenSSL to load one of them or any other we must set the variable:
cmd> set OPENSSL_CONF=C:\Program Files\OpenSSL-Win64\bin\cnf\openssl.cnf powershell> $Env:OPENSSL_CONF="C:\Program Files\OpenSSL-Win64\bin\cnf\openssl.cnf"
Once we have hinted OpenSSL the configuration file to use we must modify it to set up the new PKCS#11 engine following the OpenSSL guidelines replacing the binaries path with the proper ones. For example, before any section in the configuration file we introduce:
openssl_conf = openssl_init
at the end of the file we include the engine devoted sections. Note to use POSIX path separator instead of the windows one.
[openssl_init] engines = engine_section [engine_section] pkcs11 = pkcs11_section [pkcs11_section] engine_id = pkcs11 dynamic_path = C:/Program Files/libp11/src/pkcs11.dll MODULE_PATH = C:/Program Files (x86)/SoftHSM2/lib/softhsm2-x64.dll init = 0
A proper set up can be verified using OpenSSL command line tool:
openssl engine pkcs11 -t
4.1.3. Colcon installation¶
Run colcon within a Visual Studio prompt. To do so, launch a Developer Command Prompt from the search engine.
pip3 install -U colcon-common-extensions vcstool
and add the path to the
vcsexecutable to the
PATHfrom the Edit the system environment variables control panel.
If this fails due to an Environment Error, add the
--userflag to the
Fast-DDSdirectory and download the repos file that will be used to install eProsima Fast DDS and its dependencies:
mkdir ~\Fast-DDS cd ~\Fast-DDS wget https://raw.githubusercontent.com/eProsima/Fast-DDS/master/fastrtps.repos -output fastrtps.repos mkdir src vcs import src --input fastrtps.repos
Finally, use colcon to compile all software:
Being based on CMake, it is possible to pass the CMake configuration options to the
command. For more information on the specific syntax, please refer to the
CMake specific arguments
page of the colcon manual.
18.104.22.168. Run an application¶
When running an instance of an application using eProsima Fast DDS, the colcon overlay built in the
Fast-DDS directory must be sourced.
There are two possibilities:
Every time a new shell is opened, prepare the environment locally by typing the command:
Add the sourcing of the colcon overlay permanently, by opening the Edit the system environment variables control panel, and adding
4.1.4. CMake installation¶
22.214.171.124. Local installation¶
Open a command prompt, and create a
Fast-DDSdirectory where to download and build eProsima Fast DDS and its dependencies:
Clone the following dependencies and compile them using CMake.
Fast DDS depends on Foonathan memory. To ease the dependency management, eProsima provides a vendor package Foonathan memory vendor, which downloads and builds a specific revision of Foonathan memory if the library is not found in the system.
cd %USERPROFILE%\Fast-DDS git clone https://github.com/eProsima/foonathan_memory_vendor.git cd foonathan_memory_vendor mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=%USERPROFILE%/Fast-DDS/install .. cmake --build . --target install
cd %USERPROFILE%\Fast-DDS git clone https://github.com/eProsima/Fast-CDR.git cd Fast-CDR mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=%USERPROFILE%/Fast-DDS/install .. cmake --build . --target install
Once all dependencies are installed, install eProsima Fast DDS:
cd %USERPROFILE%\Fast-DDS git clone https://github.com/eProsima/Fast-DDS.git cd Fast-DDS mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=%USERPROFILE%/Fast-DDS/install .. cmake --build . --target install
126.96.36.199. Global installation¶
To install eProsima Fast DDS system-wide instead of locally, remove the
CMAKE_INSTALL_PREFIX flags that
appear in the configuration steps of
By default, eProsima Fast DDS does not compile tests. However, they can be activated by downloading and installing Gtest.
188.8.131.52. Run an application¶
When running an instance of an application using eProsima Fast DDS, it must be linked with the library where the
packages have been installed. This can be done by opening the Edit system environment variables control panel and
adding to the
PATH the Fast DDS and Fast CDR installation directories:
Fast DDS: C:\Program Files\fastrtps
Fast CDR: C:\Program Files\fastcdr
4.2. Fast DDS-Gen installation¶
This section outlines the instructions for installing Fast DDS-Gen in a Windows environment from sources. Fast DDS-Gen is a Java application that generates source code using the data types defined in an IDL file. Please refer to Introduction for more information.
Fast DDS-Gen is built using Gradle. Gradle is an open-source build automation tool which requires a Java version to be executed (see Gradle-Java compatibility matrix).
Even though earlier versions of Gradle support Java 8, Fast DDS-Gen stopped supporting Java versions previous to Java 11 since release v2.4.0.
Fast DDS-Gen introduced support for Gradle 7 in release v2.2.0. Gradle 8 is not yet supported.
4.2.2. Compiling Fast DDS-Gen¶
In order to compile Fast DDS-Gen, an executable script is included in the repository which will download Gradle temporarily for the compilation step. Please, follow the steps below to build Fast DDS-Gen:
If Fast DDS has already been installed following Colcon installation, skip cloning Fast DDS-Gen’s
repository, as it can already be found under the
src directory within the colcon workspace.
cd ~ git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git cd Fast-DDS-Gen gradlew.bat assemble
In case that a supported Gradle version is already installed in the system, Fast DDS-Gen can also be built running directly:
Fast-DDS-Gen folder contains the following packages:
share/fastddsgen, where the generated Java application is.
scripts, containing some user friendly scripts.
To make these scripts accessible from any directory, add the
scriptsfolder path to the