我正在尝试使用VCPKG 包管理器在Raspberry Pi 4上构建boost-container。问题是编译标志之一对 rpi 上的编译器无效(但对 PC 来说可以),所以我需要删除该标志。这是极其困难的,因为 VCPKG 使用 cmake,用 ninja 构建,它用于构建 boost。-m64
b2
我需要有 VCPKG: 的版本ebe505081b667a9f9a56596057f63ed20be237a5
。所以要重现 RPI 上的问题:
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg/
git checkout ebe505081b667a9f9a56596057f63ed20be237a5
./bootstrap-vcpkg.sh -useSystemBinaries # for that version it is necessairy for RPI
./vcpkg install boost-container
运行上面的命令后,我看到-m64
标志有问题:
Starting package 17/17: boost-container:x64-linux
Building package boost-container[core]:x64-linux...
-- Downloading https://github.com/boostorg/container/archive/boost-1.71.0.tar.gz...
-- Extracting source /home/agh/vcpkg/downloads/boostorg-container-boost-1.71.0.tar.gz
-- Using source at /home/agh/vcpkg/buildtrees/boost-container/src/ost-1.71.0-aa14783b9a
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:136 (message):
Command failed: /usr/bin/cmake --build . --config Debug --target install -- -v
Working Directory: /home/agh/vcpkg/buildtrees/boost-container/x64-linux-dbg
See logs for more information:
/home/agh/vcpkg/buildtrees/boost-container/install-x64-linux-dbg-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process)
scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
installed/x64-linux/share/boost-build/boost-modular-build.cmake:90 (vcpkg_install_cmake)
ports/boost-container/portfile.cmake:14 (boost_modular_build)
scripts/ports.cmake:94 (include)
Error: Building package boost-container:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: boost-container:x64-linux
Vcpkg version: 2019.09.12-unknownhash
Additionally, attach any relevant sections from the log files above.
But the problem was:
gcc.compile.c /home/agh/vcpkg/buildtrees/boost-container/x64-linux-dbg/boost/build/e3cde813a01d557174a1b469417f2150/alloc_lib.o
c++: error: unrecognized command-line option ‘-m64’
"/usr/bin/c++" -x c -m64 -pthread -O0 -fno-inline -Wall -g -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTAINER_STATIC_LINK=1 -I"../include" -I"/home/agh/vcpkg/installed/x64-linux/include" -c -o "/home/agh/vcpkg/buildtrees/boost-container/x64-linux-dbg/boost/build/e3cde813a01d557174a1b469417f2150/alloc_lib.o" "../src/alloc_lib.c"
...failed gcc.compile.c /home/agh/vcpkg/buildtrees/boost-container/x64-linux-dbg/boost/build/e3cde813a01d557174a1b469417f2150/alloc_lib.o...
...failed updating 1 target...
...updated 5 targets...
ninja: build stopped: subcommand failed.
我检查了工作目录:
find /home/agh/vcpkg/buildtrees/boost-container/x64-linux-dbg -type f | xargs grep m64
但没有什么可以删除我注意到的标志。
我发现的唯一解决方案是创建编译器包装二进制文件,它只忽略一个标志-m64
- 但我希望为 boost-contaier 的 CMake 创建补丁是更好的解决方案?