我正在尝试在 FreeBSD 10 上构建 Tokumx,但遇到以下错误:
[ 27%] Building CXX object src/third_party/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/toku_crash.cc.o
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp: In function 'int mongo::pal::{anonymous}::addrtosymstr(void*, char*, int)':
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:71:9: error: 'Dl_info_t' was not declared in this scope
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:71:19: error: expected ';' before 'symbolInfo'
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:72:30: error: 'symbolInfo' was not declared in this scope
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:75:13: error: 'symbolInfo' was not declared in this scope
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:87:25: error: 'symbolInfo' was not declared in this scope
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp: In function 'int mongo::pal::backtrace_emulation(void**, int)':
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:106:57: error: 'walkcontext' was not declared in this scope
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp: In function 'int mongo::pal::{anonymous}::addrtosymstr(void*, char*, int)':
/home/tokumx/mongo/src/mongo/platform/backtrace.cpp:92:5: warning: control reaches end of non-void function [-Wreturn-type]
[ 27%] Building CXX object src/mongo/util/CMakeFiles/stacktrace.dir/stacktrace.cpp.o
[ 27%] Building CXX object src/third_party/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/toku_path.cc.o
gmake[2]: *** [src/mongo/platform/CMakeFiles/platform.dir/backtrace.cpp.o] Error 1
gmake[1]: *** [src/mongo/platform/CMakeFiles/platform.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 27%] Building CXX object src/mongo/util/CMakeFiles/stringutils.dir/base64.cpp.o
[ 27%] Building CXX object src/third_party/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/toku_pthread.cc.o
[ 28%] Building CXX object src/third_party/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/toku_time.cc.o
Linking CXX static library libtokuportability_static_conv.a
[ 28%] Built target tokuportability_static_conv
Linking CXX static library libstacktrace.a
[ 28%] Built target stacktrace
Linking CXX static library libstringutils.a
[ 28%] Built target stringutils
gmake: *** [all] Error 2
我的 cmake 调用如下所示:
CC=gcc47 CPP=cpp47 CXX=g++47 cmake --disable-warnings-as-errors -D CMAKE_BUILD_TYPE=Release -D TOKU_DEBUG_PARANOID=OFF -D USE_VALGRIND=OFF -D USE_BDB=OFF -D BUILD_TESTING=OFF -D TOKUMX_DISTNAME=1.5.0 ..
mongodb 问题中提到了“--disable-warnings-as-errors”选项,但我不确定 cmake 调用是否是放置此选项的正确位置。
编辑:
编译 Mongodb 2.6.4 可以,但令人惊讶的是,只有原始源代码而不是应用了补丁的端口:
Install file: "build/freebsd/normal/mongo/mongod" as "mongod"
scons: done building targets.
[root@testbox /usr/ports/databases/mongodb/work/mongodb-src-r2.6.4]#
编辑#2:
与此同时,我取得了一些进展并修补CMakeLists.txt
并添加了以下编译器标志:-lexecinfo -lpthread
-lexecinfo 修复了 src/mongo/platform/backtrace.cpp 中缺少的 backtrace_symbols_fd 问题 -lpthread 修复了 thrd_party/ft-fix 中的 pthread 错误
现在我遇到了下一个错误:
[ 52%] Building CXX object src/mongo/client/CMakeFiles/mongocommon_client.dir/model.cpp.o
/mnt/qno/mongo/src/mongo/client/model.cpp: In member function 'virtual bool mongo::Model::load(mongo::BSONObj&)':
/mnt/qno/mongo/src/mongo/client/model.cpp:27:17: error: 'getScopedDbConnection' is not a member of 'mongo::ScopedDbConnection'
/mnt/qno/mongo/src/mongo/client/model.cpp: In member function 'virtual void mongo::Model::remove(bool)':
/mnt/qno/mongo/src/mongo/client/model.cpp:44:17: error: 'getScopedDbConnection' is not a member of 'mongo::ScopedDbConnection'
/mnt/qno/mongo/src/mongo/client/model.cpp: In member function 'virtual void mongo::Model::save(bool)':
/mnt/qno/mongo/src/mongo/client/model.cpp:59:17: error: 'getScopedDbConnection' is not a member of 'mongo::ScopedDbConnection'
我在谷歌上找不到任何相关的东西。