我不知道为什么我无法在macOS上安装mongodb c驱动程序。
我正在使用自动构建脚本(eosio_build.sh)安装eos,但卡在mongodb部分。
即使我单独安装mongo-c-driver,结果也是一样。
我还尝试了不同的mongo-c-driver版本(1.9.3、1.10.2、1.12.0),但都失败了。
-- The C compiler identification is ;AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Using bundled libbson
libbson version (from VERSION_CURRENT file): 1.10.2
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for reallocf
-- Looking for reallocf - found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
-- struct timespec found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - found
-- Looking for syscall
-- Looking for syscall - found
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH - Success
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH - Success
CMake Deprecation Warning at src/libbson/CMakeLists.txt:148 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
libmongoc version (from VERSION_CURRENT file): 1.10.2
-- Searching for zlib CMake packages
-- Found ZLIB: /usr/local/lib/libz.dylib (found version "1.2.8")
-- zlib found version "1.2.8"
-- zlib include path "/usr/local/include"
-- zlib libraries "/usr/local/lib/libz.dylib"
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Searching for sasl/sasl.h
-- Found in /usr/include
-- Searching for libsasl2
-- Found /usr/lib/libsasl2.dylib
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Looking for res_nsearch
-- Looking for res_nsearch - found
-- Looking for res_ndestroy
-- Looking for res_ndestroy - found
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- Detected parameters: accept (int, struct sockaddr *, socklen_t *)
-- Searching for compression library header snappy-c.h
-- Found in /usr/local/include
-- Searching for libsnappy
-- Found /usr/local/lib/libsnappy.a
-- Compiling against Secure Transport
-- Compiling against Cyrus SASL
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mongo-c-driver-1.10.2/cmake-build
Scanning dependencies of target bson_static
Scanning dependencies of target bson_shared
[ 0%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.o
[ 0%] Building C object src/libbson/CMakeFiles/bson_static.dir/src/bson/bson.c.o
[ 1%] Building C object src/libbson/CMakeFiles/bson_static.dir/src/bson/bcon.c.o
[ 1%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bson.c.o
[ 1%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bson-atomic.c.o
[ 2%] Building C object src/libbson/CMakeFiles/bson_static.dir/src/bson/bson-atomic.c.o
...(progress 2%~12%)
[ 12%] Building C object src/libbson/CMakeFiles/bson_static.dir/__/common/common-b64.c.o
[ 13%] Building C object src/libbson/CMakeFiles/bson_shared.dir/__/common/common-b64.c.o
[ 14%] Linking C shared library libbson-1.0.dylib
[ 14%] Linking C static library libbson-static-1.0.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libbson-static-1.0.a(bson-atomic.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libbson-static-1.0.a(bson-atomic.c.o) has no symbols
[ 14%] Built target bson_static
[ 14%] Built target bson_shared
Scanning dependencies of target mongoc_static
Scanning dependencies of target bson-streaming-reader
Scanning dependencies of target json-to-bson
Scanning dependencies of target bson-to-json
[ 14%] Building C object src/libbson/CMakeFiles/bson-to-json.dir/examples/bson-to-json.c.o
[ 14%] Building C object src/libbson/CMakeFiles/json-to-bson.dir/examples/json-to-bson.c.o
[ 15%] Building C object src/libbson/CMakeFiles/bson-streaming-reader.dir/examples/bson-streaming-reader.c.o
[ 15%] Linking C executable bson-to-json
[ 15%] Linking C executable json-to-bson
[ 15%] Linking C executable bson-streaming-reader
[ 15%] Built target bson-to-json
[ 15%] Built target json-to-bson
[ 15%] Built target bson-streaming-reader
Scanning dependencies of target bcon-speed
Scanning dependencies of target bson-metrics
Scanning dependencies of target bcon-col-view
[ 15%] Building C object src/libbson/CMakeFiles/bcon-speed.dir/examples/bcon-speed.c.o
[ 15%] Building C object src/libbson/CMakeFiles/bson-metrics.dir/examples/bson-metrics.c.o
[ 15%] Building C object src/libbson/CMakeFiles/bcon-col-view.dir/examples/bcon-col-view.c.o
[ 16%] Linking C executable bcon-speed
[ 16%] Linking C executable bcon-col-view
[ 16%] Linking C executable bson-metrics
[ 16%] Built target bcon-speed
[ 16%] Built target bcon-col-view
Scanning dependencies of target bson-validate
Scanning dependencies of target mongoc_shared
[ 16%] Built target bson-metrics
[ 17%] Building C object src/libbson/CMakeFiles/bson-validate.dir/examples/bson-validate.c.o
[ 17%] Building C object src/libmongoc/CMakeFiles/mongoc_static.dir/src/mongoc/mongoc-apm.c.o
[ 18%] Building C object src/libmongoc/CMakeFiles/mongoc_static.dir/src/mongoc/mongoc-array.c.o
[ 18%] Linking C executable bson-validate
[ 18%] Built target bson-validate
[ 18%] Building C object src/libmongoc/CMakeFiles/mongoc_static.dir/src/mongoc/mongoc-async.c.o
.... (progress 18~60&)
[ 60%] Building C object src/libmongoc/CMakeFiles/mongoc_static.dir/src/mongoc/mongoc-cyrus.c.o
[ 60%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cluster-cyrus.c.o
[ 61%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cyrus.c.o
[ 61%] Linking C static library libmongoc-static-1.0.a
[ 61%] Linking C shared library libmongoc-1.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libmongoc-static-1.0.a(mongoc-linux-distro-scanner.c.o) has no symbols
Undefined symbols for architecture x86_64:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"std::logic_error::logic_error(char const*)", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"std::length_error::~length_error()", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
snappy::STLStringResizeUninitialized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, unsigned long) in libsnappy.a(snappy.cc.o)
snappy::Compress(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libsnappy.a(snappy.cc.o)
"std::terminate()", referenced from:
___clang_call_terminate in libsnappy.a(snappy.cc.o)
"typeinfo for std::length_error", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for snappy::Sink in libsnappy.a(snappy-sinksource.cc.o)
typeinfo for snappy::Source in libsnappy.a(snappy-sinksource.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for snappy::ByteArraySource in libsnappy.a(snappy-sinksource.cc.o)
typeinfo for snappy::UncheckedByteArraySink in libsnappy.a(snappy-sinksource.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::length_error", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"operator delete[](void*)", referenced from:
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::internal::WorkingMemory::~WorkingMemory() in libsnappy.a(snappy.cc.o)
snappy::SnappySinkAllocator::Deleter(void*, char const*, unsigned long) in libsnappy.a(snappy.cc.o)
"operator delete(void*)", referenced from:
std::__1::__vector_base<char*, std::__1::allocator<char*> >::~__vector_base() in libsnappy.a(snappy.cc.o)
std::__1::__vector_base<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::~__vector_base() in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::~__split_buffer() in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::~__split_buffer() in libsnappy.a(snappy.cc.o)
snappy::ByteArraySource::~ByteArraySource() in libsnappy.a(snappy-sinksource.cc.o)
snappy::UncheckedByteArraySink::~UncheckedByteArraySink() in libsnappy.a(snappy-sinksource.cc.o)
"operator new[](unsigned long)", referenced from:
snappy::internal::WorkingMemory::GetHashTable(unsigned long, int*) in libsnappy.a(snappy.cc.o)
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::SnappySinkAllocator::Allocate(int) in libsnappy.a(snappy.cc.o)
"operator new(unsigned long)", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"___cxa_allocate_exception", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"___cxa_begin_catch", referenced from:
___clang_call_terminate in libsnappy.a(snappy.cc.o)
"___cxa_free_exception", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"___cxa_pure_virtual", referenced from:
vtable for snappy::Sink in libsnappy.a(snappy-sinksource.cc.o)
vtable for snappy::Source in libsnappy.a(snappy-sinksource.cc.o)
"___cxa_throw", referenced from:
std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::allocate(unsigned long) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<snappy::SnappySinkAllocator::Datablock>&) in libsnappy.a(snappy.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libsnappy.a(snappy.cc.o)
"___gxx_personality_v0", referenced from:
snappy::GetUncompressedLength(snappy::Source*, unsigned int*) in libsnappy.a(snappy.cc.o)
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::RawUncompressToIOVec(char const*, unsigned long, iovec const*, unsigned long) in libsnappy.a(snappy.cc.o)
bool snappy::InternalUncompress<snappy::SnappyIOVecWriter>(snappy::Source*, snappy::SnappyIOVecWriter*) in libsnappy.a(snappy.cc.o)
snappy::RawUncompress(char const*, unsigned long, char*) in libsnappy.a(snappy.cc.o)
bool snappy::InternalUncompress<snappy::SnappyArrayWriter>(snappy::Source*, snappy::SnappyArrayWriter*) in libsnappy.a(snappy.cc.o)
snappy::IsValidCompressedBuffer(char const*, unsigned long) in libsnappy.a(snappy.cc.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/libmongoc/libmongoc-1.0.0.0.0.dylib] Error 1
make[1]: *** [src/libmongoc/CMakeFiles/mongoc_shared.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libmongoc-static-1.0.a(mongoc-linux-distro-scanner.c.o) has no symbols
[ 61%] Built target mongoc_static
make: *** [all] Error 2
Error compiling MongoDB C driver.
Exiting now.`