我正在使用 Xcode 6.1 在我的 Mac OS X 10.9.5 上安装 Moses 翻译软件。说明说我需要g++
并Boost
安装。一旦我这样做了,我 git clone, "cd" 进入目录,然后输入./bjam -j8
. 首先,我确认我有先决条件。首先,g++(我只是单击了 TAB 来查看可用的内容):
$ g++
g++ g++-4.9
然后提升:
$ brew install boost
Warning: boost-1.56.0 already installed
然后我尝试安装:
$ ./bjam -j8
Tip: install tcmalloc for faster threading. See BUILD-INSTRUCTIONS.txt for more information.
mkdir: bin: File exists
...patience...
...patience...
...found 4469 targets...
...updating 155 targets...
darwin.link lm/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/query
ld: library not found for -lboost_thread
clang: error: linker command failed with exit code 1 (use -v to see invocation)
// Additional error messages...
...failed darwin.link mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/util_test...
...skipped <pmert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi>util_test.passed for lack of <pmert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi>util_test...
darwin.link mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/vocabulary_test
ld: library not found for -lboost_thread
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"g++" -o "mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/vocabulary_test" "mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/VocabularyTest.o" "mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/libmert_lib.a" -lboost_unit_test_framework -llzma -lbz2 -ldl -lboost_system -lz -lboost_thread -lm -liconv -g -Wl,-dead_strip -no_dead_strip_inits_and_terms
...failed darwin.link mert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/vocabulary_test...
...skipped <pmert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi>vocabulary_test.passed for lack of <pmert/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi>vocabulary_test...
...failed updating 72 targets...
...skipped 83 targets...
The build failed. If you need support, run:
./jam-files/bjam -j8 --debug-configuration -d2 |gzip >build.log.gz
then attach build.log.gz to your e-mail.
You MUST do 3 things before sending to the mailing list:
1. Subscribe to the mailing list at http://mailman.mit.edu/mailman/listinfo/moses-support
2. Attach build.log.gz to your e-mail
3. Say what is the EXACT command you executed when you got the error
ERROR
有大量错误消息未显示(浓缩为“// 附加错误消息”),它们都是“ld: library not found for -lboost_thread”的形式。所以很明显有些东西找不到与boost相关的库,但我不知道如何解决这个问题。有人有建议吗?我实际上只是从安装说明中复制了几行,Moses 很受欢迎,以至于安装说明中的明显错误早就被发现了。
附加评论:在安装说明页面上,他们列出了一个命令,可以强制安装程序找到 boost 库:
./bjam --with-boost=~/workspace/temp/boost_1_55_0 -j8
我的动力在
/usr/local/Cellar/boost/1.56.0/
我尝试--with-boost=
用上面的文件路径替换参数,但这也不起作用(我得到了同样的错误)。
我将在 Moses 邮件列表上发布此内容,但我也想在这里问一下,因为我遇到了同样的错误(“找不到库 ... clang:错误:链接器命令失败,退出代码为 1”)其他软件,这将有助于我学习确保clang
可以找到我的库的一般策略。