Robotics StackExchange | Archived questions

True cross compilation of a ROS package

I have a ROS 2 package from which I can build a .deb for either my native platform, or for another platform by relying on Docker and QEMU. I would like to do a true cross-compile of this package, without relying on QEMU, since the compilation time of this package is a bottleneck in my workflow.

It seems that cross compilation is in a state of flux (https://discourse.ros.org/t/call-for-help-maintainership-of-the-ros-cross-compile-tool/26511/9). I am looking for recommendations for how to proceed.

For reasons, I am using ROS Eloquent, but I'm hoping any solution is agnostic to the ROS version (so that it works when we use a more modern distro). For concreteness, I've created a minimum example: https://github.com/ggoretkin-bdai/example_msgs

I can produce both

ros-eloquent-foopkg-msgs_0.0.0-0bionic_amd64.deb

and

ros-eloquent-foopkg-msgs_0.0.0-0bionic_arm64.deb

and I would like to produce the arm64.deb more efficiently by running compilation natively. Ultimately CMake needs a configuration like https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux .

Asked by gustavogoretkin on 2023-02-28 11:40:05 UTC

Comments

Answers

hi, i'm not familiar with building .deb, but i managed to use docker to setup a cross compile env, to build a arm64 application with colcon build, maybe check out following repo if you haven't tried:

https://github.com/multiarch/qemu-user-static

Asked by fury.nerd on 2023-03-02 19:47:14 UTC

Comments

Aren't you suggesting the OP to use QEMU here, something (s)he's already doing, and is trying to avoid?

Asked by gvdhoorn on 2023-03-06 02:56:00 UTC

indeed...sorry for answering in such a haste...then just for a discussion, according to what i have tried once, a slightly impovement could be achieved, by compiling some "finalised" parts of the project to some libs, and compiling the "still-working" part of code in the QEMU env, then targetlink them. maybe this is not a true cross compilation, but the compilation time can be saved depending on how much of your "finalised" part is.

Asked by fury.nerd on 2023-03-16 20:35:06 UTC