ros2 / rmw_zenoh

RMW for ROS 2 using Zenoh as the middleware
Apache License 2.0
144 stars 29 forks source link

Cannot compile in debug mode #165

Closed Timple closed 2 months ago

Timple commented 2 months ago

We typically have a colcon defaults file containing:

 - "-DCMAKE_BUILD_TYPE=Debug"
 - "-DCMAKE_CXX_FLAGS=-O2"

In order to still catch asserts in our code. However rmw_zenoh doesn't compile with these settings. With RelWithDebInfo it does.

clalancette commented 2 months ago

Hm, I just tried it here, and it seems to compile for me:

colcon build --event-handler console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 --packages-select rmw_zenoh_cpp

In this test, I was on Ubuntu 22.04, building against Iron. Can you give me more information about your setup?

Timple commented 2 months ago

I can, I'll try to make a reproducable docker. But what I already notice is you're not compiling zenoh_c_vendor. So I'd make it --packages-up-to in a clean workspace.

clalancette commented 2 months ago

But what I already notice is you're not compiling zenoh_c_vendor. So I'd make it --packages-up-to in a clean workspace.

Ah, OK. I'll give it a try.

clalancette commented 2 months ago

OK, now I see the problem. For some reason when you build zenoh_c in Debug mode, it actually changes the name of the CMake config file to zenohc_debug, which we weren't looking for. I'll open a patch to fix this shortly.

Timple commented 2 months ago

Awesome, thanks for diving in!