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++" -L"lib" -L"lib64" -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' util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o: In function `boost::mutex::lock()': include/boost/thread/pthread/mutex.hpp:52: undefined reference to `pthread_mutex_lock' util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o: In function `boost::mutex::unlock()': include/boost/thread/pthread/mutex.hpp:61: undefined reference to `pthread_mutex_unlock' util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o: In function `semaphore_post': include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:134: undefined reference to `sem_post' 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 `boost::mutex::lock()': include/boost/thread/pthread/mutex.hpp:52: undefined reference to `pthread_mutex_lock' util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o: In function `boost::mutex::unlock()': include/boost/thread/pthread/mutex.hpp:61: undefined reference to `pthread_mutex_unlock' util/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static/pcqueue_test.o: In function `semaphore_post': include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:134: undefined reference to `sem_post' 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 `~mutex': include/boost/smart_ptr/scoped_array.hpp:68: 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' include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:126: undefined reference to `sem_destroy' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned long)': (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0x98): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned long)': (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0xd5): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned long)': (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0x8e): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)': (.text._ZNSt6locale6globalERKS_+0x93): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)': (.text._ZNSt6locale6globalERKS_+0xd9): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)': (.text._ZNSt6locale6globalERKS_+0x125): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::locale()': (.text._ZNSt6localeC1Ev+0x7e): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::locale()': (.text._ZNSt6localeC1Ev+0x74): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::locale()': (.text._ZNSt6localeC2Ev+0x7e): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(locale_init.o): In function `std::locale::locale()': (.text._ZNSt6localeC2Ev+0x74): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(guard.o): In function `(anonymous namespace)::static_mutex::lock()': (.text._ZN72_GLOBAL__N_.._.._.._.._libstdc___v3_libsupc___guard.cc_00000000_7CD8311B12static_mutex4lockEv+0x18): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(guard.o): In function `(anonymous namespace)::static_mutex::unlock()': (.text._ZN72_GLOBAL__N_.._.._.._.._libstdc___v3_libsupc___guard.cc_00000000_7CD8311B12static_mutex6unlockEv+0x18): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception': (.text.__cxa_allocate_exception+0xb6): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception': (.text.__cxa_allocate_exception+0xc7): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception': (.text.__cxa_free_exception+0x58): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception': (.text.__cxa_free_exception+0x78): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases': (.text+0x10bc): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases': (.text+0x10cd): undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases': (.text+0x117f): undefined reference to `pthread_mutex_lock' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases': (.text+0x1257): undefined reference to `pthread_mutex_unlock' collect2: ld returned 1 exit status ...skipped <putil/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static>pcqueue_test.passed for lack of <putil/bin/gcc-4.1.2/release/debug-symbols-on/link-static/runtime-link-static>pcqueue_test... ...failed updating 1 target...
_______________________________________________ Moses-support mailing list Moses-support@mit.edu http://mailman.mit.edu/mailman/listinfo/moses-support