eclipse-iceoryx / eclipse-iceoryx/iceoryx

Setting RPATH for iceoryx artifacts

Open
#1,287 3 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
C++
Stars
2.2k
Forks
492
Avg merge
18h 57m
Merged PRs (30d)
1

Description

## Brief feature description

Setting the RPATH in cmake makes it easier to use iceoryx build as dynamic lib since the path to the lib will be stored in RouDi and the examples.

## Detailed information

Building iceoryx as dynamic lib and using it is cumbersome since one has to add the installation path to the `LD_LIBRARY_PATH`/`DYLD_LIBRARY_PATH`. Setting the RPATH removes this additional step by embedding the path to the libraries inside the binaries.

Additional information:
- https://dev.my-gate.net/2021/08/04/understanding-rpath-with-cmake/
- https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling

Instead of setting the absolute path with `${CMAKE_INSTALL_PREFIX}/lib` we should consider using relative paths like `$ORIGIN/../${CMAKE_INSTALL_LIBDIR}` or `@loader_path/../${CMAKE_INSTALL_LIBDIR}` on macOS. This has the advantage that the install directory can be copied and the binaries still find the correct libraries

## Todo

1. [ ] Refactor all `CMakeLists.txt` so that they use the iceoryx wrappers `iox_add_library` or `iox_add_executable`
2. [ ] Set `RPATH` in the iceoryx wrappers correctly
3. [ ] Remove compiler warning exceptions for tests in cmake (`-Wno-pedantic -Wno-conversion`)
4. [ ] Adjust build destination for all iceoryx modules (destination should be equal to project name, see `iceoryx_posh` is build in `build/posh`.
5. [ ] Set correct stack size for `APPLE` platform in `iox_add_executable`.
6. [ ] Implement `RPATH` auto detection to solve posh dependencies in hoofs. See comment: https://github.com/eclipse-iceoryx/iceoryx/pull/1357#discussion_r875731112

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the repository's CMakeLists.txt files and the iox_add_library and iox_add_executable wrappers. Check the merged pull request #1385 and the linked RPATH references for the current state of this work. Done means the wrappers set appropriate platform-aware RPATHs and the listed CMake cleanup and build-destination tasks are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.