ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Catkin cross-compilation of ros-groovy for Zynq ARM target

asked 2013-07-24 06:41:56 -0500

lboltzmann gravatar image

updated 2014-01-28 17:17:24 -0500

ngrennan gravatar image

I'm attempting to cross-compile ROS src to a Zynq based ARM system running a version of Angstrom Linux. I've download src (groovy-ros-comm) based on the install from source instructions and created a catkin workspace. I've set up my rostoolchain.cmake file (embedded below) and successfully cross-compiled boost, apr, apr-util and log4cxx.

set(CMAKE_C_COMPILER /home/adminuser/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc)

set(CMAKE_CXX_COMPILER /home/adminuser/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++)

set(CMAKE_FIND_ROOT_PATH /home/adminuser/CodeSourcery/Sourcery_G++_Lite)

set(CMAKE_LIBRARY_PATH /home/adminuser/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/usr/lib /home/adminuser/boost-1_50/gcc-4.4-arm /home/adminuser/ros_catkin_ws/ros_ext_deps/lib)

set(CMAKE_INCLUDE_PATH /home/adminuser/boost-1_50/includes usr/include /home/adminuser/ros_catkin_ws/ros_ext_deps/include)

set(BOOST_LIBRARYDIR /home/adminuser/boost-1_50/gcc-4.4-arm/)

set(BOOST_ROOT /home/adminuser/boost-1_50)
set(BOOST_INCLUDEDIR /home/adminuser/boost-1_50/includes)
set(Boost_ADDITIONAL_VERSIONS "1.50" "1.50.0")
set(Boost_COMPILER "-gcc44")
set(Boost_INCLUDE_DIR /home/adminuser/boost-1_50/includes)
set(Boost_LIBRARY_DIRS /home/adminuser/boost-1_50/gcc-4.4-arm/)

I'm running into problems with the compilation when it comes to rospack as follows.

-- Boost version: 1.50.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system
-- Found PythonLibs: /usr/lib/ 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/adminuser/ros_catkin_ws/build_isolated/rospack
==> make -j1 -l1 in '/home/adminuser/ros_catkin_ws/build_isolated/rospack'
Scanning dependencies of target rospack
[ 16%] Building CXX object CMakeFiles/rospack.dir/src/rospack.cpp.o
cc1plus: warning: include location "/usr/include/python2.7" is unsafe for cross-compilation
/home/adminuser/ros_catkin_ws/src/rospack/src/rospack.cpp:30: fatal error: tinyxml.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/rospack.dir/src/rospack.cpp.o] Error 1
make[1]: *** [CMakeFiles/rospack.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "./src/catkin/bin/../python/catkin/", line 717, in build_workspace_isolated
    number=index + 1, of=len(ordered_packages)
  File "./src/catkin/bin/../python/catkin/", line 497, in build_package
    install, force_cmake, quiet, last_env, cmake_args, make_args + catkin_make_args
  File "./src/catkin/bin/../python/catkin/", line 353, in build_catkin_package
    run_command(make_cmd, build_dir, quiet)
  File "./src/catkin/bin/../python/catkin/", line 198, in run_command
    raise subprocess.CalledProcessError(proc.returncode, ' '.join(cmd))
CalledProcessError: Command '/home/adminuser/ros_catkin_ws/install_isolated/ make -j1 -l1' returned non-zero exit status 2
<== Failed to process package 'rospack': 
  Command '/home/adminuser/ros_catkin_ws/install_isolated/ make -j1 -l1' returned non-zero exit status 2
Reproduce this error by running:
==> /home/adminuser/ros_catkin_ws/install_isolated/ make -j1 -l1**

Do I also need a ARM python library to link against?

I have read that tinyxml was included with the rospack src, but don't see it and the build process complains it can't find it. Do I need to download its src separately?

If the eventual goal is to compile something like the beginner_tutorials to my target do I need rospack? From rospack depends it appears even the simple ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-24 21:10:05 -0500

William gravatar image

updated 2013-07-24 21:11:19 -0500

I'm not sure about the python library, but you will need to cross compile tinyxml and provide it on the system library path for rospack to find it. rospack definitely does not have tinyxml embedded internally, we use the system dependency for tinyxml in Groovy and Hydro.

You need rospack for basically everything because it is used in the command line tools and build system to find packages, plugins, and other things for both building and running.

edit flag offensive delete link more


William, Thanks for the response. I've cross-compiled both python and tinyxml and python is now found. I still have the following error. /home/adminuser/ros_catkin_ws/src/rospack/src/rospack.cpp:30: fatal error: tinyxml.h: No such file or directory I have tinyxml.h in the following directory /home/adminuser/ros_catkin_ws/rost_ext_deps/include/tinyxml. The CMAKE_INCLUDE_PATH is set to /home/adminuser/ros_catkin_ws/rost_ext_deps/include Any thoughts on why it can't find tinyxml.h? Thanks again. Marcus

lboltzmann gravatar image lboltzmann  ( 2013-07-26 06:03:16 -0500 )edit

I copied tinyxml.h and tinystr.h into the rospack src directory for the time being and it finds them. Now on to all the non-matching functions errors. Fun.

lboltzmann gravatar image lboltzmann  ( 2013-07-26 06:23:18 -0500 )edit

The problem is that one version of TinyXML puts `tinyxml.h` in `<prefix>/include` and another puts it in `<prefix>/include/tinyxml`, so if `rospack` is doing `#include <tinyxml.h>`, you'll have to add `<prefix>/include/tinyxml` to the list of include dirs.

William gravatar image William  ( 2013-07-26 07:16:07 -0500 )edit

@W I'm in a very similar boat as M. I'm using yujin_tools to cross-compile, but everything else is Catkin/CMake'd. I've created a Catkin package for tinyxml that properly installs headers to <prefix>/include/tinyxml, and the package advertises "include" and "include/tinyxml". Still not finding it. Where should this include dir be defined?

dustingooding gravatar image dustingooding  ( 2013-10-22 08:41:03 -0500 )edit

@dustingooding If you provided `include` and `include/tinyxml` to the `catkin_package` call, then that only makes it work for the devel space case. If you have include files which don't install directly to `<prefix>/include` then you need to add that to your include directories using a cmake extras file. Open a new question about "How to export non-standard include directories in catkin" and I'll answer it there, this is getting off topic.

William gravatar image William  ( 2013-10-22 10:16:44 -0500 )edit

dustingooding gravatar image dustingooding  ( 2013-10-22 11:00:24 -0500 )edit

Question Tools


Asked: 2013-07-24 06:41:56 -0500

Seen: 1,271 times

Last updated: Jul 24 '13