How to cross compile Kinetic workspace for Raspberry PI

asked 2017-06-01 14:24:31 -0500

orlando9427 gravatar image

I'm using Kinetic for developing packages that works in RPI but when I try to compile on RPI, it freezes. I started reading about cross compiling in general and I think is what I need but the problem is, altough there are so much information about cross compiling for RPI there are not information up to date for cross compiling along with ROS. I've tried EROS, CodeSourcery, Raspberry Tools and nothing works, always get libraries errors. I copy the PI_ROOT to /opt/rpi and I was modifying some symbolic links that was broken, and could sort some errors. Here is the CMake tool that I'm using currently.

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER     /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER   /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH /opt/rpi) # change this accordingly
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}")
# 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)

And this is the error that it throws

catkin_make -DCMAKE_TOOLCHAIN_FILE=/opt/tools/toolchain.cmake
Base path: /home/ws
Source space: /home/ws/src
Build space: /home/ws/build
Devel space: /home/ws/devel
Install space: /home/ws/install
####
#### Running command: "cmake /home/ws/src -DCMAKE_TOOLCHAIN_FILE=/opt/tools/toolchain.cmake -DCATKIN_DEVEL_PREFIX=/home/ws/devel -DCMAKE_INSTALL_PREFIX=/home/ws/install -G Unix Makefiles" in "/home/ws/build"
####
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /opt/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ws/build/test_results
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.6
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 3 packages in topological order:
-- ~~  - ws_msg
-- ~~  - conectivity
-- ~~  - hardware
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'ws_msg'
-- ==> add_subdirectory(ws_msg)
CMake Error at /opt/ros/kinetic/share/roscpp/cmake/roscppConfig.cmake:141 ...
(more)
edit retag flag offensive close merge delete