cross-compile ROS for ARM64

asked 2018-06-04 22:20:26 -0600

bear234 gravatar image

updated 2018-06-04 22:36:09 -0600

I've compiled and installed ROS1 from source on X86 machine (Ubuntu).

Now I want to cross-compile ROS1 on X86 for ARM64.

Here is what I've done:

1) install all of dependencies of ROS1 on ARM64;
2) cp /lib/aarch64-linux-gnu, /usr/lib/aarch64-linux-gnu and etc/ld.so.conf.d of ARM64 to the relative places of X86;
3) execute ldconfig on X86;
4) apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf on X86;
5) execute the commands as below on X86:

export ARCH=arm
export PATH=/usr/arm-linux-gnueabihf/bin/:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabihf-

6) create a file named test.cmake as below:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(tools /usr/bin)
set(CMAKE_C_COMPILER ${tools}/arm-linux-gnueabihf-gcc-5)
set(CMAKE_CXX_COMPILER ${tools}/arm-linux-gnueabihf-g++-5)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

7) downloaded the source code of ROS Base, execute the command to try to compile and install:

./src/catkin/bin/catkin_make_isolated -DCMAKE_TOOLCHAIN_FILE=/ros_base/test.cmake --install -DCMAKE_BUILD_TYPE=Release

However, I always get the error about Could not find boost_system and boost_thread and Could not find a package configuration file provided by "console_bridge" while compiling the package cpp_common.

I've read this link: https://answers.ros.org/question/1910...

but I don't want to cross-compile all of dependencies manually.

It doesn't seem that ldconfig refreches the lib path but I've also tried to export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:/lib/aarch64-linux-gnu but I still get the same error.

edit retag flag offensive close merge delete

Comments

This reply is late but this article has a solution for a somewhat similar problem with pthread

teshansj gravatar image teshansj  ( 2020-07-21 06:36:29 -0600 )edit