Ami*_*Pal 48 c++ bash boost cmake
我尝试了一切:
sudo apt-get install libboost-all-dev但仍然得到以下错误:
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:147 (find_package)
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Run Code Online (Sandbox Code Playgroud)
boost的源代码目录:/usr/local/src/boost_1_45_0
Boost Library path:/usr/local/lib
Boost Header文件:/usr/local/include/boost
这是bashrc file:
BOOST_ROOT="/usr/local/src/boost_1_45_0"
Boost_LIBRARY_DIRS="/usr/local/lib"
BOOST_INCLUDEDIR="/usr/local/src/boost_1_45_0"
Run Code Online (Sandbox Code Playgroud)
如何解决这些错误?我错过了什么吗?
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN -DBOOST_ROOT=/usr/local/src/boost_1_45_0 -DBOOST_INCLUDEDIR=/usr/local/include/boost -DBOOST_LIBRARYDIR=/usr/local/lib -DPYTHON_LIBRARIES=/usr/local/lib/python2.7 -DPYTHON_INCLUDE_DIRS=/usr/include/python2.7 -DCMA-DRDK_BUILD_PYTHON_WRAPPERS=
Run Code Online (Sandbox Code Playgroud)
Ale*_*sky 40
尝试使用以下libs完成cmake进程:
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
Run Code Online (Sandbox Code Playgroud)
Cs2*_*s20 10
我第一次想在 python(GPU 版本)上安装 LightGBM 时遇到了同样的错误。
您可以使用以下命令行简单地修复它:
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
Run Code Online (Sandbox Code Playgroud)
将安装 boost 库,您可以继续安装过程。
我正在使用它来设置我的cmake中的提升CMakeLists.txt.尝试类似的东西(确保更新你的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)
Run Code Online (Sandbox Code Playgroud)
这既会搜索默认路径(/usr,/usr/local)或通过cmake的变量(提供的路径BOOST_ROOT,BOOST_INCLUDEDIR,BOOST_LIBRARYDIR).它适用于cmake> 2.6.