CMake:怎么能找到Boost并且找不到Boost?

问题描述 投票:1回答:1

我的cmake ..能够同时找到Boost并且找不到Boost。这怎么可能?如何让它为第二个<==箭头输出找到Boost?

这是我为Caffe编译的cmake ..输出(看看<==箭头):

Tams-MacBook-Pro:build tamtran$ cmake ..
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working C compiler: /Applications/Xcode833.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode833.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode833.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode833.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Boost version: 1.68.0 <<==========!!==LOOK HERE(1/2)==!!=====================
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found GFlags: /usr/local/include  
-- Found gflags  (include: /usr/local/include, library: /usr/local/lib/libgflags.dylib)
-- Found Glog: /usr/local/include  
-- Found glog    (include: /usr/local/include, library: /usr/local/lib/libglog.dylib)
-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.6.1") 
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- HDF5: Using hdf5 compiler wrapper to determine CXX configuration
-- Found HDF5: /usr/local/Cellar/hdf5/1.10.4/lib/libhdf5_cpp.dylib;/usr/local/Cellar/hdf5/1.10.4/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.10.4") found components:  HL 
-- Found LMDB: /usr/local/include  
-- Found lmdb    (include: /usr/local/include, library: /usr/local/lib/liblmdb.dylib)
-- Found LevelDB: /usr/local/include  
-- Found LevelDB (include: /usr/local/include, library: /usr/local/lib/libleveldb.dylib)
-- Found Snappy: /usr/local/include  
-- Found Snappy  (include: /usr/local/include, library: /usr/local/lib/libsnappy.dylib)
-- -- CUDA is disabled. Building without it...
-- OpenCV found (/usr/local/share/OpenCV)
-- Found vecLib: /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers  
-- Found vecLib as part of Accelerate.framework
-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.15", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.10", minimum required is "2.7") 
-- Found NumPy: /usr/local/lib/python2.7/site-packages/numpy/core/include (found suitable version "1.15.4", minimum required is "1.7.1") 
-- NumPy ver. 1.15.4 found (include: /usr/local/lib/python2.7/site-packages/numpy/core/include)
-- Could NOT find Boost <<==========!!==LOOK HERE(2/2)==!!===================
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Python interface is disabled or not all required dependencies found. Building without it...
-- Found Git: /usr/local/bin/git (found version "2.10.1") 
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   1.0-132-g99bd997-dirty
--   System            :   Darwin
--   C++ compiler      :   /Applications/Xcode833.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -std=c++11 -fPIC -Wall
--   Debug CXX flags   :   -g -std=c++11 -fPIC -Wall
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   ON
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   OFF
--   ALLOW_LMDB_NOLOCK :   OFF
--   USE_HDF5          :   ON
-- 
-- Dependencies:
--   BLAS              :   Yes (vecLib)
--   Boost             :   Yes (ver. 1.68)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.6.1)
--   lmdb              :   Yes (ver. 0.9.22)
--   LevelDB           :   Yes (ver. 1.20)
--   Snappy            :   Yes (ver. 1.1.7)
--   OpenCV            :   Yes (ver. 3.2.0)
--   CUDA              :   No
-- 
-- Documentaion:
--   Doxygen           :   No
--   config_file       :   
-- 
-- Install:
--   Install path      :   /Users/tamtran/InstalledStuff/caffe/build/install
-- 
-- Configuring done
CMake Error at CMakeLists.txt:107 (add_dependencies):
  The dependency target "pycaffe" of target "pytest" does not exist.


-- Generating done
-- Build files have been written to: /Users/tamtran/InstalledStuff/caffe/build

额外的问题:为什么python没有被列为Boost库的一部分,尽管我也安装了boost-python? boost和boost-python都是通过brew安装的。

c++ boost cmake caffe
1个回答
2
投票

如果你查看Caffe's CMake scripts,你会发现第二个Boost日志是在搜索Boost-Python时产生的,你可能会错过它。

编辑:至于为什么可能找不到Boost-Python:一种可能性是你为python3而不是python2.7安装了Boost-Python。

© www.soinside.com 2019 - 2024. All rights reserved.