Cross Compiling ROS Kinetic for ARM Cortex-A7
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 ...
Whenever I see someone attempting to cross-compile I post this reference to bmwcarit/meta-ros.
Thanks for your answer. The only problem is that i can't use Yocto to build my files. I have to use buildroot.
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.