OpenNMT / CTranslate

Lightweight C++ translator for OpenNMT Torch models (deprecated)
https://opennmt.net/
MIT License
79 stars 50 forks source link

Clang compilation fails #39

Closed jhnwnd closed 6 years ago

jhnwnd commented 6 years ago

Using clang compiler on Linux, get these errors: /usr/bin/ld: CMakeFiles/translate.dir/translate.cc.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line clang: error: linker command failed with exit code 1 (use -v to see invocation) cli/CMakeFiles/translate.dir/build.make:150: recipe for target 'cli/translate' failed make[2]: [cli/translate] Error 1 CMakeFiles/Makefile2:391: recipe for target 'cli/CMakeFiles/translate.dir/all' failed make[1]: [cli/CMakeFiles/translate.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Can resolve this by adding this line to the root CMakeLists.txt: set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")

guillaumekln commented 6 years ago

Fixed by 9101a1fa.