iceoryx icon indicating copy to clipboard operation
iceoryx copied to clipboard

Setting RPATH for iceoryx artifacts

Open elBoberido opened this issue 2 years ago • 3 comments

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

elBoberido avatar Mar 14 '22 18:03 elBoberido

@elfenpiff is this really finished? There are some open tasks

elBoberido avatar Jun 07 '22 14:06 elBoberido

@elfenpiff It seems the PR for this issue broke the installation of the header. The iceoryx_posh header are installed in include and include/iceoryx/v2.90.0. The iceoryx_dds header are installed in include. Everything should be in include/iceoryx/v2.90.0.

Additionally the tests are also installed. This is different from before the changes. Not sure if they should also be installed.

elBoberido avatar Jun 07 '22 16:06 elBoberido

Reopening due to the duplicate installation of ìceoryx_posh

mossmaurice avatar Jun 08 '22 15:06 mossmaurice