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

How to specify a custom rostoolchain.cmake when compiling with catkin?

asked 2017-02-07 22:06:11 -0500

Cerin gravatar image

I'm attempting to cross-compile ROS for ARM on my x86-64 laptop. To do this, I'm trying to run catkin_make_isolated with this rostoolchain.cmake file:

#File rostoolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

# Have to set this one to BOTH, to allow CMake to find rospack
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)

And I'm calling it like:

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_TOOLCHAIN_FILE=/path/to/rostoolchain.cmake -DCMAKE_BUILD_TYPE=Release --install-space /tmp/ros/$ROS_DISTRO -j1

However, the output reports:

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE

and the compiler shown is "GNU GCC" instead of "arm-linux-gnueabihf-gcc", implying my custom cmake file is being ignored.

How do I fix this? What's the proper way to cross-compile ROS for ARM on x86?

There's almost no documentation of this in the wiki. I found this page, but it's not very descriptive and hasn't been updated in three years.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-07 23:19:38 -0500

PeterHousel gravatar image

The meta-ros layer for OpenEmbedded is able to cross-compile a large number of important ROS packages, and it is easy to add recipes for new packages if needed.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-02-07 22:06:11 -0500

Seen: 1,501 times

Last updated: Feb 07 '17