Hello,I want to cross compile rospackage for arm.I do following the website http://answers.ros.org/question/191070/compile-roscore-for-arm-board/ . I have created rostoolchain.cmake file like this:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rostoolchain.cmake)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-linux-gcc)
set(CMAKE_CXX_COMPILER /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-linux-g++)
set(CMAKE_FIND_ROOT_PATH /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain)
set(CMAKE_LIBRARY_PATH /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/lib /home/znzx/boost/lib /opt/ros/hydro/lib)
set(CMAKE_INCLUDE_PATH /home/znzx/boost/include /opt/ros/hydro/include /usr/include)
set(BOOST_LIBRARY /home/znzx/boost/lib)
set(BOOST_INCLUDE /home/znzx/boost/include)
set(BOOST_ROOT /home/znzx/boost)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
When I excute `$./src/catkin/bin/catkin_make_isolated -DCMAKE_TOOLCHAIN_FILE=/home/znzx/catkin_ws/src/rostoolchain.cmake`
I got the following errors:
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under '/usr/src/gtest': gtests will be built
CMake Error at 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):
cmake/tools/rt.cmake:42 (assert_file_exists)
cmake/all.cmake:148 (include)
CMakeLists.txt:8 (include)
-- Configuring incomplete, errors occurred!
<== Failed to process package 'catkin':
Command 'cmake /home/znzx/ros_catkin_ws/src/catkin -DCATKIN_DEVEL_PREFIX=/home/znzx/ros_catkin_ws/devel_isolated/catkin -DCMAKE_INSTALL_PREFIX=/home/znzx/ros_catkin_ws/install_isolated -DCMAKE_TOOLCHAIN_FILE=/home/znzx/catkin_ws/src/rostoolchain.cmake' returned non-zero exit status 1
Reproduce this error by running:
==> cd /home/znzx/ros_catkin_ws/build_isolated/catkin && cmake /home/znzx/ros_catkin_ws/src/catkin -DCATKIN_DEVEL_PREFIX=/home/znzx/ros_catkin_ws/devel_isolated/catkin -DCMAKE_INSTALL_PREFIX=/home/znzx/ros_catkin_ws/install_isolated -DCMAKE_TOOLCHAIN_FILE=/home/znzx/catkin_ws/src/rostoolchain.cmake
Command failed, exiting.
What is RT library? How can I do to solve the problem? Please help me.thank you very much
Originally posted by Alice63 on ROS Answers with karma: 63 on 2015-04-22
Post score: 4
Original comments
Comment by inspire on 2017-01-20:
I'v got exactly the same problem. Did you solve it in the meantime?
Comment by jkolb on 2017-08-23:
Did you ever figure this out? I'm hitting the same problem.
Comment by taogashi on 2017-11-13:
The same error...
Comment by pbeeson on 2018-01-20:
I am also seeing this for certain build structures. It seems to be a non-deterministic catkin issue not related to the CMake, but somehow related to the topology.
Comment by mateus-amarante on 2018-02-01:
Similar error here. Did someone solve the problem? I think it might be related to this pull request: https://github.com/ros/catkin/pull/811.
Comment by antipattern on 2018-02-06:
Does your rootfs provide an librt.so? If so, where?
Comment by mateus-amarante on 2018-02-06:
In my case, the librt.so is in ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf/. When I add *link_directories(${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf)* (the file is there), I still get the same error.
Comment by antipattern on 2018-02-07:
Then I am lost, I thought your toolchain might not include the multiarch dirs by itself, but if you add them manually it should work. Does crosscompiling a regular CMake project which links against librt work with your toolchain?
Comment by mateus-amarante on 2018-02-09:
It works fine with a simple CMake project. I tried to compile a catkin project again with CMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf in the toolchain file. I got the error: "file '/mnt/bbgroot/usr/lib/arm-linux-gnueabihf/librt.so' does not exist. Message: RT Library". The lib is there.
Comment by antipattern on 2018-02-14:
I am not sure what is happening in this case. If the library is indeed at that location, I do not see how the assertion might fail. How did you check the file exists?
Comment by mateus-amarante on 2018-02-14:
ls /mnt/bbgroot/usr/lib/arm-linux-gnueabihf/librt.so outputs librt.so. For now, I commented the assertion step in .../catkin/cmake/tools/rt.cmake. I'm still getting errors, but I'll try a little more.