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

Installation: Build Error #132

Open
decada-robotics opened this issue Apr 14, 2022 · 4 comments
Open

Installation: Build Error #132

decada-robotics opened this issue Apr 14, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@decada-robotics
Copy link

Bug report

Required information:

Using Ubuntu 20.04, ROS2 Galactic, Installing from Source.

Description of the bug

Hi building from source works smoothly in my other computers but for my current desktop I'm facing this error:

--- stderr: rmf_battery
/usr/bin/ld: /home/msi/workspace/trl_ws/install/rmf_traffic/lib/librmf_traffic.so: undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /home/msi/workspace/trl_ws/install/rmf_traffic/lib/librmf_traffic.so: undefined reference to `pthread_rwlock_trywrlock'
/usr/bin/ld: /home/msi/workspace/trl_ws/install/rmf_traffic/lib/librmf_traffic.so: undefined reference to `pthread_rwlock_tryrdlock'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/test_rmf_battery.dir/build.make:147: test_rmf_battery] Error 1
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/test_rmf_battery.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---

I tried searching online to find for solutions but couldn't find any. Would appreciate any help!

@mxgrey
Copy link
Collaborator

mxgrey commented Apr 22, 2022

Linkers can be very tricky and inconsistent.

Could you try out the branch link_threads from this PR: open-rmf/rmf_traffic#74 ?

Let me know if that solves this issue.

@samuelrawrs
Copy link

samuelrawrs commented May 4, 2022

Hi, it solved the issue for rmf_traffic but other packages such as rmf_task_ros2 failed but we've managed to fix them for our system.

Here's a pull request for the fixes.

@mxgrey
Copy link
Collaborator

mxgrey commented May 4, 2022

Using -lpthread isn't portable, so we should use find_package(Threads) and Threads::Threads similar to the rmf_traffic PR.

@samuelrawrs
Copy link

Oops okay I've edited it to use Threads::Threads and have double checked that the build still works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants