kpu / kenlm

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

boost/system/system_error.hpp: No such file or directory #350

Open leonce-m opened 3 years ago

leonce-m commented 3 years ago

I followed the installation instructions for ubuntu (20.04).

sudo apt-get install build-essential libboost-all-dev cmake zlib1g-dev libbz2-dev liblzma-dev 

All the dependencies seem up to date.

cmake is already the newest version (3.16.3-1ubuntu1).
libbz2-dev is already the newest version (1.0.8-2).
libboost-all-dev is already the newest version (1.71.0.0ubuntu2).
build-essential is already the newest version (12.8ubuntu1.1).
liblzma-dev is already the newest version (5.2.4-1ubuntu1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Yet I get this error during the build

Scanning dependencies of target kenlm_util
[  2%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/bignum-dtoa.cc.o
[  2%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/cached-powers.cc.o
[  3%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/bignum.cc.o
[  4%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/diy-fp.cc.o
[  5%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/double-conversion.cc.o
[  6%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/fast-dtoa.cc.o
[  7%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/fixed-dtoa.cc.o
[  8%] Building CXX object util/CMakeFiles/kenlm_util.dir/double-conversion/strtod.cc.o
[  9%] Building CXX object util/CMakeFiles/kenlm_util.dir/stream/chain.cc.o
In file included from /usr/include/boost/thread/pthread/mutex.hpp:14,
                 from /usr/include/boost/thread/mutex.hpp:16,
                 from /home/leonce/kenlm/util/stream/multi_progress.hh:5,
                 from /home/leonce/kenlm/util/stream/chain.hh:6,
                 from /home/leonce/kenlm/util/stream/chain.cc:1:
/usr/include/boost/thread/exceptions.hpp:22:10: fatal error: boost/system/system_error.hpp: No such file or directory
   22 | #include <boost/system/system_error.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [util/CMakeFiles/kenlm_util.dir/build.make:167: util/CMakeFiles/kenlm_util.dir/stream/chain.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:288: util/CMakeFiles/kenlm_util.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
kpu commented 3 years ago

That looks like a pretty broken boost to me. A boost-internal header boost/thread/exceptions.hpp is including another file boost/system/system_error.hpp and not finding it. Are you sure you have only one version of boost installed and no funny business with home directories?

leonce-m commented 3 years ago

Maybe (re-)installing ros-noetic is the culprit? That's the only thing I think I did that would mess with it. locate 'boost/version.hpp' yields just one result /usr/include/boost/version.hpp with BOOST_LIB_VERSION "1_71"

leonce-m commented 3 years ago

Could it be that libboost_system isn't being linked?

leonce-m commented 3 years ago

this is the output of cmake with set(Boost_DEBUG 1)

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0
--   Requested configuration: QUIET REQUIRED COMPONENTS program_options;system;thread;unit_test_framework
-- BoostConfig: find_package(boost_headers 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)
-- Found boost_headers 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_headers-1.71.0
-- BoostConfig: find_package(boost_program_options 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)
-- Found boost_program_options 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_program_options-1.71.0
-- Boost toolset is gcc9 (GNU 9.3.0)
-- Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_program_options-1.71.0/libboost_program_options-variant*.cmake
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_program_options-1.71.0/libboost_program_options-variant-shared.cmake
--   [x] libboost_program_options.so.1.71.0
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_program_options-1.71.0/libboost_program_options-variant-static.cmake
--   [ ] libboost_program_options.a
-- Adding boost_program_options dependencies: headers
-- BoostConfig: find_package(boost_system 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)
-- Found boost_system 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_system-1.71.0
-- Boost toolset is gcc9 (GNU 9.3.0)
-- Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_system-1.71.0/libboost_system-variant*.cmake
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_system-1.71.0/libboost_system-variant-shared.cmake
--   [x] libboost_system.so.1.71.0
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_system-1.71.0/libboost_system-variant-static.cmake
--   [ ] libboost_system.a
-- Adding boost_system dependencies: headers
-- BoostConfig: find_package(boost_thread 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)
-- Found boost_thread 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_thread-1.71.0
-- Boost toolset is gcc9 (GNU 9.3.0)
-- Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_thread-1.71.0/libboost_thread-variant*.cmake
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_thread-1.71.0/libboost_thread-variant-shared.cmake
--   [x] libboost_thread.so.1.71.0
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_thread-1.71.0/libboost_thread-variant-static.cmake
--   [ ] libboost_thread.a
-- Adding boost_thread dependencies: atomic;headers
-- Found boost_atomic 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_atomic-1.71.0
-- Boost toolset is gcc9 (GNU 9.3.0)
-- Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_atomic-1.71.0/libboost_atomic-variant*.cmake
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_atomic-1.71.0/libboost_atomic-variant-shared.cmake
--   [x] libboost_atomic.so.1.71.0
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_atomic-1.71.0/libboost_atomic-variant-static.cmake
--   [ ] libboost_atomic.a
-- Adding boost_atomic dependencies: headers
-- BoostConfig: find_package(boost_unit_test_framework 1.71.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)
-- Found boost_unit_test_framework 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_unit_test_framework-1.71.0
-- Boost toolset is gcc9 (GNU 9.3.0)
-- Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_unit_test_framework-1.71.0/libboost_unit_test_framework-variant*.cmake
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_unit_test_framework-1.71.0/libboost_unit_test_framework-variant-shared.cmake
--   [x] libboost_unit_test_framework.so.1.71.0
--   Including /usr/lib/x86_64-linux-gnu/cmake/boost_unit_test_framework-1.71.0/libboost_unit_test_framework-variant-static.cmake
--   [ ] libboost_unit_test_framework.a
-- Adding boost_unit_test_framework dependencies: headers
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.41.0") found components: program_options system thread unit_test_framework 
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Found LibLZMA: /usr/lib/x86_64-linux-gnu/liblzma.so (found version "5.2.4") 
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/leonce/kenlm/build