2. Windows installation from sources

The instructions for installing the eProsima DDS Record & Replay application from sources and its required dependencies are provided in this page. It is organized as follows:

2.1. Dependencies installation

eProsima DDS Record & Replay depends on eProsima Fast DDS library and certain Debian packages. This section describes the instructions for installing eProsima DDS Record & Replay dependencies and requirements in a Windows environment from sources. The following packages will be installed:

  • foonathan_memory_vendor, an STL compatible C++ memory allocation library.

  • fastcdr, a C++ library that serializes according to the standard CDR serialization mechanism.

  • fastrtps, the core library of eProsima Fast DDS library.

  • cmake_utils, an eProsima utils library for CMake.

  • cpp_utils, an eProsima utils library for C++.

  • ddspipe, an eProsima internal library that enables the communication of DDS interfaces.

First of all, the Requirements and Dependencies detailed below need to be met. Afterwards, the user can choose whether to follow either the colcon or the CMake installation instructions.

2.1.1. Requirements

The installation of eProsima Fast DDS in a Windows environment from sources requires the following tools to be installed in the system:

2.1.1.1. 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 Tools -> Get Tools and Features and in the Workloads tab enable Desktop development with C++. Finally, click Modify at the bottom right.

2.1.1.2. Chocolatey

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.

2.1.1.3. 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 websites. Once installed, add the path to the executables to the PATH from the Edit the system environment variables control panel.

2.1.1.4. Colcon

colcon is a command line tool based on CMake aimed at building sets of software packages. Install the ROS 2 development tools (colcon and vcstool) by executing the following command:

pip3 install -U colcon-common-extensions vcstool

Note

If this fails due to an Environment Error, add the --user flag to the pip3 installation command.

2.1.1.5. Fast DDS Python

eProsima Fast DDS Python is a Python binding for the eProsima Fast DDS C++ library. It is only required for the remote controller application.

Clone the Github repository into the eProsima DDS Record & Replay workspace and compile it with colcon as a dependency package. Use the following command to download the code:

git clone https://github.com/eProsima/Fast-DDS-python.git src/Fast-DDS-python

2.1.1.6. Gtest

Gtest is a unit testing library for C++. By default, eProsima DDS Record & Replay does not compile tests. It is possible to activate them with the opportune CMake options when calling colcon or CMake. For more details, please refer to the CMake options section.

Run the following commands on your workspace to install Gtest.

git clone https://github.com/google/googletest.git
cmake -DCMAKE_INSTALL_PREFIX='C:\Program Files\gtest' -Dgtest_force_shared_crt=ON -DBUILD_GMOCK=ON ^
    -B build\gtest -A x64 -T host=x64 googletest
cmake --build build\gtest --config Release --target install

or refer to the Gtest Installation Guide for a detailed description of the Gtest installation process.

2.1.2. Dependencies

eProsima DDS Record & Replay has the following dependencies, when installed from sources in a Windows environment:

2.1.2.1. 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

where <PATH_TO_DOWNLOADS> is the folder into which the packages have been downloaded.

2.1.2.2. OpenSSL

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 link. After installing, add the environment variable OPENSSL_ROOT_DIR pointing to the installation root directory.

For example:

OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64

2.1.2.3. yaml-cpp

yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec, and is used by DDS Record & Replay application to parse the provided configuration files. From an administrative shell with PowerShell, execute the following commands in order to download and install yaml-cpp for Windows:

git clone --branch yaml-cpp-0.7.0 https://github.com/jbeder/yaml-cpp
cmake -DCMAKE_INSTALL_PREFIX='C:\Program Files\yamlcpp' -B build\yamlcpp yaml-cpp
cmake --build build\yamlcpp --target install    # If building in Debug mode, add --config Debug

2.1.2.4. MCAP dependencies

MCAP is a modular container format and logging library for pub/sub messages with arbitrary message serialization. It is primarily intended for use in robotics applications, and works well under various workloads, resource constraints, and durability requirements. MCAP C++ library is packed within DDS Record & Replay as a header-only, but its dependencies need to be installed using the appropriate Windows package manager.

It is recommended to use vcpkg dependency manager to install LZ4 and zstd dependencies. Once both dependencies are installed, add the directory where the binaries are located to the PATH. The installed binaries are usually located under <path\to\vcpkg>/\installed\x64-windows\bin directory.

Note

To work with MCAP files via command line interface, you can use MCAP CLI <https://mcap.dev/guides/cli> _ to manage the data in MCAP files.

2.1.2.5. SWIG

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. It is leveraged by Fast DDS Python to generate a Python wrapper over Fast DDS library. SWIG is only a requirement for the remote controller application. Download and install SWIG for Windows, choosing one of the releases available at their website.

2.1.2.6. PyQt6

The eProsima DDS Record & Replay remote controller is a graphical user interface application implemented in Python using PyQt6. To install PyQt6 simply run:

pip3 install PyQt6

2.1.2.7. eProsima dependencies

If it already exists in the system an installation of Fast DDS and DDS Pipe libraries, just source this libraries when building the eProsima DDS Record & Replay application by using the command:

source <fastdds-installation-path>/install/setup.bash
source <ddspipe-installation-path>/install/setup.bash

In other case, just skip this step.

