Installation from Sources

Dependencies

Asio and TinyXML2 libraries

On Linux, you can install these libraries using the package manager of your Linux distribution. For example, on Ubuntu you can install them by using its package manager with the next command.

sudo apt install libasio-dev libtinyxml2-dev

On Windows, you can install these libraries using Chocolatey. First, download the following chocolatey packages from this ROS2 Github repository.

  • asio.1.12.1.nupkg
  • tinyxml2.6.0.0.nupkg

Once these packages are downloaded, open an administrative shell and execute the following command:

choco install -y -s <PATH\TO\DOWNLOADS\> asio tinyxml2

Please replace <PATH\TO\DOWNLOADS> with the folder you downloaded the packages to.

Colcon installation

colcon is a command line tool to build sets of software packages. This section explains to use it to compile easily Fast-RTPS and its dependencies. First install ROS2 development tools (colcon and vcstool):

pip install -U colcon-common-extensions vcstool

Download the repos file that will be used to download Fast RTPS and its dependencies:

$ wget https://raw.githubusercontent.com/eProsima/Fast-RTPS/master/fastrtps.repos
$ mkdir src
$ vcs import src < fastrtps.repos

Finally, use colcon to compile all software:

$ colcon build

Manual installation

Before compiling manually Fast RTPS you need to clone the following dependencies and compile them using CMake.

  • Fast CDR

    $ git clone https://github.com/eProsima/Fast-CDR.git
    $ mkdir Fast-CDR/build && cd Fast-CDR/build
    $ cmake ..
    $ cmake --build . --target install
    
  • Foonathan memory

    $ git clone https://github.com/foonathan/memory.git
    $ cd memory
    $ git submodule update --init --recursive
    $ mkdir build && cd build
    $ cmake ..
    $ cmake --build . --target install
    

Once all dependencies are installed, you will be able to compile and install Fast RTPS.

$ git clone https://github.com/eProsima/Fast-RTPS.git
$ mkdir Fast-RTPS/build && cd Fast-RTPS/build
$ cmake ..
$ cmake --build . --target install

If you want to compile fastrtpsgen java application, you will need to add the argument -DBUILD_JAVA=ON when calling CMake (see Compile).

If you want to compile the examples, you will need to add the argument -DCOMPILE_EXAMPLES=ON when calling CMake.

If you want to compile the performance tests, you will need to add the argument -DPERFORMANCE_TESTS=ON when calling CMake.

For generate fastrtpsgen please see Compile.

Security

By default, Fast RTPS doesn’t compile security support. You can activate it adding -DSECURITY=ON at CMake configuration step. More information about security on Fast RTPS, see Security.

When security is activated on compilation Fast RTPS builds several built-in security plug-ins. Some of them have the dependency of OpenSSL library.

OpenSSL installation on Linux

Surely you can install OpenSSL using the package manager of your Linux distribution. For example, on Ubuntu you can install OpenSSL using its package manager with next command.

sudo apt install libssl-dev

OpenSSL installation on Windows

You can download OpenSSL 1.0.2 for Windows in this webpage. This is the OpenSSL version tested by our team. Download and use the installer that fits your requirements. After installing, add the environment variable OPENSSL_ROOT_DIR pointing to the installation root directory. For example:

OPENSSL_ROOT_DIR=C:\OpenSSL-Win64