C++ 安装摩西翻译软件。错误消息:";ld:找不到-lboost“U线程”的库;

C++ 安装摩西翻译软件。错误消息:";ld:找不到-lboost“U线程”的库;,c++,xcode,boost,moses,C++,Xcode,Boost,Moses,我正在使用Xcode 6.1在Mac OS X 10.9.5上安装Moses翻译软件。我需要安装g++和Boost。一旦我这样做了,我将“cd”克隆到目录中,然后键入/bjam-j8。首先,我验证了我是否具备先决条件。首先是g++(我只是点击了标签,看看有什么可用): 然后推进: $ brew install boost Warning: boost-1.56.0 already installed 然后我尝试安装: $ ./bjam -j8 Tip: install tcmalloc for

我正在使用Xcode 6.1在Mac OS X 10.9.5上安装Moses翻译软件。我需要安装
g++
Boost
。一旦我这样做了,我将“cd”克隆到目录中,然后键入
/bjam-j8
。首先,我验证了我是否具备先决条件。首先是g++(我只是点击了标签,看看有什么可用):

然后推进:

$ 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
我的动力在哪里

/usr/local/Cellar/boost/1.56.0/
我尝试用上面的文件路径替换
--with boost=
参数,但也没有成功(我得到了相同的错误)


我将在Moses邮件列表上发布此消息,但我也想在这里提问,因为我遇到了相同的错误(“找不到库…叮当声:错误:链接器命令失败,退出代码为1”)使用其他软件,学习确保
clang
可以找到我的库的一般策略将对我有所帮助。

此软件包需要非标准的boost布局(或者这可能是许多系统上安装的boost的标准liayout,但它肯定不是我工作目录中boost的默认布局):

bjam--help
说:

--带boost=/path/to/boost

如果Boost位于非标准位置,请在此处指定。此目录为 应包含include和lib或lib64

当我的推进构建树处于

/home/sehe/custom/boost/boost       // headeers
/home/sehe/custom/boost/stage
/home/sehe/custom/boost/stage/lib   // libraries
我已经创建了一个“转发”目录-因此我不需要安装boost:

mkdir /tmp/boost-moses 
cd /tmp/boost-moses/
ln -sfv /home/sehe/custom/boost/stage/lib lib
ln -sfv /home/sehe/custom/boost include
现在我可以在mosesdecoder目录中使用

./bjam --with-boost=/tmp/boost-moses

这里没有说摩西版本的计算机科学家编译了哪一个版本,但他最后的评论一针见血。当我即将编译版本2.1.1时,我需要重写
Jamroot
文件和
jam文件/boost build/tools/mpi.jam
并将所有
boost\u mpi
提到的
boost\u mpi-mt
oost-1.55使用了与boost-1.56不同的库样式,Moses在该版本中适应了1.55

但是,我现在无法使用boost-1.55或boost-1.56编译Moses 3.0,因为未定义对boost::filesystem::path::stem()的引用。
不幸的是,我不能将此作为对之前答案的评论发布…

我没有注意到其中的部分,其中说“此目录应包含include和lib或lib64。”但即便如此,当我做
ls/usr/local/cillar/boost/1.56.0/
时,我看到一个
包含
lib
目录,所以我不知道为什么仅仅在
--with boost
参数中插入它是不起作用的。我不确定是否应该链接,因为我的boost只是
brew
的标准安装嗯,我想我应该去邮件列表。谢谢你的回答。6分钟后,我的构建以“成功”完成。(我不知道我一直在构建什么,但这很重要,一旦我重新启动/tmp:))你知道layout=taged和layout=system在boost方面的区别吗?我想知道这是否是我的问题。我有libboost_-thread-mt.a,但安装程序似乎在寻找libboost_-thread.a。我在发帖时使用了最新版本(2014年11月15日)。我最终还是让它工作了,但花了很长时间,我甚至不记得我做了什么。我想这更像是:从我的电脑上删除几乎所有的东西,然后重新启动=(
mkdir /tmp/boost-moses 
cd /tmp/boost-moses/
ln -sfv /home/sehe/custom/boost/stage/lib lib
ln -sfv /home/sehe/custom/boost include
./bjam --with-boost=/tmp/boost-moses