ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

What for catkin needs to link to librt (realtime extension)?

asked 2013-07-09 22:01:23 -0600

130s gravatar image

updated 2013-07-10 06:11:38 -0600

(Setting aside my knowledge about build system is limited,)

There's a macro in catkin: catkin/cmake/tools/rt.cmake, inside of which it tries to find librt I think. Does catkin need realtime extension for:

  • building catkin itself?

OR

  • building whatever packages that require rt?

or both?

I'm wondering, because while trying to build catkin workspace from source (following this doc) on non-Ubuntu platform (QNX), I get this error:

# cd catkinws && mkdir build && cd build && cmake ../src
:
-- Found gtest sources under '/home/rosuer/catkin_ws/src/gtest': gtests will be built
CMake Error at catkin/cmake/assert.cmake:17 (message):

  Assertion failed: check for file existence, but filename
  (RT_LIBRARY-NOTFOUND) unset.  Message: RT Library

Call Stack (most recent call first):
  catkin/cmake/tools/rt.cmake:42 (assert_file_exists)
  catkin/cmake/all.cmake:134 (include)
  CMakeLists.txt:12 (include)

-- Configuring incomplete, errors occurred!

While remaining not so sure, I modified a line of rt.cmake as follows that bypass the error above on QNX. And no build-time error occurs on Ubuntu (Quantal) too (I don't know if there's any runtime misbehavior):

x if(NOT (APPLE OR WIN32 OR MINGW OR ANDROID))
o if(NOT (APPLE OR WIN32 OR MINGW OR ANDROID OR UNIX))

Although I'm not sure if UNIX symbol is recognized by cmake on Ubuntu/Linux, succeeding this even on Ubuntu made me wonder why linking to rt is needed in catkin level.

Thank you!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
3

answered 2013-07-09 23:59:36 -0600

po1 gravatar image

While I don't know for sure, I'm pretty confident that catkin itself does not need librt, as it is just a set of cmake files topped with a handful of scripts.

Besides, using UNIX here seems inadequate, as it will disable linking against librt for Linux too. The toolchain file for QNX (if you are using one) most likely defines the QNX macro that you can use instead of UNIX in the rt.cmake file.

Hope this helps.

edit flag offensive delete link more

Comments

I agree that using UNIX symbol like I cited might be a bad idea (although whether it influences linux is not clear to me). And I don't explicitly use toolchain file for QNX but will look for it if there's anything.

130s gravatar image 130s  ( 2013-07-10 06:16:49 -0600 )edit
1

answered 2017-09-06 16:40:57 -0600

I randomly run into this issue every once in a while (every few months). Cleaning and cleanly rebuilding the package that throws the error generally appears to solve the problem. It would still be interesting to know if there is some sort of faulty CMake usage or so that can cause the issue.

edit flag offensive delete link more
0

answered 2015-10-08 03:42:50 -0600

SR gravatar image

I just tried catkin build instead of catkin_make that I used previously without problems and I get the same issue. It seems to change the way the application is to be linked or compiled.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-07-09 22:01:23 -0600

Seen: 6,255 times

Last updated: Sep 06 '17