[ros-users] Cross-Compilation Patch

Daniel Stonier d.stonier at gmail.com
Sat Jul 10 05:00:19 UTC 2010


Cross-compiling it is much easier - I've cross compiled it and also
built it for my arm cores inside a qemu chroot. Cross compiling is so
much faster and efficient it can save you a huge amount of effort.

At the moment I'm in the middle of putting together an ros repository
which supports cross compiling ros in various ways - it maintains a
few things to support cross-compiling:

 - Patches for the ros which automatically get added when a toolchain
is selected (until they get merged upstream)
 - Python scripts which simplify the cross process
 - Cmake modules for various toolchains and processors.
 - Some ros packages which can cross compile the ros dependencies.

We're currently road testing the environment at my company where we do
a variety of partial crosses (just using the ros for a build
environment) and full crosses.

Given the difficulty with cross-compiling the ros, it might be a good
place for us to collate resources and utilities. I was going to wait a
little before mentioning it on the list here as there's still a few
things I want to do, but if you want to check it out, you can find
some information about how to use it and download the repo here:

 - http://snorriheim.dnsdojo.com/redmine/wiki/ecl : overview about the
ecl-ros environment.
 - http://snorriheim.dnsdojo.com/redmine/wiki/ecl/Partial_cross_compile
: the partial cross (native ros, crossed packages)
 - http://snorriheim.dnsdojo.com/redmine/wiki/ecl/Full_cross_compile :
the full cross.
 - http://snorriheim.dnsdojo.com/redmine/wiki/ecl/Ecl_ros_qemu_arm :
some notes on arm development with the ros (warning: work in
progress!)

The ecl is BSD and a google code project, so feel free to check it out
and adapt or use it for whatever you need. If you're interested in
collaborating on a centralised resource for an ros cross compile
environment with either this or perhaps in a different direction, I'd
be happy to talk further.

Cheers,
Daniel Stonier.
-- 
Phone : +82-10-5400-3296 (010-5400-3296)
Home: http://snorriheim.dnsdojo.com/
Yujin Robot: http://www.yujinrobot.com/
Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl


On 10 July 2010 08:26, "Jan Tünnermann" <jeti at goffa.de> wrote:
> Hi Cedric,
>
>  I'm currently trying to get ROS running on my openmoko freerunnner
> smartphone (under debian, armv4t). I almost compiled everything, but the
> compiler crashes compiling roscpp, because it's running our of memory. I
> created a large swap-file which didn't help. I haven't looked into
> cross-compiling yet, could it be a solution? Would it maybe be possible
> to just cross-compile roscpp on my laptop and move it to the phone? What
> would it involve to setup a cross-compiling environment to do this?
>
> This if probably a bit off-topic regarding the question in your email, but
> I would appreciate any hints...
> thanks in advance
> jan
>
>
>
> Am Fr, 9.07.2010, 14:55 schrieb Cedric Pradalier:
>> Hi,
>>
>> I'd like to suggest the 2 micro-patch to help cross-compiling ros.
>>
>> ======== ROS BUILD ========
>> I now use more the rostoolchain.cmake and I really think that's the way
>> forward. Mine looks like that:
>> set(CMAKE_SYSTEM_NAME Linux)
>> set(CMAKE_SYSTEM_PROCESSOR arm-angstrom-linux-gnueabi)
>> set(GUMSTIXTOP [...]/overo-oe)
>> set(GUMSTIXFS [...]/overo-dev)
>> set(CMAKE_C_COMPILER
>>
>> ${GUMSTIXTOP}/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gcc-sysroot)
>> set(CMAKE_CXX_COMPILER
>>
>> ${GUMSTIXTOP}/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-g++-sysroot)
>> set(CMAKE_FIND_ROOT_PATH ${GUMSTIXFS})
>> set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
>> set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>> set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>>
>> The CMAKE_FIND... directives are conflicting with the
>> _rosbuild_add_rostest and _rosbuild_add_pyunit in
>> rosbuild/private.cmake. This can be corrected by applying the following
>> patch:
>> -  find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} /)
>> +  find_file(_file_name "${file}" "${PROJECT_SOURCE_DIR}" /
>> NO_CMAKE_FIND_ROOT_PATH)
>> in both function. This will force find_file to ignore the
>> CMAKE_FIND_ROOT_PATH for these functions. This is fine since they seem
>> to be used only to refer to local files.
>>
>> ======== OpenCV ========
>> In OpenCV, the Makefile does not use the toolchain file. I've modified
>> mine as follows. There might cleaner ways to get the same semantic.
>> CMAKE = cmake
>> TOOLCHAIN =
>> ifeq (x$(wildcard
>> $(ROS_ROOT)/rostoolchain.cmake),x$(ROS_ROOT)/rostoolchain.cmake)
>>      TOOLCHAIN = -DCMAKE_TOOLCHAIN_FILE=$(ROS_ROOT)/rostoolchain.cmake
>> endif
>> CMAKE_ARGS = $(TOOLCHAIN) -D CMAKE_BUILD_TYPE=RELEASE \
>>               -D CMAKE_INSTALL_PREFIX=`rospack find
>> opencv2`/$(INSTALL_DIR) \
>>               ...
>> =========================
>> Next thing is to find a way to generate rospack and rosstack twice, once
>> for host, another for deployment, and to call a different one during
>> compilation and at runtime. Any idea?
>>
>> HTH
>>
>> --
>> Dr. Cedric Pradalier
>> http://www.asl.ethz.ch/people/cedricp
>>
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



More information about the ros-users mailing list