CMake is not able to find BOOST libraries

后端 未结 8 1733
既然无缘
既然无缘 2020-12-07 22:00

I tried everything like:

  1. Configure environment variable
  2. Make fresh build
  3. Re-install BOOST from source
  4. sudo apt-get install libb
相关标签:
8条回答
  • 2020-12-07 22:53

    I'm using this to set up boost from cmake in my CMakeLists.txt. Try something similar (make sure to update paths to your installation of boost).

    SET (BOOST_ROOT "/opt/boost/boost_1_57_0")
    SET (BOOST_INCLUDEDIR "/opt/boost/boost-1.57.0/include")
    SET (BOOST_LIBRARYDIR "/opt/boost/boost-1.57.0/lib")
    
    SET (BOOST_MIN_VERSION "1.55.0")
    set (Boost_NO_BOOST_CMAKE ON)
    FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED)
    if (NOT Boost_FOUND)
      message(FATAL_ERROR "Fatal error: Boost (version >= 1.55) required.")
    else()
      message(STATUS "Setting up BOOST")
      message(STATUS " Includes - ${Boost_INCLUDE_DIRS}")
      message(STATUS " Library  - ${Boost_LIBRARY_DIRS}")
      include_directories(${Boost_INCLUDE_DIRS})
      link_directories(${Boost_LIBRARY_DIRS})
    endif (NOT Boost_FOUND)
    

    This will either search default paths (/usr, /usr/local) or the path provided through the cmake variables (BOOST_ROOT, BOOST_INCLUDEDIR, BOOST_LIBRARYDIR). It works for me on cmake > 2.6.

    0 讨论(0)
  • 2020-12-07 22:55

    I got the same error the first time I wanted to install LightGBM on python (GPU version).

    You can simply fix it with this command line :

    sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
    

    the boost libraries will be installed and you'll be fine to continue your installation process.

    0 讨论(0)
提交回复
热议问题