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

How to cross-compile ros-pkg for arm

asked 2015-04-15 21:51:25 -0600

Alice63 gravatar image

Hello. Due to using the armel, I install the ros from the source. Now the roscore can run on the arm succesfully. The ROS packages are compiled directly on board. I want to cross-compile it. But the eros seems to have been abandoned. So I do as the following: Create the cmakelists.txt

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/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/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/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain)
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(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)    
ADD_EXECUTABLE(mrobot_driver src/mrobot_driver.cpp src/mrobot_comms.c)
SET(BOOST_ROOT /usr/include/boost)

than :

 $ camke .
 $  make

I got the error messages:

Building CXX object CMakeFiles/mrobot_driver.dir/src/mrobot_driver.o
In file included from /opt/ros/hydro/include/ros/ros.h:38:0,
                 from /home/znzx/cmake/ros/mrobot_driver1/src/mrobot_driver.h:40,
                 from /home/znzx/cmake/ros/mrobot_driver1/src/mrobot_driver.cpp:40:
/opt/ros/hydro/include/ros/time.h:58:50: fatal error: boost/math/special_functions/round.hpp: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/mrobot_driver.dir/src/mrobot_driver.o] Error 1
make[1]: *** [CMakeFiles/mrobot_driver.dir/all] Error 2
make: *** [all] Error 2

While , boost/math/special_functions/round.hpp does exists. And the path of boost is right. Is the method of cross_compiling correct? Please help me.thank you very much.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-10 05:36:45 -0600

Zargol gravatar image

updated 2016-06-10 05:38:49 -0600

Hi, I had the same problem. I do not know what the real problem is. but I solved it by saving again the CMakeLists.txt file. I mean I made a minor change on the file, e.g add a space and save it again!!!! Then the error is gone!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-15 21:51:25 -0600

Seen: 807 times

Last updated: Jun 10 '16