PickNikRobotics / data_tamer

C++ library for Fearless Timeseries Logging
MIT License
219 stars 21 forks source link

fix(CMakeLists.txt): add fPIC compile option #8

Closed xmfcx closed 11 months ago

xmfcx commented 11 months ago

Hello @facontidavide , thanks for your great tool!

I recently tried out this tool an it works well!

As I was compiling it with the Autoware, I had some linker errors, you can see my struggle in https://www.twitch.tv/videos/1992007721?t=04h42m28s

In the end, for some reason, when I added -fPIC flag to the data_tamer package, the linker error was resolved.

I am not very good at cmake configuration and overall compiler flags. So I don't have the full understanding of the situation.

In the nebula driver, we use ament_auto_find_build_dependencies() and ament_auto_add_library() functions.

In my small test, I've simply added <depend>data_tamer</depend> to the package.xml so, this might help reproducing on a smaller scale too.

Edit: Just to be clear, it compiles, links and functions well with this change applied.

facontidavide commented 11 months ago

Thanks. I will investigate how to fix the compilation, in particular in ROS!

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2cccb7d) 77.41% compared to head (783690c) 77.41%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #8 +/- ## ======================================= Coverage 77.41% 77.41% ======================================= Files 18 18 Lines 1554 1554 ======================================= Hits 1203 1203 Misses 351 351 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

facontidavide commented 11 months ago

I just tested the "regular" options and it works as expected:

package.xml

<depend>data_tamer</depend>

CMakeLists.txt

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(data_tamer REQUIRED)

add_executable(my_node src/my_node.cpp)
ament_target_dependencies(my_node data_tamer)

Not accepting this PR for the time being