Cross compiling cpprestsdk for the Raspberry Pi
pwrandall opened this issue · 1 comments
Hi,
I am following the instructions for cross compiling nmos-cpp for the Raspberry Pi and I am getting an error building the C++ REST SDK. The error is shown below.
prandall@ddv-vm-ubuntu20:$ cd rpi//rpi$ ls
prandall@ddv-vm-ubuntu20:
environment_setup_rpi_pwr.sh libs Toolchain-rpi.cmake tools
prandall@ddv-vm-ubuntu20:/rpi$ . environment_setup_rpi_pwr.sh/rpi$ cd ..
prandall@ddv-vm-ubuntu20:
prandall@ddv-vm-ubuntu20:$ cd cpprestsdk/Release//cpprestsdk/Release$ ls
prandall@ddv-vm-ubuntu20:
build.rpi build.xilinx cmake CMakeLists.txt include libs public_apis_doxyfile samples src tests
prandall@ddv-vm-ubuntu20:~/cpprestsdk/Release$ cmake .. \
-DCMAKE_BUILD_TYPE=Release
-DCPPREST_EXCLUDE_COMPRESSION=1
-DWERROR=0
-DCMAKE_TOOLCHAIN_FILE=${RPI_ROOT}/Toolchain-rpi.cmake
-DCMAKE_INSTALL_PREFIX=${RPI_LIBS}
-DBUILD_SAMPLES=0
-DBUILD_TESTS=0
-- Using Raspberry Pi Tools directory at /home/prandall/rpi/tools
-- Using Raspberry Pi Tools directory at /home/prandall/rpi/tools
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/prandall/rpi/tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/prandall/rpi/tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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
-- Looking for include file xlocale.h
-- Looking for include file xlocale.h - found
-- Setting gcc options
-- websocketpp not found, using the embedded version
-- Found Boost: /home/prandall/rpi/libs/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found version "1.78.0") found components: random system thread filesystem chrono atomic date_time regex
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for one of the modules 'openssl'
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /home/prandall/cpprestsdk/Release
prandall@ddv-vm-ubuntu20:/cpprestsdk/Release$ make/cpprestsdk/Release$
[ 3%] Building CXX object Release/src/CMakeFiles/cpprest.dir/http/client/http_client.cpp.o
In file included from /home/prandall/rpi/libs/include/boost/asio/buffer.hpp:26:0,
from /home/prandall/rpi/libs/include/boost/asio/ssl/context.hpp:21,
from /home/prandall/rpi/libs/include/boost/asio/ssl.hpp:18,
from /home/prandall/cpprestsdk/Release/include/cpprest/http_client.h:68,
from /home/prandall/cpprestsdk/Release/src/pch/stdafx.h:99,
from /home/prandall/cpprestsdk/Release/src/http/client/http_client.cpp:16:
/home/prandall/rpi/libs/include/boost/asio/detail/memory.hpp: In function 'void* boost::asio::detail::align(std::size_t, std::size_t, void*&, std::size_t&)':
/home/prandall/rpi/libs/include/boost/asio/detail/memory.hpp:58:10: error: 'align' is not a member of 'std'
return std::align(alignment, size, ptr, space);
^
/home/prandall/rpi/libs/include/boost/asio/detail/memory.hpp:58:10: note: suggested alternative:
/home/prandall/rpi/libs/include/boost/asio/detail/memory.hpp:55:14: note: 'boost::asio::detail::align'
inline void* align(std::size_t alignment,
^
make[2]: *** [Release/src/CMakeFiles/cpprest.dir/build.make:76: Release/src/CMakeFiles/cpprest.dir/http/client/http_client.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: Release/src/CMakeFiles/cpprest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
prandall@ddv-vm-ubuntu20:
FWIW, the normal building instructions, and the Conan package, work perfectly fine on the arm64 NVIDIA Jetson. I haven't tried on the Pi however!