Cmake找不到boost库目录

时间:2017-02-28 14:30:39

标签: visual-studio-2010 boost cmake mlpack

我正在尝试使用英特尔编译器在Visual Studio 2010上安装mlpack,并且我关注此链接 - https://keon.io/mlpack/mlpack-on-windows/

我正在尝试运行某些CMake命令,但它失败并出现错误 -

C:\projects\mlpack-2.1.1\build> cmake -G "Visual Studio 10 2010 Win64" -T"Intel C++ compiler XE 14.0" 
-DBLAS_LIBRARY:FILEPATH="C:/projects/mlpack-.1.1/packages/OpenBLAS.0.2.14.1/lib/naive/lib/x64/libopenblas.dll.a" 
-DLAPACK_LIBRARY:FILEPATH="C:/projects/mlpack-.1.1/packages/OpenBLAS.0.2.14.1/lib/ative/lib/x64/libopenblas.dll.a" 
-DARMADILLO_INCLUDE_DIR="C:/projects/armadillo-.800.1/include" 
-DARMADILLO_LIBRARY:FILEPATH="C:/projects/armadillo-.800.1/build/Debug/armadillo.lib" 
-DBOOST_INCLUDEDIR:PATH="C:\projects\mlpack-2.1.1\packages\boost.1.63.0.0\lib\native\include" 
-DBOOST_LIBRARYDIR:PATH="C:\projects\mlpack-2.1.1\packages\boost_libs" -DDEBUG=OFF -PROFILE=OFF ..


Unable to find the requested Boost libraries.
Boost version: 1.63.0
Boost include path:
C:/projects/mlpack-2.1.1/packages/boost.1.63.0.0/lib/native/include

Could not find the following Boost libraries:

      boost_program_options
      boost_unit_test_framework
      boost_serialization

No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:279 (find_package)

但是,目录C:\projects\mlpack-2.1.1\packages\boost_libs具有所有必需的库

CMakeLists.txt在第279行

set(Boost_ADDITIONAL_VERSIONS
"1.49.0" "1.50.0" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55.0" "1.63.0")
find_package(Boost 1.49 #Line 279
  COMPONENTS
    program_options
    unit_test_framework
    serialization
  REQUIRED
)

我将第279行更改为find_package(Boost 1.49但没有用。 我也试过改变' \'到' /'反之亦然。可能是什么错误?

1 个答案:

答案 0 :(得分:0)

错误是您的CMake版本不支持Boost 1.63。

在CMake 3.7.2中引入了对Boost 1.63的支持;更新CMake,你会没事的。