-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking with Gazebo using Catkin fails #856
Comments
The reason is pretty straight forward. Currently
It does not support linker arguments like The logic could be extended to also accept those and pass them along as-is by adding another |
@dirk-thomas do these assumptions about what is in the libraries list apply to just the |
The restriction actually applies to |
In a very pedantic, idealistic sense, passing From another angle, if you wanted to communicate that someone should link against a library From a practical standpoint, however, maybe we should just have a special case for In the meantime, you can create an extras file (I know it's a pain) and manually add the |
Thank you for the explanations, though I am still confused as to how to fix this issue. Is there a simple one-line export flag I can use to fix this issue? Does every package that depends on a package that Gazebo uses need to have a cmake extra file? I'm not familiar with how to make CMake extra files. I tried a few fixes just now to no avail, such as:
|
You would:
There's no "one-line" fix for this, but the second step I mentioned is described in this ros answer: If an exception were added for |
Thanks for comments.
For completeness: my research found that the |
So in my example at the top of this issue, would the CMakeExtras file be added to the |
|
Okay, I've created something that compiles with a cmake extras file, but I'm not sure what the point of this whole exercise is anymore. Should My example workspace now has base_pkg-extras.cmake.in that allows downstream For the original issue, this means I should modify |
That is all correct, as far as I can see. This will be necessary unless Gazebo (or the upstream culprit) stops sending |
Sorry, forgot to specifically answer this one, you're correct it should either do it in the extras file or have it in the DEPENDS, but not both. And since the DEPENDS does not work right now you'll want to do just the extras file as a workaround. |
Digging into catkin would be a very big project for me that I cannot take on, do you think anyone else would be able to do it? |
I can easily patch the gazebo cmake module to adapt it to this scenario, not a big problem. I'm more afraid about the real root of the problem which is a not-so-weird library like Protobuf (the module comes directly from Kitware). Potentially we could face the same problem with other software relying on Protobuf, right? |
I'm not opposed to patching catkin to support this, but I don't have time to do so right now either. The change is trivial, but getting it reviewed and making sure it doesn't break other stuff (and dealing with breaks when they inevitably happen) takes a lot more time. In my experience, just because a cmake module has been shipped with CMake (from kitware) doesn't really ensure any level of quality. Also, since you're probably using Trusty or Xenial, the CMake version is at least several versions out of date, and so it's not uncommon for cmake modules shipped with cmake to also be out of date. Here are some potentially related links:
|
…ing) Added missing DEPEND clauses to catkin_package to fix gazebo catkin warning. Note that after the change problems could appear related to -lpthreads errors. This is an known issue related to catkin: ros/catkin#856.
Would just like to toss in here that I ran into the same problem independently when trying to link |
I will close this for now since it is not planned to change the behavior of the catkin API atm. |
In my case, this also happens with PCL 1.9. The infamous |
Boost with newer CMake (~3.13) seems to add |
…ing) Added missing DEPEND clauses to catkin_package to fix gazebo catkin warning. Note that after the change problems could appear related to -lpthreads errors. This is an known issue related to catkin: ros/catkin#856.
Some of the exported flags (?) are being done incorrectly with Gazebo when using Catkin. @j-rivero indicates the problem is not within Gazebo because "We have built a lot of third party software on top of Gazebo so it should be related to catkin packages somehow." Though, we've also built even more software with Catkin...
The original issue from bitbucket:
Based on discussions with @j-rivero on this gazebo_ros_pkgs pull request, I've isolated some sort of flag export build problem that results in the error:
I think the problem is Gazebo7 is exporting a dependency on
pthread
which is suggested is bad on StackOverflow.This occurs when one catkin package depends on Gazebo, and another depends on that package:
base_pkg CMakeLists
dependent pkg CMakeLists
The full workspace can be tested from this barebones test repo I've just created.
The text was updated successfully, but these errors were encountered: