Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cross compilation situation #1144

Open
windelbouwman opened this issue May 10, 2021 · 4 comments
Open

Improve cross compilation situation #1144

windelbouwman opened this issue May 10, 2021 · 4 comments

Comments

@windelbouwman
Copy link

windelbouwman commented May 10, 2021

As of now, ROS1 catkin packages cannot be smoothly cross compiled. It would be good to improve this situation for the following reasons:

  • Enable people to use cross compilation when targetting raspberry Pi or other embedded boards using aarch64 alike processors. Cross compilation reduces compilation time, and saves diskspace on the target system.
  • Improve the situation of ros/meta-ros regarding ROS1. Currently, there are some patches applied, it would be good to incorporate these patches into catkin.
  • Improve the situation of ros_cross_compile, enabling users to easily use this package.

Some notable issues I encountered when cross compiling the talker demo:

  • Absolute paths in cmake configuration files. For example: set(libraries "roscpp;pthread;/usr/lib/aarch64-linux-gnu/libboost_chrono.so.1.71.0;/usr/lib/aarch64-linux-gnu/libboost_filesystem.so.1.71.0;/usr/lib/aarch64-linux-gnu/libboost_system.so.1.71.0") on line 119 of opt/ros/noetic/share/roscpp/cmake/roscppConfig.cmake.
  • Usage of NO_CMAKE_FIND_ROOT_PATH in opt/ros/noetic/share/roscpp/cmake/roscppConfig.cmake. This causes cmake to use the host system libraries, which will not work, since these libraries are for a different target.

For some inspiration of what can be done, please refer here:

https://github.com/ros/meta-ros/blob/295774bd20dbcb5c2e1312d10958dca2a85e9219/meta-ros1-melodic/recipes-bbappends/catkin/catkin/0002-allow-proper-cross-compilation-with-catkin.patch

These patches are applied before building ros1 packages, which results in built packages which are able to cooperate during cross compilation.

My own patches are located here (those can be applied to installed deb packages in a sysroot):

https://github.com/windelbouwman/sysroot-creator/blob/main/patch-ros1-stuff.sh

In my opinion it makes sense to improve the ROS1 cross compilation situation. In ROS2, it almost works out of the box, and this is great (only one minor issue left with fastRTPS). Is ROS1 still maintained, or is it abandoned in favor or ROS2? In other words, does it make sense to try a pull request for this issue?

@asherikov
Copy link

There is a workaround for issues with paths: https://github.com/proot-me/proot provides "chroot" functionality with possibility of execution of both host and target binaries, see --qemu= option in https://github.com/proot-me/proot/blob/master/doc/proot/manual.rst#proot. It is somewhat more generic (broken non-ROS packages can be handled too), but might be difficult to integrate.

@aemad37
Copy link

aemad37 commented Nov 6, 2023

I was working on a list of cross compile fixes but then found this ticket.
I already started a ticket here #1191. Happy for you to add this to your list and I will close mine :)

@asherikov
Copy link

ROS1/catkin are EOL, nobody is going to work on this.

@aemad37
Copy link

aemad37 commented Nov 6, 2023

fair enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants