Dear Moses supports,
I am running into an error when compiling Moses (
https://github.com/moses-smt/mosesdecoder/commit/23556697c4e6831bfd0574351717f5a7b79dff77)
with the options threading=single and --static. (x86_64-redhat-linux)
The command I used is:
./bjam threading=single --static --prefix=$MOSES_INSTALLDIR
--install-scripts=$MOSES_SCRIPTS --with-srilm=$SRILM
--with-irstlm=$IRSTLMDIR --with-boost=$BOOSTDIR --with-xmlrpc-c=$XMLRPCDIR
--with-cmph=$CMPHDIR --with-giza=$MOSES_INSTALLDIR/bin --max-kenlm-order=5
--with-tcmalloc --without-libsegfault -j8 -a -q
It was a linking error with pcqueue_test. The partial error message is
attached. If I remove threading=single, the compilation finishes without
problems. It seems -lpthread could help with this step, but I don't know
how to add such an option to the bjam command. (Adding
linkflags=-lpthread alone seems to cause the compilation to freeze.) It
would be great if someone could tell me how to deal with it.
Thank you very much for the help in advance!
Best regards,
Yun
gcc.link
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test
g++ -Llib -Llib64 -Wl,-R -Wl,lib -Wl,-R -Wl,lib64 -Wl,-rpath-link
-Wl,lib -Wl,-rpath-link -Wl,lib64 -o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test
-Wl,--start-group
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/read_compressed.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/bignum-dtoa.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/bignum.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/cached-powers.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/diy-fp.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/double-conversion.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/fast-dtoa.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/fixed-dtoa.o
util/double-conversion/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/strtod.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/bit_packing.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/ersatz_progress.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/exception.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/file.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/file_piece.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/mmap.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/murmur_hash.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pool.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/scoped.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/string_piece.o
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/usage.o
-lboost_system -lboost_unit_test_framework -lbz2 -lz -lrt -ldl
-lboost_system -Wl,--end-group -g -static
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `semaphore_init':
include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:115: undefined
reference to `sem_init'
include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:115: undefined
reference to `sem_init'
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `mutex':
include/boost/thread/pthread/mutex.hpp:39: undefined reference to
`pthread_mutex_init'
include/boost/thread/pthread/mutex.hpp:39: undefined reference to
`pthread_mutex_init'
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `semaphore_wait':
include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:142: undefined
reference to `sem_wait'
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `~mutex':
include/boost/thread/pthread/mutex.hpp:47: undefined reference to
`pthread_mutex_destroy'
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `semaphore_destroy':
include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:126: undefined
reference to `sem_destroy'
util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o:
In function `semaphore_destroy':
util/pcqueue_test.cc:16: undefined reference to `sem_destroy'