eclipse-zenoh / zenoh-plugin-dds

A zenoh plug-in that allows to transparently route DDS data. This plugin can be used by DDS applications, such as ROS2 robotic applications and others, to leverage the zenoh for geographical routing or for better scaling discovery.
Other
159 stars 57 forks source link

[Bug] Unable to build with the latest zenoh-plugin-dds #101

Closed evshary closed 1 year ago

evshary commented 1 year ago

Describe the bug

While building the latest version of zenoh-plugin-dds, it causes the following error:

.....
   Compiling cyclors v0.1.5
error: failed to run custom build command for `cyclors v0.1.5`

Caused by:
  process didn't exit successfully: `/home/ros/zenoh-plugin-dds/target/release/build/cyclors-073c38f7381a1401/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_IDLC=OFF" "-DBUILD_DDSPERF=OFF" "-DENABLE_SSL=NO" "-DENABLE_SECURITY=NO" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_PREFIX=/home/ros/zenoh-plugin-dds/target/release/build/cyclors-662b0f66ac098368/out/cyclonedds-build" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  -- Building without OMG DDS Security support
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/ros/zenoh-plugin-dds/target/release/build/cyclors-662b0f66ac098368/out/cyclonedds-build/build
  running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--parallel" "12"
  [  0%] Built target _confgen
  [ 21%] Built target ddsrt-internal
  [ 21%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_serdata_default.c.o
  [ 21%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_security_omg.c.o
  [ 21%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_serdata_plist.c.o
  [ 22%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_sertype_default.c.o
  [ 23%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_pmd.c.o
  [ 23%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_entity_index.c.o
  [ 24%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_deliver_locally.c.o
  [ 24%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_deadline.c.o
  [ 25%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_plist.c.o
  [ 26%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_config.c.o
  [ 26%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_cdrstream.c.o
  [ 27%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_time.c.o
  [ 27%] Building C object src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_ownip.c.o

  --- stderr
  make: warning: -j12 forced in submake: resetting jobserver mode.
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/q_xmsg.h:24,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_plist.c:31:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:479: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_plist.c.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/q_xmsg.h:24,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_sertype_default.c:37:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/q_xmsg.h:24,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_serdata_plist.c:29:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_serdata_default.c:30:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/q_xmsg.h:24,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_security_omg.h:25,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_security_omg.c:3920:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:271: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_serdata_plist.c.o] Error 1
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:297: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_sertype_default.c.o] Error 1
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:245: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_serdata_default.c.o] Error 1
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsc/src/dds__types.h:26,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsc/src/dds__alloc.h:15,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_cdrstream.c:23:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:193: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_security_omg.c.o] Error 1
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:492: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_cdrstream.c.o] Error 1
  In file included from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/q_xmsg.h:24,
                   from /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/src/ddsi_pmd.c:32:
  /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclors-0.1.5/cyclonedds/src/core/ddsi/include/dds/ddsi/ddsi_shm_transport.h:27:10: fatal error: iceoryx_binding_c/config.h: No such file or directory
     27 | #include "iceoryx_binding_c/config.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:427: src/core/CMakeFiles/ddsc.dir/ddsi/src/ddsi_pmd.c.o] Error 1
  make[1]: *** [CMakeFiles/Makefile2:310: src/core/CMakeFiles/ddsc.dir/all] Error 2
  make: *** [Makefile:152: all] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /home/ros/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I guess the error is from the commit Use new cyclors. If I use the previous commit, the error disappears.

To reproduce

  1. Get the code from GitHub
  2. Build standalone executable
    cargo build --release -p zenoh-bridge-dds

System info

evshary commented 1 year ago

Thanks for @JEnoch 's solution. It seems like I can't source ROS environment first. ROS environment includes CycloneDDS and iceoryx. If I built zenoh-bridge-dds with this, it'll try to build with iceoryx and will fail. However, I still fail to build zenoh-bridge-dds with the following error:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcsKR4eT/symbols.o" "/home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/home/ros/zenoh-plugin-dds/target/release/deps" "-L" "/home/ros/zenoh-plugin-dds/target/release/build/ring-b7127fa6e8b7f748/out" "-L" "/home/ros/zenoh-plugin-dds/target/release/build/blake3-60e3804d50dd7f29/out" "-L" "/home/ros/zenoh-plugin-dds/target/release/build/blake3-60e3804d50dd7f29/out" "-L" "/home/ros/zenoh-plugin-dds/target/release/build/cyclors-662b0f66ac098368/out/cyclonedds-build/lib" "-L" "/home/ros/zenoh-plugin-dds/target/release/build/cyclors-662b0f66ac098368/out/cyclocut-build/lib" "-L" "/home/ros/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcsKR4eT/libblake3-50e98199e1b8d584.rlib" "/tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib" "/tmp/rustcsKR4eT/libring-944069f5d5422c53.rlib" "/home/ros/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-272ca28f0b8538d5.rlib" "-Wl,-Bdynamic" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/ros/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::dds_mgt::on_data':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0x27): undefined reference to `dds_get_participant'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0x43): undefined reference to `dds_get_instance_handle'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0xf3): undefined reference to `dds_take'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0x7d8): undefined reference to `dds_qget_reliability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0x984): undefined reference to `dds_qget_reliability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds7dds_mgt7on_data17h090b60bcae13ba7aE+0xf4f): undefined reference to `dds_return_loan'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::qos::Qos::from_qos_native_with_reliability':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x38): undefined reference to `dds_qget_durability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x128): undefined reference to `dds_qget_durability_service'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x203): undefined reference to `dds_qget_deadline'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x234): undefined reference to `dds_qget_latency_budget'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x267): undefined reference to `dds_qget_ownership'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x2d7): undefined reference to `dds_qget_liveliness'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x333): undefined reference to `dds_qget_destination_order'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x386): undefined reference to `dds_qget_history'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos32from_qos_native_with_reliability17h292227655b83d169E+0x40a): undefined reference to `dds_qget_partition'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::qos::Qos::to_qos_native':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x16): undefined reference to `dds_qos_create'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x2d): undefined reference to `dds_qset_reliability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x3c): undefined reference to `dds_qset_durability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x66): undefined reference to `dds_qset_durability_service'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x74): undefined reference to `dds_qset_deadline'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x82): undefined reference to `dds_qset_latency_budget'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x91): undefined reference to `dds_qset_ownership'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0xa5): undefined reference to `dds_qset_liveliness'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0xb4): undefined reference to `dds_qset_destination_order'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0xc8): undefined reference to `dds_qset_history'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x2a3): undefined reference to `dds_qset_partition'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds3qos3Qos13to_qos_native17h150d60e8dc07507fE+0x326): undefined reference to `dds_qset_ignorelocal'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `async_task::raw::RawTask<F,T,S>::run':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN10async_task3raw24RawTask$LT$F$C$T$C$S$GT$3run17hfa5511a7a16bfa70E+0x184): undefined reference to `dds_get_instance_handle'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN10async_task3raw24RawTask$LT$F$C$T$C$S$GT$3run17hfa5511a7a16bfa70E+0x24a6): undefined reference to `dds_get_instance_handle'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::ros_discovery::RosDiscoveryInfoMgr::write':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds13ros_discovery19RosDiscoveryInfoMgr5write17he1d9d531161f3257E+0xfaa): undefined reference to `dds_writecdr'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `async_task::raw::RawTask<F,T,S>::run':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN10async_task3raw24RawTask$LT$F$C$T$C$S$GT$3run17h7ece5f17c511e30eE+0xfdc): undefined reference to `dds_create_participant'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN10async_task3raw24RawTask$LT$F$C$T$C$S$GT$3run17h7ece5f17c511e30eE+0x101f): undefined reference to `dds_get_guid'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `core::ptr::drop_in_place<async_std::task::builder::SupportTaskLocals<core::future::from_generator::GenFuture<zplugin_dds::run::{{closure}}>>>':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN4core3ptr164drop_in_place$LT$async_std..task..builder..SupportTaskLocals$LT$core..future..from_generator..GenFuture$LT$zplugin_dds..run..$u7b$$u7b$closure$u7d$$u7d$$GT$$GT$$GT$17ha5126fbd98d56ee3E+0xdcf): undefined reference to `dds_delete'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN4core3ptr164drop_in_place$LT$async_std..task..builder..SupportTaskLocals$LT$core..future..from_generator..GenFuture$LT$zplugin_dds..run..$u7b$$u7b$closure$u7d$$u7d$$GT$$GT$$GT$17ha5126fbd98d56ee3E+0xfac): undefined reference to `dds_delete'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::DdsPluginRuntime::run::{{closure}}':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime3run28_$u7b$$u7b$closure$u7d$$u7d$17h4ab97d0a67fbf470E+0x2c44): undefined reference to `dds_create_listener'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime3run28_$u7b$$u7b$closure$u7d$$u7d$17h4ab97d0a67fbf470E+0x2c55): undefined reference to `dds_lset_data_available'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime3run28_$u7b$$u7b$closure$u7d$$u7d$17h4ab97d0a67fbf470E+0x2c65): undefined reference to `dds_create_reader'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime3run28_$u7b$$u7b$closure$u7d$$u7d$17h4ab97d0a67fbf470E+0x2c7e): undefined reference to `dds_create_listener'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h50f2113b0c43b380E+0xb71): undefined reference to `dds_create_writer'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h50f2113b0c43b380E+0xb7c): undefined reference to `dds_delete_qos'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h50f2113b0c43b380E+0xbba): undefined reference to `dds_strretcode'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h50f2113b0c43b380E+0xf22): undefined reference to `dds_get_guid'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x17d2): undefined reference to `dds_create_reader'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x1897): undefined reference to `dds_create_listener'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x18aa): undefined reference to `dds_lset_data_available'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x18cb): undefined reference to `dds_create_reader'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x18d6): undefined reference to `dds_delete_qos'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x18eb): undefined reference to `dds_reader_wait_for_historical_data'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x1b18): undefined reference to `dds_strretcode'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x23d8): undefined reference to `dds_get_guid'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h1d61367380beddafE+0x252e): undefined reference to `dds_strretcode'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `core::ptr::drop_in_place<zplugin_dds::ToDdsRoute>':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN4core3ptr44drop_in_place$LT$zplugin_dds..ToDdsRoute$GT$17h4992a23449199cbdE+0x1b): undefined reference to `dds_delete'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `core::ptr::drop_in_place<zplugin_dds::FromDdsRoute>':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN4core3ptr46drop_in_place$LT$zplugin_dds..FromDdsRoute$GT$17h8d431f88cf52e96bE+0x1b): undefined reference to `dds_delete'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::DdsPluginRuntime::run_fwd_discovery_mode::{{closure}}':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x1f10): undefined reference to `dds_qos_create'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x1f46): undefined reference to `dds_qget_reliability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x1fea): undefined reference to `dds_create_reader'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x1ff6): undefined reference to `dds_delete_qos'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x2006): undefined reference to `dds_qos_create'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x203c): undefined reference to `dds_qget_reliability'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x206f): undefined reference to `dds_strretcode'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x21d5): undefined reference to `dds_create_writer'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x21e0): undefined reference to `dds_delete_qos'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x231d): undefined reference to `dds_strretcode'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x3434): undefined reference to `dds_get_guid'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x79ee): undefined reference to `dds_get_guid'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime22run_fwd_discovery_mode28_$u7b$$u7b$closure$u7d$$u7d$17he42e82f521725dd1E+0x88ee): undefined reference to `dds_get_guid'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::DdsPluginRuntime::remap_entities_info':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime19remap_entities_info17h2f9d3616a2123260E+0x44a): undefined reference to `dds_get_guid'
          /usr/bin/ld: zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime19remap_entities_info17h2f9d3616a2123260E+0xdea): undefined reference to `dds_get_guid'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::DdsPluginRuntime::try_add_route_to_dds::{{closure}}::{{closure}}':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds16DdsPluginRuntime20try_add_route_to_dds28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17h5bebed5c7510faa0E+0x4ab): undefined reference to `dds_writecdr'
          /usr/bin/ld: /home/ros/zenoh-plugin-dds/target/release/deps/zenoh_bridge_dds-81ed62f3e2c6e910.zenoh_bridge_dds.ff90c0dd-cgu.0.rcgu.o: in function `zplugin_dds::serialize_entity_guid':
          zenoh_bridge_dds.ff90c0dd-cgu.0:(.text._ZN11zplugin_dds21serialize_entity_guid17h6f4349ba8baf4c9dE+0x27): undefined reference to `dds_get_guid'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_serdata_to_typeless':
          cdds_blob.c:(.text.cdds_serdata_to_typeless+0x28): undefined reference to `ddsi_serdata_init'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_serdata_from_ser_iov':
          cdds_blob.c:(.text.cdds_serdata_from_ser_iov+0x38): undefined reference to `ddsi_serdata_init'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_serdata_from_ser':
          cdds_blob.c:(.text.cdds_serdata_from_ser+0x2f): undefined reference to `ddsi_serdata_init'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_sertype_free':
          cdds_blob.c:(.text.cdds_sertype_free+0x9): undefined reference to `ddsi_sertype_fini'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_ddsi_payload_create':
          cdds_blob.c:(.text.cdds_ddsi_payload_create+0x2d): undefined reference to `ddsi_serdata_init'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_create_blob_sertype':
          cdds_blob.c:(.text.cdds_create_blob_sertype+0x33): undefined reference to `ddsi_sertype_init'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_create_blob_topic':
          cdds_blob.c:(.text.cdds_create_blob_topic+0x4f): undefined reference to `ddsi_sertype_init'
          /usr/bin/ld: cdds_blob.c:(.text.cdds_create_blob_topic+0x64): undefined reference to `dds_create_topic_sertype'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_take_blob':
          cdds_blob.c:(.text.cdds_take_blob+0x13): undefined reference to `dds_takecdr'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o): in function `cdds_sertype_unref':
          cdds_blob.c:(.text.cdds_sertype_unref+0x5): undefined reference to `ddsi_sertype_unref'
          /usr/bin/ld: /tmp/rustcsKR4eT/libcyclors-a3fe6eb29282c4bd.rlib(cdds_blob.c.o):(.data.rel.ro.cdds_sertype_ops+0x0): undefined reference to `ddsi_sertype_v0'
          collect2: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `zenoh-bridge-dds` due to previous error
JEnoch commented 1 year ago

Analysing the differences of build flags between CycloneDDS 0.7.0 and 0.10.2 I found the cause are the new -flto -fno-fat-lto-objects flags introduced in CycloneDDS 0.10.2 build. Those can be deactivated configuring CycloneDDS CMake with ENABLE_LTO=no. And doing this, the build succeeds.

This requires flag has to be set in cyclors build and a new version of it shall be released.

evshary commented 1 year ago

Thank you @JEnoch I can now build the latest zenoh-bridge-dds successfully! I'll close the issue.

JEnoch commented 1 year ago

Fixed by 11212d6b5e20947d643ab5547b0c1ef0c09c5323