[ros-users] Cross-Compilation Patch

Daniel Stonier d.stonier at gmail.com
Sat Jul 10 04:36:21 UTC 2010


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
>



-- 
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



More information about the ros-users mailing list