Skip to content
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

Link rcpputils::filesystem to solve error on RHEL #1665

Closed
wants to merge 2 commits into from

Conversation

audrow
Copy link
Member

@audrow audrow commented May 21, 2024

It seems #1653 created a regression on Humble on RHEL.

Here is an attempt to fix it. I'll run RHEL CI before merging.

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@audrow Ups not so simple

CMake Error at CMakeLists.txt:30 (add_library):
08:00:04   Target "rosbag2_compression" links to target "rcpputils::filesystem" but
08:00:04   the target was not found.  Perhaps a find_package() call is missing for an
08:00:04   IMPORTED target, or an ALIAS target is missing?

Basically need to add find_package(rcpputils) above.

Comment on lines 48 to 53
if(CMAKE_COMPILER_IS_GNUCXX)
target_link_libraries(${PROJECT_NAME}
rcpputils::filesystem
)
endif()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@audrow @clalancette I think we need

if(CMAKE_COMPILER_IS_GNUCXX)
  target_link_libraries(${PROJECT_NAME} stdc++fs)
#endif

IMO target_link_libraries(${PROJECT_NAME} rcpputils::filesystem) is not going to help here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually isn't needed, as a similar thing is done above with ament_target_dependencies.

Instead, we need a change to the code itself to switch back to using rcpputils::fs. I'll push some changes shortly that make it compile for me, though @MichaelOrlov suggests that it may not work in practice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clalancette Yes, it is not going to work out of the box. I will do rework shortly. Give me a couple of hours.

Signed-off-by: Chris Lalancette <[email protected]>
@MichaelOrlov
Copy link
Contributor

@audrow @clalancette I created a new PR #1666 with fix in replacement to the PR.

Please review #1666

@clalancette
Copy link
Contributor

Sounds good, closing this one.

@clalancette clalancette deleted the audrow/link-rcpputils-filesystem branch May 21, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants