【问题标题】:Cross compiling MongoDB C++ driver for ARM. Cannot find Boost Libraries为 ARM 交叉编译 MongoDB C++ 驱动程序。找不到 Boost 库
【发布时间】:2014-02-25 15:57:27
【问题描述】:

我试图让 MongoDB 驱动程序在 ARM 平台上运行,但构建系统 SCons 拒绝我的 Boost 库。

我摆弄了 libpath、extrapath 和 extrapathdyn 的不同组合,但无济于事。

gwue@Anubis:~/mongo$ scons -j4 --cc=/home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-gcc --cxx=/home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-g++ --prefix=/tmp/mongo --sharedclient --use-system-boost --cpppath=/home/gwue/boost1_54 --libpath=/home/gwue/boost1_54/stage/lib --extrapathdyn=/home/gwue/boost1_54/stage/lib --full install-mongoclient

结果:

scons: Reading SConscript files ...
scons version: 2.3.0
python version: 2 7 5 'final' 0
Checking whether the C++ compiler works(cached) yes
Checking whether the C compiler works(cached) yes
Checking if C++ compiler "/home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-g++" is GCC... (cached) yes
Checking if C compiler "/home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-gcc" is GCC... (cached) yes
Checking if C compiler supports -Wno-unused-local-typedefs... (cached) yes
Checking if C compiler supports -Wno-unused-function... (cached) yes
Checking if C compiler supports -Wno-unused-private-field... (cached) no
Checking if C compiler supports -Wno-deprecated-declarations... (cached) yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... (cached) no
Checking if C compiler supports -Wno-unused-const-variable... (cached) no
Checking if C compiler supports -fno-builtin-memcmp... (cached) yes
Checking for __thread... (cached) yes
Checking for C++ header file boost/filesystem/operations.hpp... (cached) yes
Checking for C++ library boost_thread-mt... (cached) no
Checking for C++ library boost_thread... (cached) no
Checking for C++ library boost_filesystem-mt... (cached) no
Checking for C++ library boost_filesystem... (cached) no
Checking for C++ library boost_program_options-mt... (cached) no
Checking for C++ library boost_program_options... (cached) yes
Checking for C++ library boost_system-mt... (cached) no
Checking for C++ library boost_system... (cached) yes
Checking for C header file unistd.h... (cached) yes
Checking whether clock_gettime is declared... (cached) yes
Checking for C library rt... (cached) yes
Checking for C++ header file execinfo.h... (cached) yes
Checking whether backtrace is declared... (cached) yes
Checking whether backtrace_symbols is declared... (cached) yes
Checking whether backtrace_symbols_fd is declared... (cached) yes
Checking for C library pcap... (cached) no
Checking for C library wpcap... (cached) no
Checking if __malloc_hook is declared volatile... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
<snip>
Install file: "build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/client_build/libmongoclient.a" as "/tmp/mongo/lib/libmongoclient.a"
/home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-g++ -o build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/shim_boost.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DBOOST_THREAD_VERSION=2 -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost -Isrc -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/mongo -Isrc/mongo -I/home/gwue/boost1_54 -I/home/gwue/boost1_54/stage/lib/include -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/v8/include -Isrc/third_party/v8/include -Ibuild/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/yaml-cpp-0.5.1/include -Isrc/third_party/yaml-cpp-0.5.1/include src/third_party/shim_boost.cpp
ar rc build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/libshim_boost.a build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/shim_boost.o
ranlib build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/third_party/libshim_boost.a
Target 'build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/client_build/libmongoclient.so' depends on the availability of a system provided library for 'boost_filesystem', but no suitable library was found during configuration.
scons: *** [build/linux2/cc__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-gcc/cpppath__home_gwue_boost1_54/cxx__home_gwue_armgcc_lin_bin_arm-xilinx-linux-gnueabi-g++/extrapathdyn__home_gwue_boost1_54_stage_lib/libpath__home_gwue_boost1_54_stage_lib/use-system-boost/client_build/libmongoclient.so] Explicit exit, status 1
scons: building terminated because of errors.

我像这样编译了 Boost 库:

./bootstrap.sh
./b2 --without-python --without-iostreams -j4 toolset=gcc-arm

user-config.jam 包含:

using gcc : arm : /home/gwue/armgcc/lin/bin/arm-xilinx-linux-gnueabi-g++ ;

该问题仅在尝试交叉编译时出现。使用 x86_64 库和编译器,一切正常。 我怀疑我的 ARM Boost 库本质上是坏的,因为我们已经在一个已经存在的项目中使用它们就好了。

关于如何说服 scons 接受这些库的任何想法?

【问题讨论】:

  • 我认为在您 ed 的部分中,您删除了编译行(对 g++ 的实际调用)。通过检查编译行,我们可以查看是否使用了正确的库路径(-L)。你能告诉我们编译输出吗?
  • 我在问题取消前添加了最后几行。据我所知,scons 甚至没有尝试链接。

标签: c++ mongodb boost arm scons


【解决方案1】:

我仍然无法让它工作。 至少有一个纯实现 http://docs.mongodb.org/ecosystem/drivers/c/ 没有依赖关系。 这个编译得很好,所以我们可能会求助于它。

【讨论】:

    猜你喜欢
    • 2016-01-15
    • 1970-01-01
    • 2014-02-09
    • 1970-01-01
    • 1970-01-01
    • 2018-09-28
    • 1970-01-01
    • 2010-10-07
    • 1970-01-01
    相关资源
    最近更新 更多