ZebraDevs / fetch_ros

Open ROS Components for Robots from Fetch Robotics
176 stars 148 forks source link

Add link to rt for compilation in RoboStack #156

Closed Tobias-Fischer closed 3 years ago

Tobias-Fischer commented 3 years ago

While Ubuntu/Debian systems pull in rt automatically, the underlying CentOS under conda, which we use in the RoboStack project (https://github.com/RoboStack/ros-noetic), does not. This fixes this issue.

Tobias-Fischer commented 3 years ago
NAME
     librt, libposix4 - POSIX.1b Realtime Extensions library

SYNOPSIS
     cc [ flag... ] file... -lrt [ library... ]

DESCRIPTION
     Functions in this library provide  most  of  the  interfaces
     specified  by  the  POSIX.1b  Realtime Extension.  See stan-
     dards(5). Specifically, this includes the interfaces defined
     under   the   Asynchronous  I/O,  Message  Passing,  Process
     Scheduling, Realtime Signals Extension,  Semaphores,  Shared
     Memory  Objects,  Synchronized  I/O, and Timers options. The
     interfaces defined under the Memory  Mapped  Files,  Process
     Memory  Locking,  and  Range Memory Locking options are pro-
     vided in libc(3LIB)

     See the man pages for the individual interfaces  in  section
     3RT for information on required headers.

     The name libposix4 is maintained for backward  compatibility
     and  should be avoided. librt is the preferred name for this
     library.

I am not sure about the internals though - @wolfv do you know more?

erelson commented 3 years ago

Great, thanks!

wolfv commented 3 years ago

Actually, while linking rt directly is not going to hurt at all, I am currently thinking that we might be able to "export" the linkage of rt through the CMake of roscpp and catkin could automatically take care of that. I will investigate this right now.

wolfv commented 3 years ago

PS: the issue we have in the robostack is that when not linking rt is that there are missing symbols for clock_gettime.

wolfv commented 3 years ago

Ok I actually have a fix in roscpp for this (which exposes rt as an additional library that needs to be linked). I think that will be more general, actually, so it might be fine to close this PR.

erelson commented 3 years ago

@wolfv thanks! Will close for now. Just let us know if you do need this after all. Also of note possibly is that we're very close to primarily supporting noetic (the next package sync will have everything needed), in case you guys prefer that release. If so, see the ros1 branch instead of melodic-devel on this and other repos.