filters
filters copied to clipboard
Interface library causes build failure on Humble/20.04
I am trying to build this using colcon build command. But it is not working, following error shows up:
`--- stderr: filters
CMake Error at CMakeLists.txt:26 (add_library):
add_library INTERFACE library requires no source arguments.
CMake Error at CMakeLists.txt:31 (target_link_libraries): Cannot specify link libraries for target "realtime_circular_buffer" which is not built by this project.
Failed <<< filters [6.26s, exited with code 1]`
It says INTERFACE library requires no source arguments. how can I resolve this without specifying the source files?
What branch are you on? What ROS distro? What OS version?
My bad for not mentioning all the details. Branch - ros2 ROS Distro - humble (source installation) OS version - Ubuntu 20.04
Let me try to reproduce this - I've got a similar setup
This doesn't happen on 22.04 on humble; I'm guessing a recent commit added something that doesn't work with the older cmake version. Could you try a previous commit of filters using git checkout 7b1b525c3529c00cdbe7edcb36cc53b56781df2d and let me know if that builds? Also, what is the output of cmake --version?
Yes, it builds for the previous commit. My cmake version is 3.16.3. In the CMakeLists.txt for the ros2 branch, minimum cmake version required was 3.14, so I thought it should be okay.
It looks like interface libraries with sources was added in 3.19. CI for humble runs on 22.04, so I missed this problem. The interface library was added in https://github.com/ros/filters/pull/70
@wep21 @ryanf55 it looks like the interface library for realtime_circular buffer doesn't work with the cmake version on 20.04, which is a supported platform for humble. Thoughts? I could branch for humble, rollback the interface library changes, and re-release, but is there a way to support the older cmake version instead?
Ubuntu 20.04 is only "recommended" to support for humble packages, but since filters is pretty core I think we should support it. Here are the cmake versions for each platform of humble:
Since interface libraries with source arguments was only added in cmake 3.19, it would seem to break support for macos and bullseye as well.
Thanks for the help!! I'll use the previous version.
Ubuntu 20.04 is only "recommended" to support for humble packages, but since filters is pretty core I think we should support it. Here are the cmake versions for each platform of humble:
Since interface libraries with source arguments was only added in cmake 3.19, it would seem to break support for macos and bullseye as well.
Only bullseye, true. MacOS is rolling release - it's currently 3.29. The version in REP-2000 is just what it had when they wrote the REP. https://formulae.brew.sh/formula/cmake
Edit: To answer your other question - yes. I'll get a PR up next week for you to fix debian bullseye. It will require conditional logic. Anyone compiling with CMake 3.19 or greater will get the header files to show up properly in their editors. 3.18 won't, but the library can still be linked to. https://stackoverflow.com/questions/60604249/how-to-make-a-header-only-library-with-cmake
Proposed patch: https://github.com/ros/filters/pull/76
I believe this was fixed by #76 .