2.3. CMake installation

This section explains how to compile eProsima DDS Record & Replay with CMake, either locally or globally.

2.3.1. Local installation

  1. Open a command prompt, and create a DDS-Record-Replay directory where to download and build eProsima DDS Record & Replay and its dependencies:

    mkdir <path\to\user\workspace>\DDS-Record-Replay
    mkdir <path\to\user\workspace>\DDS-Record-Replay\src
    mkdir <path\to\user\workspace>\DDS-Record-Replay\build
    cd <path\to\user\workspace>\DDS-Record-Replay
    wget https://raw.githubusercontent.com/eProsima/DDS-Record-Replay/main/ddsrecordreplay.repos ddsrecordreplay.repos
    vcs import src < ddsrecordreplay.repos
    
  2. Compile all dependencies using CMake.

    • Foonathan memory

      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\foonathan_memory_vendor
      cd build\foonathan_memory_vendor
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\foonathan_memory_vendor -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
          -DBUILD_SHARED_LIBS=ON
      cmake --build . --config Release --target install
      
    • Fast CDR

      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\fastcdr
      cd build\fastcdr
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\fastcdr -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --config Release --target install
      
    • Fast DDS

      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\fastdds
      cd build\fastdds
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\fastdds -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
          -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --config Release --target install
      
    • Dev Utils

      # CMake Utils
      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\cmake_utils
      cd build\cmake_utils
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\dev-utils\cmake_utils -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
          -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --config Release --target install
      
      # C++ Utils
      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\cpp_utils
      cd build\cpp_utils
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\dev-utils\cpp_utils -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
          -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --config Release --target install
      
    • DDS Pipe

      # ddspipe_core
      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\ddspipe_core
      cd build\ddspipe_core
      cmake cd <path\to\user\workspace>\DDS-Record-Replay\src\ddspipe\ddspipe_core -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --target install
      
      # ddspipe_yaml
      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\ddspipe_yaml
      cd build\ddspipe_yaml
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddspipe\ddspipe_yaml -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --target install
      
      # ddspipe_participants
      cd <path\to\user\workspace>\DDS-Record-Replay
      mkdir build\ddspipe_participants
      cd build\ddspipe_participants
      cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddspipe\ddspipe_participants -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
      cmake --build . --target install
      
  3. Once all dependencies are installed, install eProsima DDS Record & Replay:

    # ddsrecorder_participants
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\ddsrecorder_participants
    cd build\ddsrecorder_participants
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddsrecorder\ddsrecorder_participants ^
        -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
    cmake --build . --config Release --target install
    
    # ddsrecorder_yaml
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\ddsrecorder_yaml
    cd build\ddsrecorder_yaml
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddsrecorder\ddsrecorder_yaml -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
        -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
    cmake --build . --config Release --target install
    
    # ddsrecorder
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\ddsrecorder_tool
    cd build\ddsrecorder_tool
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddsrecorder\ddsrecorder -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
        -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
    cmake --build . --config Release --target install
    
    # ddsreplayer
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\ddsreplayer_tool
    cd build\ddsreplayer_tool
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\ddsrecorder\ddsreplayer -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
        -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
    cmake --build . --config Release --target install
    

    Note

    By default, eProsima DDS Record & Replay does not compile tests. However, they can be activated by downloading and installing Gtest and building with CMake option -DBUILD_TESTS=ON.

  4. Optionally, install the remote controller application along with its dependency Fast DDS Python:

    # Fast DDS Python
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\fastdds_python
    cd build\fastdds_python
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\Fast-DDS-python\fastdds_python -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
        -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install
    cmake --build . --config Release --target install
    
    # Remote Controller Application
    cd <path\to\user\workspace>\DDS-Record-Replay
    mkdir build\controller_tool
    cd build\controller_tool
    cmake <path\to\user\workspace>\DDS-Record-Replay\src\controller\controller_tool -DCMAKE_INSTALL_PREFIX=<path\to\user\workspace>\DDS-Record-Replay\install ^
        -DCMAKE_PREFIX_PATH=<path\to\user\workspace>\DDS-Record-Replay\install -DBUILD_DDSRECORDER_CONTROLLER=ON
    cmake --build . --config Release --target install
    

2.3.2. Global installation

To install eProsima DDS Record & Replay system-wide instead of locally, remove all the flags that appear in the configuration steps of Fast-CDR, Fast-DDS, Dev-Utils, DDS-Pipe, and DDS-Record-Replay

2.4. Run an application

If eProsima DDS Record & Replay was compiled using colcon, when running an instance of DDS Recorder or DDS Replayer, the colcon overlay built in the dedicated DDS-Record-Replay directory must be sourced. There are two possibilities:

  • Every time a new shell is opened, prepare the environment locally by typing the command:

    setup.bat
    
  • Add the sourcing of the colcon overlay permanently, by opening the Edit the system environment variables control panel, and adding the installation path to the PATH.

However, when running a DDS Recorder or DDS Replayer compiled using CMake, it must be linked with its dependencies where the packages have been installed. This can be done by opening the Edit system environment variables control panel and adding to the PATH eProsima DDS Record & Replay installation directory: <path\to\user\workspace>\DDS-Record-Replay\install.