ros / filters

This library provides a standardized interface for processing data as a sequence of filters. This package contains a base class upon which to build specific implementations as well as an interface which dynamically loads filters based on runtime parameters.
39 stars 50 forks source link

Interface library causes build failure on Humble/20.04 #75

Closed Ayush1285 closed 2 weeks ago

Ayush1285 commented 5 months ago

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?

jonbinney commented 5 months ago

What branch are you on? What ROS distro? What OS version?

Ayush1285 commented 5 months ago

My bad for not mentioning all the details. Branch - ros2 ROS Distro - humble (source installation) OS version - Ubuntu 20.04

jonbinney commented 5 months ago

Let me try to reproduce this - I've got a similar setup

jonbinney commented 5 months ago

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?

Ayush1285 commented 5 months ago

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.

jonbinney commented 5 months ago

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?

jonbinney commented 5 months ago

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:

image

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.

Ayush1285 commented 5 months ago

Thanks for the help!! I'll use the previous version.

Ryanf55 commented 5 months ago

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:

image

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

Ryanf55 commented 5 months ago

Proposed patch: https://github.com/ros/filters/pull/76

jonbinney commented 2 weeks ago

I believe this was fixed by #76 .