moses-smt / mosesdecoder

Moses, the machine translation system
http://www.statmt.org/moses
GNU Lesser General Public License v2.1
1.58k stars 775 forks source link

Build failure on fedora 20 #89

Closed ozancaglayan closed 9 years ago

ozancaglayan commented 9 years ago

Hi,

There are some linking issues with system boost on Fedora Linux 20. Adding:

<library>boost_filesystem

to Jamroot fixes the issue.

hieuhoang commented 9 years ago

Hiya

Thanks for letting us know. Can you please tell me the exact command you used to compile. If possible, can you please send me the Jamroot file with the change. I'll check it in

Sent while bumping into things On 15 Dec 2014 20:32, "Ozan Çağlayan" notifications@github.com wrote:

Hi,

There are some linking issues with system boost on Fedora Linux 20. Adding:

boost_filesystem to Jamroot fixes the issue. — Reply to this email directly or view it on GitHub https://github.com/moses-smt/mosesdecoder/issues/89.
ozancaglayan commented 9 years ago

The command used to compile:

./bjam -j8 link=shared debug-symbols=off

Example from the link errors:

gcc.compile.c++ moses/LM/bin/BackwardTest.test/gcc-4.8.3/release/threading-multi/SingleFactor.o
gcc.link mira/bin/gcc-4.8.3/release/threading-multi/mira
gcc.compile.c++ moses/LM/bin/BackwardTest.test/gcc-4.8.3/release/threading-multi/SkeletonLM.o
gcc.link /home/ocaglayan/PhD/mosesdecoder/bin/mira
gcc.compile.c++ moses/bin/gcc-4.8.3/release/threading-multi/FF/SparseHieroReorderingFeatureTest.o
gcc.compile.c++ moses/bin/gcc-4.8.3/release/threading-multi/FeatureVectorTest.o
gcc.compile.c++ moses/bin/gcc-4.8.3/release/threading-multi/ScoreComponentCollectionTest.o
gcc.compile.c++ mert/bin/gcc-4.8.3/release/threading-multi/FeatureDataTest.o
gcc.link mert/bin/gcc-4.8.3/release/threading-multi/feature_data_test
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::path::stem() const'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::detail::dir_itr_close(void*&, void*&)'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::path::filename() const'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*)'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::path::compare(boost::filesystem::path const&) const'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)'
mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status

    "g++"  -Wl,-R -Wl,"/home/ocaglayan/PhD/mosesdecoder/mert/bin/gcc-4.8.3/release/threading-multi" -Wl,-rpath-link -Wl,"/home/ocaglayan/PhD/mosesdecoder/mert/bin/gcc-4.8.3/release/threading-multi" -o "mert/bin/gcc-4.8.3/release/threading-multi/feature_data_test" -Wl,--start-group "mert/bin/gcc-4.8.3/release/threading-multi/FeatureDataTest.o" "mert/bin/gcc-4.8.3/release/threading-multi/libmert_lib.so"  -Wl,-Bstatic  -Wl,-Bdynamic -lboost_unit_test_framework -ltcmalloc_minimal -ldl -lboost_system -lSegFault -lboost_thread -lrt -Wl,--end-group -pthread

Diff file after changing the Jamroot file:

diff --git a/Jamroot b/Jamroot
index 4514ecb..a7efd84 100644
--- a/Jamroot
+++ b/Jamroot
@@ -166,6 +166,7 @@ requirements += <os>MACOSX:<library>iconv ;
 project : requirements 
   <threading>multi:<define>WITH_THREADS
   <threading>multi:<library>boost_thread
+  <threading>multi:<library>boost_filesystem
   <library>boost_system
   <define>_FILE_OFFSET_BITS=64 <define>_LARGE_FILES
   $(requirements)
hieuhoang commented 9 years ago

I built boost (v1.57) myself and linked moses to it. It works ok ./bjam --with-boost=/home/hieu/workspace/boost_1_57_0 --with-irstlm=/home/hieu/workspace/irstlm-5.80.06/trunk --with-cmph=/home/hieu/workspace/cmph-2.0 -j2 I always recommend building boost yourself as some versions are buggy and the linux distros don't always keep up with the updates. Also, moses (and all other programs that need boost) are sensitive exactly how the library files are named so you need to control it yourself

The instructions to build boost to work with moses is here http://www.statmt.org/moses/?n=Development.GetStarted