kpu / kenlm

KenLM: Faster and Smaller Language Model Queries
http://kheafield.com/code/kenlm/
Other
2.51k stars 511 forks source link

make error in Ubuntu 16.04 #327

Open zhaoyang9425 opened 3 years ago

zhaoyang9425 commented 3 years ago

I followed the following commands to install

git clone https://github.com/kpu/kenlm.git cd kenlm mkdir -p build && cd build cmake .. make -j 4

When I execute the last command make -j 4, the error occurred.

Scanning dependencies of target kenlm_util [ 1%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/bignum.cc.o [ 3%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/bignum-dtoa.cc.o [ 3%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/cached-powers.cc.o [ 5%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/diy-fp.cc.o [ 6%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/double-conversion.cc.o [ 7%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/fast-dtoa.cc.o [ 8%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/fixed-dtoa.cc.o [ 10%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/strtod.cc.o [ 11%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/chain.cc.o [ 12%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/count_records.cc.o [ 13%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/io.cc.o [ 15%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/line_input.cc.o [ 16%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/multi_progress.cc.o [ 17%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/rewindable_stream.cc.o [ 18%] Building CXX object util/CMakeFiles/kenlm_util.dir/bit_packing.cc.o [ 20%] Building CXX object util/CMakeFiles/kenlm_util.dir/ersatz_progress.cc.o [ 21%] Building CXX object util/CMakeFiles/kenlm_util.dir/exception.cc.o [ 22%] Building CXX object util/CMakeFiles/kenlm_util.dir/file.cc.o [ 23%] Building CXX object util/CMakeFiles/kenlm_util.dir/file_piece.cc.o [ 25%] Building CXX object util/CMakeFiles/kenlm_util.dir/float_to_string.cc.o [ 26%] Building CXX object util/CMakeFiles/kenlm_util.dir/integer_to_string.cc.o [ 27%] Building CXX object util/CMakeFiles/kenlm_util.dir/mmap.cc.o [ 28%] Building CXX object util/CMakeFiles/kenlm_util.dir/murmur_hash.cc.o [ 30%] Building CXX object util/CMakeFiles/kenlm_util.dir/parallel_read.cc.o [ 31%] Building CXX object util/CMakeFiles/kenlm_util.dir/pool.cc.o [ 32%] Building CXX object util/CMakeFiles/kenlm_util.dir/read_compressed.cc.o [ 33%] Building CXX object util/CMakeFiles/kenlm_util.dir/scoped.cc.o [ 35%] Building CXX object util/CMakeFiles/kenlm_util.dir/spaces.cc.o [ 36%] Building CXX object util/CMakeFiles/kenlm_util.dir/string_piece.cc.o [ 37%] Building CXX object util/CMakeFiles/kenlm_util.dir/usage.cc.o [ 38%] Linking CXX static library ../lib/libkenlm_util.a [ 38%] Built target kenlm_util Scanning dependencies of target probing_hash_table_benchmark Scanning dependencies of target kenlm_filter Scanning dependencies of target kenlm [ 40%] Building CXX object util/CMakeFiles/probing_hash_table_benchmark.dir/probing_hash_table_benchmark_main.cc.o [ 42%] Building CXX object lm/filter/CMakeFiles/kenlm_filter.dir/phrase.cc.o [ 42%] Building CXX object lm/filter/CMakeFiles/kenlm_filter.dir/arpa_io.cc.o [ 43%] Building CXX object lm/CMakeFiles/kenlm.dir/bhiksha.cc.o [ 45%] Building CXX object lm/CMakeFiles/kenlm.dir/binary_format.cc.o [ 46%] Building CXX object lm/filter/CMakeFiles/kenlm_filter.dir/vocab.cc.o [ 47%] Building CXX object lm/CMakeFiles/kenlm.dir/config.cc.o [ 48%] Building CXX object lm/CMakeFiles/kenlm.dir/lm_exception.cc.o [ 50%] Building CXX object lm/CMakeFiles/kenlm.dir/model.cc.o [ 51%] Building CXX object lm/CMakeFiles/kenlm.dir/quantize.cc.o [ 52%] Linking CXX static library ../../lib/libkenlm_filter.a [ 52%] Built target kenlm_filter [ 53%] Building CXX object lm/CMakeFiles/kenlm.dir/read_arpa.cc.o [ 55%] Building CXX object lm/CMakeFiles/kenlm.dir/search_hashed.cc.o [ 56%] Building CXX object lm/CMakeFiles/kenlm.dir/search_trie.cc.o [ 57%] Building CXX object lm/CMakeFiles/kenlm.dir/sizes.cc.o [ 58%] Building CXX object lm/CMakeFiles/kenlm.dir/trie.cc.o [ 60%] Building CXX object lm/CMakeFiles/kenlm.dir/trie_sort.cc.o [ 61%] Building CXX object lm/CMakeFiles/kenlm.dir/value_build.cc.o [ 62%] Linking CXX executable ../bin/probing_hash_table_benchmark CMakeFiles/probing_hash_table_benchmark.dir/probing_hash_table_benchmark_main.cc.o: In function boost::thread_exception::thread_exception(int, char const*)': probing_hash_table_benchmark_main.cc:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x24): undefined reference toboost::system::generic_category()' CMakeFiles/probing_hash_table_benchmark.dir/probing_hash_table_benchmark_main.cc.o: In function _GLOBAL__sub_I_main': probing_hash_table_benchmark_main.cc:(.text.startup+0x35): undefined reference toboost::system::generic_category()' probing_hash_table_benchmark_main.cc:(.text.startup+0x3a): undefined reference to boost::system::generic_category()' probing_hash_table_benchmark_main.cc:(.text.startup+0x3f): undefined reference toboost::system::system_category()' collect2: error: ld returned 1 exit status util/CMakeFiles/probing_hash_table_benchmark.dir/build.make:91: recipe for target 'bin/probing_hash_table_benchmark' failed make[2]: [bin/probing_hash_table_benchmark] Error 1 CMakeFiles/Makefile2:130: recipe for target 'util/CMakeFiles/probing_hash_table_benchmark.dir/all' failed make[1]: [util/CMakeFiles/probing_hash_table_benchmark.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 63%] Building CXX object lm/CMakeFiles/kenlm.dir/virtual_interface.cc.o [ 65%] Building CXX object lm/CMakeFiles/kenlm.dir/vocab.cc.o [ 66%] Building CXX object lm/CMakeFiles/kenlm.dir/common/model_buffer.cc.o [ 67%] Building CXX object lm/CMakeFiles/kenlm.dir/common/print.cc.o [ 68%] Building CXX object lm/CMakeFiles/kenlm.dir/common/renumber.cc.o [ 70%] Building CXX object lm/CMakeFiles/kenlm.dir/common/size_option.cc.o [ 71%] Linking CXX static library ../lib/libkenlm.a [ 71%] Built target kenlm Makefile:129: recipe for target 'all' failed make: [all] Error 2

cmake version 3.15.0 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) boost version libboost1.58-dev:amd64: /usr/include/boost/version.hpp

Looking forward to your answer!

apasad-asapp commented 3 years ago

I am facing the same issue.

cmake version 3.20.5 gcc version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~18.04) boost version 1.73.0

Any help is appreciated!


Update: Adding these lines to CMakeLists.txt resolves the error for me!


if (Boost_NO_SYSTEM_PATHS)
  set(Boost_INCLUDE_DIR "/usr/include")
endif (Boost_NO_SYSTEM_PATHS)```