Ask Your Question
2

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

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

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 -0600

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 846 times

Last updated: Feb 07 '17