
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 libraries. CMake is dropping the item. -- Generating done -- Build files have been written to: /home/user/Desktop/TCG4_ROS/ros_files_comm/build_isolated/rospack ==> make -j4 -l4 in '/home/user/Desktop/TCG4_ROS/ros_files_comm/build_isolated/rospack' Scanning dependencies of target rospack [ 11%] Building CXX object CMakeFiles/rospack.dir/src/rospack.cpp.o [ 22%] Building CXX object CMakeFiles/rospack.dir/src/rospack_backcompat.cpp.o [ 33%] Building CXX object CMakeFiles/rospack.dir/src/rospack_cmdline.cpp.o [ 44%] Building CXX object CMakeFiles/rospack.dir/src/utils.cpp.o In file included from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/python2.7/Python.h:8:0, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/src/rospack.cpp:72: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/python2.7 /pyconfig.h:1193:0: warning: "_POSIX_C_SOURCE" redefined #define _POSIX_C_SOURCE 200112L In file included from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf/bits/os_defines.h:39:0, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf/bits/c++config.h:533, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/cstddef:49, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/boost/tr1/detail/config.hpp:9, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/boost/tr1/unordered_set.hpp:8, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/include/rospack/rospack.h:108, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/src/rospack.cpp:28: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/features.h:257:0: note: this is the location of the previous definition # define _POSIX_C_SOURCE 200809L In file included from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/python2.7/Python.h:8:0, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/src/rospack.cpp:72: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/python2.7/pyconfig.h:1215:0: warning: "_XOPEN_SOURCE" redefined #define _XOPEN_SOURCE 600 In file included from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/arm- linux-gnueabihf/bits/os_defines.h:39:0, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf/bits/c++config.h:533, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/cstddef:49, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/boost/tr1/detail/config.hpp:9, from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/boost/tr1/unordered_set.hpp:8, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/include/rospack/rospack.h:108, from /home/user/Desktop/TCG4_ROS/ros_files_comm/src/rospack/src/rospack.cpp:28: /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/features.h:198:0: note: this is the location of the previous definition # define _XOPEN_SOURCE 700 [ 55%] Linking CXX shared library /home/user/Desktop/TCG4_ROS/ros_files_comm/devel_isolated/rospack/lib/librospack.so [ 55%] Built target rospack Scanning dependencies of target rosstackexe Scanning dependencies of target rospackexe [ 77%] Building CXX object CMakeFiles/rospackexe.dir/src/rospack_main.cpp.o [ 77%] Building CXX object CMakeFiles/rosstackexe.dir/src/rosstack_main.cpp.o [100%] Linking CXX executable /home/user/Desktop/TCG4_ROS/ros_files_comm/devel_isolated/rospack/bin/rospack [100%] Linking CXX executable /home/user/Desktop/TCG4_ROS/ros_files_comm/devel_isolated/rospack/bin/rosstack //home/homeuser//userDesktop//DesktopTCG4_ROS//TCG4_ROSros_files_comm //ros_files_commdevel_isolated//devel_isolatedrospack//rospacklib//liblibrospack.so/:librospack.so :undefined undefinedreference referenceto to` PyTuple_SetItem`'PyTuple_SetItem '/ home//homeuser//userDesktop//DesktopTCG4_ROS//TCG4_ROSros_files_comm //ros_files_commdevel_isolated/rospack/lib/librospack.so: undefined reference/ todevel_isolated /`rospackPy_InitializeEx/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/Py_InitializeExdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackvtable/ libfor/ librospack.soTiXmlDocument:' undefined/ homereference/ userto/ Desktop`/vtableTCG4_ROS /forros_files_comm /TiXmlDocumentdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyDict_GetItemString/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyDict_GetItemStringdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlNode/:lib:/~librospack.soTiXmlNode:( )undefined' reference/ hometo/ user`/TiXmlNodeDesktop:/:TCG4_ROS~/TiXmlNoderos_files_comm(/)devel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyModule_GetDict/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyModule_GetDictdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyTuple_New/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyTuple_Newdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospack_Py_NoneStruct/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/_Py_NoneStructdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlNode/:lib:/FirstChildElementlibrospack.so(:char undefinedconst *reference) toconst '` TiXmlNode/:home:/FirstChildElementuser(/charDesktop /constTCG4_ROS*/)ros_files_comm /constdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyObject_CallObject/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyObject_CallObjectdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyString_FromString/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyString_FromStringdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlDocument/:lib:/TiXmlDocumentlibrospack.so(:) 'undefined /referencehome /touser /`DesktopTiXmlDocument/:TCG4_ROS:/TiXmlDocumentros_files_comm(/)devel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyGILState_Release/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyGILState_Releasedevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlNode/:lib:/FirstChildElementlibrospack.so(:) undefinedconst 'reference /tohome /`userTiXmlNode/:Desktop:/FirstChildElementTCG4_ROS(/)ros_files_comm /constdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlElement/:lib:/Attributelibrospack.so(:char undefinedconst *reference) toconst '` TiXmlElement/:home:/Attributeuser(/charDesktop /constTCG4_ROS*/)ros_files_comm /constdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyObject_IsTrue/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyObject_IsTruedevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlElement/:lib:/GetTextlibrospack.so(:) undefinedconst 'reference /tohome /`userTiXmlElement/:Desktop:/GetTextTCG4_ROS(/)ros_files_comm /constdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyCallable_Check/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyCallable_Checkdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackTiXmlNode/:lib:/IterateChildrenlibrospack.so(:char undefinedconst *reference, toTiXmlNode `constTiXmlNode*:): IterateChildrenconst('char /consthome*/,user /TiXmlNodeDesktop /constTCG4_ROS*/)ros_files_comm /constdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyString_AsString/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyString_AsStringdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyGILState_Ensure/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyGILState_Ensuredevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyErr_Print/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyErr_Printdevel_isolated'/ rospack//homelib//userlibrospack.so/:Desktop /undefinedTCG4_ROS /referenceros_files_comm /todevel_isolated /`rospackPyImport_Import/'lib //librospack.sohome:/ userundefined/ Desktopreference/ TCG4_ROSto/ ros_files_comm`/PyImport_Importdevel_isolated'/ rospack//homelib//user/librospack.soDesktop:/ TCG4_ROSundefined/ ros_files_commreference/ devel_isolatedto/ rospack`/TiXmlDocumentlib:/:librospack.soLoadFile:( charundefined constreference* ,to TiXmlEncoding`)TiXmlDocument': :/LoadFilehome(/charuser /constDesktop*/,TCG4_ROS /TiXmlEncodingros_files_comm)/'devel_isolated //rospackhome//libuser//librospack.soDesktop:/ TCG4_ROSundefined/ ros_files_commreference/ devel_isolatedto/ rospack`/TiXmlNodelib:/:librospack.soNextSiblingElement:( charundefined constreference* )to const`'TiXmlNode ::NextSiblingElement(char const*) const' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status CMakeFiles/rosstackexe.dir/build.make:101: recipe for target '/home/user/Desktop/TCG4_ROS/ros_files_comm /devel_isolated/rospack/bin/rosstack' failed make[2]: *** [/home/user/Desktop/TCG4_ROS/ros_files_comm/devel_isolated/rospack/bin/rosstack] Error 1 CMakeFiles/rospackexe.dir/build.make:101: recipe for target '/home/user/Desktop/TCG4_ROS/ros_files_comm /devel_isolated/rospack/bin/rospack' failed make[2]: *** [/home/user/Desktop/TCG4_ROS/ros_files_comm/devel_isolated/rospack/bin/rospack] Error 1 CMakeFiles/Makefile2:296: recipe for target 'CMakeFiles/rospackexe.dir/all' failed make[1]: *** [CMakeFiles/rospackexe.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/rosstackexe.dir/all' failed make[1]: *** [CMakeFiles/rosstackexe.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 <== Failed to process package 'rospack': Command '['/home/user/Desktop/TCG4_ROS/ros_files_comm/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2 Reproduce this error by running: ==> cd /home/user/Desktop/TCG4_ROS/ros_files_comm/build_isolated/rospack && /home/user/Desktop/TCG4_ROS/ros_files_comm/install_isolated/env.sh make -j4 -l4 Command failed, exiting. I hope somebody can help me with this error.
Originally posted by lusim on ROS Answers with karma: 16 on 2018-11-14
Post score: 0
Original comments
Comment by gvdhoorn on 2018-11-14:
Whenever I see someone attempting to cross-compile I post this reference to bmwcarit/meta-ros.
Comment by lusim on 2018-11-14:
Thanks for your answer. The only problem is that i can't use Yocto to build my files. I have to use buildroot.
Comment by gvdhoorn on 2018-11-14:
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.