1. Linux installation from sources

The instructions for installing the eProsima Fast DDS Statistics Backend from sources are provided in this page. It is organized as follows:

1.1. Fast DDS Statistics Backend installation

This section describes the instructions for installing eProsima Fast DDS Statistics Backend in a Linux environment from sources. 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.

1.1.1. Requirements

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

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

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

sudo apt install cmake g++ python3-pip wget git

1.1.1.2. Gtest

Gtest is a unit testing library for C++. By default, eProsima Fast DDS Statistics Backend 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. For a detailed description of the Gtest installation process, please refer to the Gtest Installation Guide.

Note

eProsima Fast DDS Statistics Backend depends on Gtest release-1.10.0 or later.

1.1.2. Dependencies

eProsima Fast DDS Statistics Backend has the following dependencies in a Linux environment:

1.1.2.1. eProsima Fast DDS

Please, refer to the eProsima Fast DDS installation documentation to learn the installing procedure

1.1.3. Colcon installation

colcon is a command line tool based on CMake aimed at building sets of software packages. This section explains how to use it to compile eProsima Fast DDS Statistics Backend and its dependencies.

  1. 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. Create a Fast-DDS-statistics-backend directory and download the repos file that will be used to install eProsima Fast DDS Statistics Backend and its dependencies:

    mkdir ~/Fast-DDS-statistics-backend
    cd ~/Fast-DDS-statistics-backend
    wget https://raw.githubusercontent.com/eProsima/Fast-DDS-statistics-backend/master/fastdds_statistics_backend.repos
    mkdir src
    vcs import src < fastdds_statistics_backend.repos
    
  3. Build the packages:

    colcon build
    

Note

Being based on CMake, it is possible to pass the CMake configuration options to the colcon build command. For more information on the specific syntax, please refer to the CMake specific arguments page of the colcon manual.

Instead of passing CMake configuration options on the CLI, it is also possible to use a colcon.meta file to set the configuration. The eProsima Fast DDS Statistics Backend repository already includes a colcon.meta file with the default configuration, which can be tuned by the user.

1.1.4. CMake installation

This section explains how to compile eProsima Fast DDS Statistics Backend with CMake, either locally or globally.

1.1.4.1. Local installation

  1. Follow the eProsima Fast DDS local installation guide to install eProsmia Fast DDS and all its dependencies

  2. Install eProsima Fast DDS Statistics Backend:

    cd ~/Fast-DDS
    git clone https://github.com/eProsima/Fast-DDS-statistics-backend.git
    mkdir Fast-DDS-statistics-backend/build
    cd Fast-DDS-statistics-backend/build
    cmake ..  -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install -DCMAKE_PREFIX_PATH=~/Fast-DDS/install
    sudo cmake --build . --target install
    

Note

By default, eProsima Fast DDS Statistics Backend does not compile tests. However, they can be activated by downloading and installing Gtest, and enabling the corresponding cmake option.

1.1.4.2. Global installation

  1. Follow the eProsima Fast DDS global installation guide to install eProsmia Fast DDS and all its dependencies

  2. Install eProsima Fast DDS Statistics Backend:

    cd ~/Fast-DDS
    git clone https://github.com/eProsima/Fast-DDS-statistics-backend.git
    mkdir Fast-DDS-statistics-backend/build
    cd Fast-DDS-statistics-backend/build
    cmake ..
    cmake --build . --target install
    

1.1.4.3. Run an application

When running an instance of an application using eProsima Fast DDS Statistics Backend, it must be linked with the library where the packages have been installed, which in the case of system-wide installation is: /usr/local/lib/ (if local installation is used, adjust for the correct directory). There are two possibilities:

  • Prepare the environment locally by typing the command:

    export LD_LIBRARY_PATH=/usr/local/lib/
    
  • Add it permanently it to the PATH, by typing:

    echo 'export LD_LIBRARY_PATH=/usr/local/lib/' >> ~/.bashrc