All iceoryx libraries are deployed as independent CMake packages. Posh is using functions from hoofs and is depending on it. You are able to build posh and hoofs and integrate them into existing CMake projects.
- 64-bit hardware (e.g. x86_64 or aarch64; 32-bit hardware might work, but is not supported)
- CMake, 3.16 or later
- One of the following compilers:
- libacl, 2.2 or later. Only for Linux & QNX.
- optional, ncurses, 6.2 or later. Required by introspection tool (only for Linux, QNX and MacOS).
Before installing iceoryx you need to install XCode and git. Optionally, ncurses library is required for the introspection client. To install ncurses locally into your build folder follow these steps
cd iceoryx
ICEORYX_DIR=$PWD
mkdir -p build
cd build
git clone https://github.com/mirror/ncurses.git
cd ncurses
git checkout v6.2
./configure --prefix=$ICEORYX_DIR/build/dependencies/ --exec-prefix=$ICEORYX_DIR/build/dependencies/ --with-termlib
make -j12
make install
Although we strive to be fully POSIX-compliant, we recommend using Ubuntu 18.04 and at least GCC 7.5.0 for development.
You will need to install the following packages:
sudo apt install gcc g++ cmake libacl1-dev libncurses5-dev pkg-config
Additionally, there is an optional dependency to the cpptoml library, which is used to parse the RouDi config file containing mempool configuration.
QNX SDP 7.0 and 7.1 are supported (shipping with gcc 5.4 and gcc 8.3 respectively).
The easiest way to build iceoryx on QNX is by using the build script and providing a toolchain file.
We provide generic QNX SDP 7.0 toolchain files for ARM_64 and X86_64 in ./tools/toolchains/qnx
(Direct Link).
ARM_64:
./tools/iceoryx_build_test.sh -t /home/user/toolchains/qnx/qnx_sdp70_aarch64le.cmake
X86_64:
./tools/iceoryx_build_test.sh -t /home/user/toolchains/qnx/qnx_sdp70_x86_64.cmake
!!! attention
Please ensure that the folder /var/lock
exist and the filesystem supports file locking.
In case you do not have a Windows installation, Microsoft provides free developer images from here.
Additionally, CMake and git are required. The option to add CMake to the system PATH for all users should be set when it is installed.
If the developer image from Microsoft is used, Visual Studio Community 2019 is already installed, else it can be found here.
To be able to compile iceoryx, the Desktop development with C++
Workload must be installed. This is done by running VisualStudioInstaller
and selecting the Modify
button on Visual Studio Community 2019
.
Either VS Code
or Developer Command Prompt
can be used to build iceoryx with CMake. Maybe one or two restarts are required to let CMake find the compiler.
Alternatively, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
can be executed in any shell to setup all the paths for compilation.
!!! attention
A Windows SDK Version of at least 10.0.18362.0
is required.
!!! note Building with CMake is the preferred way, for more complex actions like a coverage scan is a script available (see chapter below).
The CMakeLists.txt
from iceoryx_meta
can be used to easily develop iceoryx with an IDE.
-
Clone the repository
git clone https://github.com/eclipse-iceoryx/iceoryx.git
-
Generate the necessary build files
cd iceoryx cmake -Bbuild -Hiceoryx_meta # when you have installed external dependencies like ncurses you have to add them # to your prefix path cmake -Bbuild -Hiceoryx_meta -DCMAKE_PREFIX_PATH=$(PWD)/build/dependencies/
!!! tip To build all iceoryx components add
-DBUILD_ALL=ON
to the CMake command. For Windows it is currently recommended to use thecmake -Bbuild -Hiceoryx_meta -DBUILD_TEST=ON -DINTROSPECTION=OFF -DBINDING_C=ON -DEXAMPLES=ON
instead -
Compile the source code
cmake --build build
If the compilation fails, it is possible that the compilation failure originates inside the Windows SDK and is not caused by iceoryx, see Windows vcpkg-issue #15035 In this case try to rebuild the cmake files with:
cmake -Bbuild -Hiceoryx_meta -DCMAKE_SYSTEM_VERSION=10.0.18362.0
and restart the build command
cmake --build build
.!!! tip You can speed up the build by appending
-j 4
where 4 stands for the number of parallel build processes. You can choose more or less depending on your available CPU cores on your machine. -
Install to system
Mac:
cmake --build build --target install
Linux:
sudo cmake --build build --target install
!!! tip The installation directory is usually left at its default, which is
/usr/local
!!! note iceoryx is built in release mode as static library with
-O3
optimization by default. If you want to enable debug symbols please setCMAKE_BUILD_TYPE=Deb
.
Please take a look at the CMake file build_options.cmake to get an overview of the available build options for enabling additional features.
As an alternative, we provide a build-test script which we use to integrate iceoryx into our infrastructure. The intention of the script goes beyond building iceoryx, it is also used for the code coverage scan or the address-sanitizer runs on the CI. The script currently works for Linux and QNX only, it is planned to offer a multi-platform solution.
-
Clone the repository
git clone https://github.com/eclipse-iceoryx/iceoryx.git
-
Build everything
cd iceoryx ./tools/iceoryx_build_test.sh build-all
!!! note The build script is installing the header files and binaries into
build/install/prefix
.
You can use the help
argument for getting an overview of the available options:
./tools/iceoryx_build_test.sh help
!!! tip
The examples can be built with -DEXAMPLES=ON
with iceoryx_meta or by providing the examples
argument to the build script.
Alternatively, iceoryx can be built with colcon to provide a smooth integration for ROS 2 developers. To build the iceoryx_integrationtest package one requires a minimal ROS 2 installation.
Install required ROS 2 packages:
sudo apt install ros-foxy-ros-testing ros-foxy-ros-base
source /opt/ros/foxy/setup.bash
build with colcon:
mkdir -p iceoryx_ws/src
cd $_
git clone https://github.com/eclipse-iceoryx/iceoryx.git
cd ..
colcon build
!!! note If you don't want to install ROS 2, you can skip the iceoryx_integrationtest package by calling:
```bash
colcon build --packages-skip iceoryx_integrationtest
```
This build method makes the most sense in combination with rmw_iceoryx
A second option is to build iceoryx with Bazel as an alternative build and test tool. In comparison to CMake it offers an easier syntax with better performance and a hermetic build mode for reproducible builds.
To install Bazel you can use Bazelisk.
Bazel uses workspaces and BUILD files to set up the infrastructure. You will notice
that in the root directory of iceoryx a WORKSPACE
is added that defines the workspace folder.
In general, a Bazel workspace contains the project-specific source code and build outputs.
In the corresponding iceoryx modules (e.g. iceoryx_hoofs) you will find BUILD
files
that contain instructions for Bazel to build and test targets.[1]
To build a specific target with Bazel you can use the bazel build
command:
cd iceoryx
bazel build //iceoryx_posh:iox-roudi
The //iceoryx_posh
argument is the location of the BUILD file for the package.
BUILD files can be seen similar to CMakeLists.txt files where the build targets are defined.
The iox-roudi
separated by a colon is the actual target defined in the BUILD file.
!!! tip
Using bazel build //...
will build all Bazel targets.
!!! note The names for iceoryx targets like libraries, applications and test are the same as in the CMake build system.
You will notice that four additional bazel-*
folders are created in the iceoryx root folder.
They contain the build artifacts and test log. Bazel compiles the libraries always static and
dynamic and place them into the bazel-out
folder.
Executing tests with Bazel is similar like building:
cd iceoryx
bazel test //iceoryx_hoofs/test:hoofs_moduletests
!!! tip
Using bazel test //...
will run all tests defined in Bazel.
!!! note
Logs and generated XML files with the results are automatically created and
stored within the bazel-testlogs
folder.
Bazel offers the possibility to execute binaries:
cd iceoryx
bazel run //iceoryx_posh:iox-roudi
!!! tip
Calling bazel test
or bazel run
directly without a previous bazel build
is possible and will build the necessary targets automatically.
The support for Bazel in iceoryx is work in progress but the most important libraries and applications are covered. Ideas and Remarks are always welcome, feel free to create an issue or discussion on the GitHub repository.