Проблема кросс-компиляции облачной библиотеки точек для Raspberry Pi 3 - PullRequest
0 голосов
/ 22 июня 2019

Я пытаюсь выполнить кросс-компиляцию библиотеки Cloud Points для Raspberry Pi, используя набор инструментов crosstools-ng (GCC 6.5. И копируя / usr и / lib из Rpi). Я успешно настроил сборку с помощью cmake. Но при сборке получаю следующую ошибку

In file included from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/arm-unknown-linux-gnueabi/bits/gthr-default.h:48:0,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/arm-unknown-linux-gnueabi/bits/gthr.h:151,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/atomicity.h:35,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/bits/ios_base.h:39,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ios:42,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ostream:38,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/iostream:39,
                 from /home/avaneesh/pcl-1.9.1/common/include/pcl/pcl_macros.h:69,
                 from /home/avaneesh/pcl-1.9.1/common/include/pcl/point_types.h:42,
                 from /home/avaneesh/pcl-1.9.1/common/src/point_types.cpp:37:
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:122:34: error: too many initializers for '__pthread_mutex_s'
     __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
                                  ^
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:177:44: error: too many initializers for '__pthread_mutex_s'
     __gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT;
                                            ^
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:255:32: error: invalid conversion from 'void*' to 'unsigned int' [-fpermissive]
     __gthread_cond_t _M_cond = __GTHREAD_COND_INIT;

Мой файл toolchain.cmake

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc)

SET(CMAKE_CXX_COMPILER
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /home/avaneesh/x-tools/arm-unknown-linux-gnueabi;/home/avaneesh/rpi-build-tools/bin/RaspberryPi)
#SET(CMAKE_SYSROOT /home/avaneesh/rpi-build-tools/bin/RaspberryPi)
#SET(CMAKE_FIND_ROOT_PATH /home/avaneesh/rpi-build-tools/bin/RaspberryPi)
#list( APPEND CMAKE_FIND_ROOT_PATH "/home/avaneesh/x-tools/arm-unknown-linux-gnueabi" )

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set( HAVE_POSIX_MEMALIGN_EXITCODE "INTERNAL=0")

После настройки проекта с использованием cmake GUI я попытался собрать используя make VERBOSE = 1, я получил

cd /home/avaneesh/rpi-projects/pcl_build/common && /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++  -DPCLAPI_EXPORTS -isystem /home/avaneesh/rpi-build-tools/bin/RaspberryPi/usr/include/eigen3 -I/home/avaneesh/pcl-1.9.1/recognition/include/pcl/recognition/3rdparty -isystem /home/avaneesh/rpi-build-tools/bin/RaspberryPi/usr/include -I/home/avaneesh/rpi-projects/pcl_build/include -I/home/avaneesh/pcl-1.9.1/common/include  -Wall -Wextra -Wno-unknown-pragmas -fno-strict-aliasing -Wno-format-extra-args -Wno-sign-compare -Wno-invalid-offsetof -Wno-conversion -ffloat-store -Wabi -pthread -O2 -g -DNDEBUG -fPIC   -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -o CMakeFiles/pcl_common.dir/src/point_types.cpp.o -c /home/avaneesh/pcl-1.9.1/common/src/point_types.cpp
In file included from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/arm-unknown-linux-gnueabi/bits/gthr-default.h:48:0,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/arm-unknown-linux-gnueabi/bits/gthr.h:151,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/atomicity.h:35,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/bits/ios_base.h:39,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ios:42,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ostream:38,
                 from /home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/iostream:39,
                 from /home/avaneesh/pcl-1.9.1/common/include/pcl/pcl_macros.h:69,
                 from /home/avaneesh/pcl-1.9.1/common/include/pcl/point_types.h:42,
                 from /home/avaneesh/pcl-1.9.1/common/src/point_types.cpp:37:
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:122:34: error: too many initializers for '__pthread_mutex_s'
     __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
                                  ^
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:177:44: error: too many initializers for '__pthread_mutex_s'
     __gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT;
                                            ^
/home/avaneesh/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/include/c++/6.5.0/ext/concurrence.h:255:32: error: invalid conversion from 'void*' to 'unsigned int' [-fpermissive]
     __gthread_cond_t _M_cond = __GTHREAD_COND_INIT;
                                ^
common/CMakeFiles/pcl_common.dir/build.make:62: recipe for target 'common/CMakeFiles/pcl_common.dir/src/point_types.cpp.o' failed
make[2]: *** [common/CMakeFiles/pcl_common.dir/src/point_types.cpp.o] Error 1
make[2]: Leaving directory '/home/avaneesh/rpi-projects/pcl_build'
CMakeFiles/Makefile2:117: recipe for target 'common/CMakeFiles/pcl_common.dir/all' failed
make[1]: *** [common/CMakeFiles/pcl_common.dir/all] Error 2
make[1]: Leaving directory '/home/avaneesh/rpi-projects/pcl_build'
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

...