cross-compile with research ISA
I would like to cross-compiling ROS2 onto a research platform with a new ABI and an extension to the RISC-V ISA. I need some help either manually building or making use of the existing cross-compile tools.
My test applications are fairly simple, and I was able to cross-compile ROS[1] applications manually (i.e., avoiding catkin) by converting them to rosserial applications. I eventually built an entire TurtleBot3 for my research platform this way (including teleop).
Now I'm looking to ROS2 for some of its real-time possibilities.
My normal cross-compile invocation for a rosserial application is something like this:
$HOME/cheri/output/sdk/bin/cheri-unknown-freebsd-clang++ \
$SRC1 $SRC2 -o $BIN \
-g \
-I$HOME/ros_lib \
-mabi=purecap \
--sysroot=$HOME/cheri/output/sdk/sysroot128 \
I'm not sure I can get this to translate to the docker/QEMU-based cross-compile tool (https://github.com/ros-tooling/cross_...).
Is there a simpler way for me to use colcon
or a recommendation for calling cmake
directly?
I'm only trying to build a simple talker/listener demo at this point, so we're talking one package, two source files, and one message type.
Cross-compilation with CMake essentially comes down to providing it a suitable toolchain file. Is that something you already have for your toolchain?
I'm not claiming this will solve everything (especially sysroot stuff can be tricky to get right), but it would be a big step towards cross-compiling "arbitrary" projects which based their build scripts on CMake.
Yes, I have a CMake toolchain file.
Seeing as
ros-tooling/cross_compile
is just about the most convenient way to cross-compile an entire ROS workspace without jumping through all sorts of hoops manually, it may pay off to post an issue on its issue tracker. ros-tooling/cross_compile#69 seems like it would be going in the direction of what you'd need.I'll follow your advice and post there, but I've also been playing with using my toolchain file with some success, but it chokes on finding PythonLibs.
Based on an invocation such as:
I get errors like the following:
My toolchain file doesn't specify a location for Python and I assumed it would default to my system version. This is probably dumb, but I'm not sure why.
[update] I've added this to the
ros-tooling/cross_compile
issue tracker.Regarding the "PythonLibs not found issue", I've been facing the same with a native build and I believe this is due to rosdep behavior https://github.com/ros-infrastructure...