1. Linux installation from sources

This page explains how to install eProsima Fast DDS Spy and its required dependencies from sources.

1.1. Dependencies installation

Fast DDS Spy depends on the eProsima Fast DDS library and some Debian packages. This section describes how to install the Fast DDS Spy dependencies and requirements in a Linux 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.

  • fastdds, the core library of eProsima Fast DDS.

  • 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, meet the Requirements and Dependencies detailed below. Then follow either the colcon or the CMake installation instructions.

1.1.1. Requirements

Installing eProsima Fast DDS Spy from sources in a Linux environment requires the following tools to be installed in the system:

1.1.1.1. CMake, g++, pip, wget and git

These packages provide the tools required to install eProsima Fast DDS Spy and its dependencies from the command line. Install CMake, g++, pip, wget and git using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:

sudo apt install cmake g++ pip wget git

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

1.1.1.3. Gtest

Gtest is a unit testing library for C++. By default, eProsima Fast DDS Spy does not compile tests. It is possible to activate them with the appropriate CMake options when calling colcon or CMake. For more details, please refer to the CMake options section. For a detailed description of the Gtest installation process, please refer to the Gtest Installation Guide.

It is also possible to clone the Gtest GitHub repository into the eProsima Fast DDS Spy workspace and compile it with colcon as a dependency package. Use the following command to download the code:

git clone --branch release-1.12.0 https://github.com/google/googletest src/googletest-distribution

1.1.2. Dependencies

When installed from sources in a Linux environment, eProsima Fast DDS Spy has the following dependencies:

1.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. Install these libraries using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:

sudo apt install libasio-dev libtinyxml2-dev

1.1.2.2. OpenSSL

OpenSSL is a toolkit for the TLS and SSL protocols and a general-purpose cryptography library. Install OpenSSL using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:

sudo apt install libssl-dev

1.1.2.3. yaml-cpp

yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec, and the Fast DDS Spy application uses it to parse the provided configuration files. Install yaml-cpp using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:

sudo apt install libyaml-cpp-dev

1.1.2.4. eProsima dependencies

If the Fast DDS and DDS Pipe libraries are already installed in the system, source these libraries when building eProsima Fast DDS Spy by running the following commands. Otherwise, skip this step.

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

1.2. Colcon installation

  1. Create a fastdds-spy directory and download the .repos file that will be used to install eProsima Fast DDS Spy and its dependencies:

    mkdir -p ~/fastdds-spy/src
    cd ~/fastdds-spy
    wget https://raw.githubusercontent.com/eProsima/Fast-DDS-Spy/main/fastddsspy.repos
    vcs import src < fastddsspy.repos
    

    Note

    If there is already a Fast DDS installation in the system, it is not required to download and build every dependency in the .repos file. It is enough to download and build the eProsima Fast DDS Spy project after sourcing its dependencies. Refer to section eProsima dependencies to check how to source the Fast DDS library.

  2. Build the packages:

    colcon build --packages-up-to-regex fastddsspy
    

Note

Since colcon is based on CMake, the CMake configuration options can be passed to the colcon build command. For more information on the specific syntax, please refer to the CMake specific arguments page of the colcon manual.

1.3. CMake installation

Fast DDS Spy can also be installed with CMake, as described in the following section. However, the Colcon installation is recommended.

1.4. Run an application

To run the Fast DDS Spy tool, source the installation path and run the executable installed in <install-path>/fastddsspy_tool/bin/fastddsspy:

# If built has been done using colcon, all projects could be sourced as follows
source install/setup.bash
fastddsspy

Make sure that this executable has execution permissions.

1.5. Run tests

Tests are not built by default. To build them, pass the BUILD_TESTS CMake option to the colcon build command:

colcon build --packages-up-to-regex fastddsspy --cmake-args -DBUILD_TESTS=ON

Once built, run the test suite with:

colcon test --packages-select-regex fastddsspy --event-handlers console_direct+

Note

Some tests carry the xfail label and are expected to fail. To exclude them, forward the label filter to ctest: colcon test --packages-select-regex fastddsspy --ctest-args --label-exclude "xfail".