Error while cross-compiling rospkg for arm
Hello,I want to cross compile rospackage for arm.I do following the website http://answers.ros.org/question/19107... . 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
I'v got exactly the same problem. Did you solve it in the meantime?
Did you ever figure this out? I'm hitting the same problem.
The same error...
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.
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 .
Does your rootfs provide an librt.so? If so, where?
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.
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?