[ros-users] Cross-Compilation Patch

Daniel Stonier d.stonier at gmail.com
Sun Jul 11 02:03:06 UTC 2010


I have thought about doing that - it's not hard to add a bit of extra cmake
to get it to build both toolchain and runtime debs/rpms. However, there's a
huge number of embedded platforms out there and you'll often want to fully
optimise your build flags (-march and -mtune/-mcpu) to get as much speed as
possible on your embedded board so my first priority is just to get some
cross recipes from source up and working as that provides a convenient way
to cover all bases.

If you want to add to the cmake scripts with some packaging code, feel free
to send some modifications in, or I can give you direct access. Later I
might tackle it myself - even if it's only for personal repos, it would help
in development in some instances.

On 10 July 2010 16:36, Cedric Pradalier <cedric.pradalier at mavt.ethz.ch>wrote:

> Hello Daniel,
>
> I'm very glad to hear that you're so advanced on the cross-compilation
> question. I am still experimenting and making it work by trial and
> errors...
> Do you thing there would be a chance to setup a package repository with
> the built binaries? I'm running a stripped down ubuntu on my gumstix
> verdex and overo, and having pre-built packages would be a game changer.
> However, for these applications, the deb-packages would have to be
> cleaned up to save a bit of space :)
>
> Best,
>
> On 07/10/10 06:36, Daniel Stonier wrote:
> > There are already some patches submitted to ros trac covering some of
> > these things - while they didn't get in in time for cturtle, hopefully
> > they'll be in the next release
> >
> > https://code.ros.org/trac/ros/ticket/2803 - sets up rospack for a
> twopass
> > https://code.ros.org/trac/ros/ticket/2805 - sets up genmsg_cpp for a
> twopass
> > https://code.ros.org/trac/ros/ticket/2823 - a fix for a stray test
> > that causes a problem in crossing topic_tools
> > https://code.ros.org/trac/ros/ticket/2822 - a fix for a find_file in
> > cmake that can't find things in a cross in message_filters
> > https://code.ros.org/trac/ros/ticket/2821 - find_file again causing
> > problems in topic_tools
> > https://code.ros.org/trac/ros/ticket/2670 - fix to allow
> > rostoolchain.cmake and rosconfig.cmake to exist together
> >
> > Your fix for private.cmake I was sure I submitted a few months ago,
> > but I can't find it in the trac system - I maintain exactly the same
> > patch myself. I'll check it again a bit later to make sure its there.
> > I've also got a cross compiled opencv package for embedded systems
> > (minus all the gui components) that does what you're doing and a bit
> > more:
> >
> > svn export
> http://embedded-control-library.googlecode.com/svn/trunk/ecl_vision/opencv_embedded
> > ./opencv
> >
> > On 9 July 2010 21:55, Cedric Pradalier<cedric.pradalier at mavt.ethz.ch>
>  wrote:
> >
> >> 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
> >>
> >>
> >
> >
> >
>
>
> --
> 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
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100711/9a53d7f4/attachment-0003.html>


More information about the ros-users mailing list