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

Cross Compiling ROS Kinetic for ARM Cortex-A7

asked 2018-11-14 03:10:03 -0500

lusim gravatar image

Hello,

I am currently working on cross compiling ROS Kinetic for an ARM Cortex-A7. I build the image for my module with buildroot. This is where I get my necessary dependencies compiled. (log4cxx, boost 1.58, tinyxml, python2.7)

I downloaded the ROS Kinetic Bare Bones files with:

$ rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
$ wstool init -j8 src kinetic-ros_comm-wet.rosinstall

So far I can compile until package 26/52.

The files are compiled with the following command:

./src/catkin/bin/catkin_make_isolated -DCMAKE_TOOLCHAIN_FILE=/path/to/ros_files_comm/src/rostoolchain.cmake --install -DCMAKE_BUILD_TYPE=Release -DBoost_DEBUG=ON

I use the following rostoolchain.cmake file:

File: rostoolchain.cmake

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
set(CMAKE_C_COMPILER /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
set(BOOST_INCLUDEDIR /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include)
set(BOOST_LIBRARYDIR /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib)
#set(BOOST_ROOT /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/boost)
set(TinyXML_LIBRARY /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/)
set(PYTHON_LIBRARY /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7)

set(console_bridge_DIR /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/cmake/console_bridge)


# Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

But I receive following Errors:

#Output
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- system
-- Found PythonLibs: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7   (found suitable version "2.7.14", minimum required is "2.7") 
-- Found TinyXML: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/  
-- Configuring done
WARNING: Target "rosstackexe" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rosstackexe" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospackexe" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospackexe" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospack" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospack" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospack-utest" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "rospack-utest" requests linking to directory "/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/python2.7".  Targets may link only to ...
(more)
edit retag flag offensive close merge delete

Comments

Whenever I see someone attempting to cross-compile I post this reference to bmwcarit/meta-ros.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-14 05:19:08 -0500 )edit

Thanks for your answer. The only problem is that i can't use Yocto to build my files. I have to use buildroot.

lusim gravatar image lusim  ( 2018-11-14 05:39:33 -0500 )edit

It wasn't an answer. I just wanted to make you aware of a Yocto-based infrastructure that typically is appealing to companies and has solved most of the issues with cross-compilation already.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-14 05:52:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-15 23:57:36 -0500

lusim gravatar image

I found the solution on my own. I used TinyXml2 4.0.1 which causes problems. So I updated to a newer version.

edit flag offensive delete link more

Comments

Thanks for reporting back.

I've re-opened the question as we typically don't close questions here on ROS Answers if they have an answer. We mark them as answered by ticking the checkmark to the left of the answer. I've done that for you.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-16 02:18:21 -0500 )edit

Apologies for commenting again on this thread and, indeed, mine is rather a question @lusim: about your original statement "...dependencies compiled. (log4cxx, boost 1.58, tinyxml, python2.7)...", how did you get python2.7 compiled? I guess you succeded with the shared option, since I understood is the option then needed for ROS compilation, but no way to achieve it. Could you please share the procedure?

And @gvdhoom: I'm also using Yocto, but not for this project, since I need to have Ubuntu on target and as far as understood it can't be achieved.

crosadin gravatar image crosadin  ( 2019-05-19 01:32:27 -0500 )edit

hi crosadin, for more information about buildroot, please check www.buildroot.org . You can build your embedded Linux system with buildroot by activating the packages you want. I actually managed building ROS Kinetic as an additional package in buildroot.

lusim gravatar image lusim  ( 2019-05-20 11:40:35 -0500 )edit

Hi lusim, thanks for your feedback. I went through buildroot, but native distribution does not include my target board (NXP Sabre-AI). If I finally reach to define the right specific defconfig file, I'll share it. Bye

crosadin gravatar image crosadin  ( 2019-05-24 01:30:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-11-14 03:10:03 -0500

Seen: 1,038 times

Last updated: Nov 15 '18