eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.69k stars 393 forks source link

Setting RPATH for iceoryx artifacts #1287

Open elBoberido opened 2 years ago

elBoberido commented 2 years ago

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:

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 commented 2 years ago

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

elBoberido commented 2 years ago

@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.

mossmaurice commented 2 years ago

Reopening due to the duplicate installation of ìceoryx_posh