2. Windows installation from sources¶
2.1. Sub-packages¶
The AML-IP is constituted of several sub-packages. Depending on the use of those packages, some or all of them must be built. These are the packages of AML-IP and the dependencies between them:
Sub-package |
Description |
Depends on |
---|---|---|
|
Main C++ library with the implementation and API to create AML-IP Nodes. |
|
|
Project to auto-generate a Python library from |
|
|
Main Python library with API to create AML-IP Nodes. |
|
|
Sphinx documentation project. |
2.2. Dependencies¶
The installation of eProsima AML-IP in a Windows environment from sources requires the following tools to be installed in the system:
2.2.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.2.2. Chocolatey¶
Chocolatey is a Windows package manager. It is needed to install some of eProsima AML-IP’s dependencies. Download and install it directly from the website.
2.2.3. CMake, pip3, wget and git¶
These packages provide the tools required to install eProsima AML-IP 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.2.4. 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.2.5. 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.2.6. yaml-cpp¶
yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec, and is used by DDS Router 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.2.7. SWIG¶
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
In this project, it is used to wrap amlip_cpp
C++ API to generate a Python library.
Install SWIG using the package manager of the appropriate Linux distribution.
For example, on Ubuntu use the command:
choco install swig --allow-downgrade --version=4.0.2.04082020
2.2.8. 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.2.9. Gtest¶
Gtest is a unit testing library for C++. By default, DDS Router 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.2.10. eProsima dependencies¶
These are the eProsima libraries required for building AML-IP:
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 utilities library for CMake.cpp_utils
, an eProsima utilities library for C++.ddsrouter_core
, the eProsima DDS Router library C++.
If it already exists in the system an installation of these libraries there is no need to build them again,
just source them when building the AML-IP.
If using CMake, add the already libraries installation paths to PATH
.
If using colcon, use the following command to source them:
source <eprosima-dependencies-installation-path>/install/setup.bat