Cross-Compile ROS 2.0

275 views
Skip to first unread message

Brad Baillio

unread,
Mar 10, 2016, 4:38:48 PM3/10/16
to ROS SIG NG ROS
I wanted to start a new thread for this topic since I'm sure I'll have lots of questions, and in case others are interested.

To set the stage:
  1. I have an ARM embedded target that runs a very light Linux kernel with minimal filesystem capabilities.
    • I only have a few commonly-used terminal commands built into the busybox filesystem
  2. I traditionally (in non-ROS product code) cross-compile on an x86 Ubuntu environment
  3. The cross-compile toolchain I traditionally use is built on glibc 2.13, Linux kernel 2.6.36, binutils 2.21, and gcc linaro 4.5
  4. I know I have some play in the version of gcc I use, as long as it is compatible with glibc 2.13.

I tried cross-compiling ROS 2 previously, but kept hitting roadblocks.  So I decided to attempt a build on a native target that matched the specs of my cross-compile toolchain.
I found that in the Utilite embedded computer provided by CompuLab.  It comes preloaded with Ubuntu 12.04.  With a few adjustments, and a lot of manual compilation of the tools and dependencies for ROS 2, I got a successful ARM build that runs on my target ARM.

I am going to re-tackle the cross-compile so I'm not dependent on an embedded ARM device for continuous integration, building, deployment, etc.

My build command looks like this:
src/ament/ament_tools/scripts/ament.py build --cmake-args -DCMAKE_CXX_COMPILER=/path/to/my/cross-g++ -DCMAKE_C_COMPILER=/path/to/my/cross-gcc -DCMAKE_LINKER=/path/to/my/cross-ld --

The places where I start to break down:
  • example_interfaces
  • rcl_interraces
    /lib/ld-linux.so.3: No such file or directory
    Traceback (most recent call last):
        ...blah...
        ...blah...
        ...blah...
        File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
           raise CalledProcessError(retcode, cmd)
    return non-zero exit status 255


I am committed to help solve this problem because working on another platform for development, and quickly building/deploying using cross-compile is a much faster workflow.  ROS takes SO LONG to build on a little ARM processor. :-)

Thanks.


William Woodall

unread,
Mar 10, 2016, 4:42:50 PM3/10/16
to ROS SIG NG ROS
Hi Brad,

Unfortunately the `...blah...` part is the interesting part :).

The last bit of that traceback, which is from our tool invoking Python, just tells us that a command that Python executed failed with an exit code of 255.

It would be useful if you could post the entire error either in an issue on ros2/ros2 or in a gist.github.com (or similar pastebin like thing).

Thanks,

--
You received this message because you are subscribed to the Google Groups "ROS SIG NG ROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-ng-ro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
William Woodall
ROS Development Team

Brad Baillio

unread,
Mar 10, 2016, 4:57:28 PM3/10/16
to ROS SIG NG ROS
Right on.  I added an Issue #203 on ros2/ros2.  Hopefully I have enough info there.  If not let me know and I'll add more.
The file triggering the failure is 'rosidl_typesupport_opensplice_cpp'.

I should also mention that I am trying to compile alpha3 because I didn't want to mess with cross-compiling Python also.  But I want to try alpha4 as well.

Thanks again.

Andrew Hundt

unread,
Apr 17, 2016, 7:52:30 PM4/17/16
to ROS SIG NG ROS
You may find this discussion about build/packaging tools relevant to your use case:

Perhaps you have some ideas of what you need can be taken into consideration there?
Reply all
Reply to author
Forward
0 new messages