2016-11-13 31 views
0

我使用的是Mac OS与10.11.6编译器似乎无法找到升压/ shared_ptr.hpp

我想在我的Mac上安装OpenGV。这是构建OpenSfM库所需的依赖关系的一部分。所以,我所做的是:

brew install homebrew/science/ceres-solver 
brew install boost-python 
brew install eigen 
git clone https://github.com/paulinus/opengv.git 
cd opengv 
mkdir build 
cd build 
cmake .. -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON 
make install 

但我得到这个错误:

In file included from /Users/hilman_dayo/opengv/src/relative_pose/modules/main.cpp:47: 
/Users/hilman_dayo/opengv/include/opengv/math/Sturm.hpp:43:10: fatal error: 'boost/shared_ptr.hpp' file not found 
#include <boost/shared_ptr.hpp> 
     ^
1 error generated. 
make[2]: *** [CMakeFiles/opengv.dir/src/relative_pose/modules/main.o] Error 1 
make[1]: *** [CMakeFiles/opengv.dir/all] Error 2 
make: *** [all] Error 2 

我该如何解决这个问题?已经检查,并且该文件在/usr/local/include/boost/shared_ptr.hpp

如果没有需要,这是在cmake输出:

-- The C compiler identification is AppleClang 7.3.0.7030031 
-- The CXX compiler identification is AppleClang 7.3.0.7030031 
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 
-- Check for working C compiler: /Applications/Xcode.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/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ 
-- Check for working CXX compiler: /Applications/Xcode.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 
-- Checking for C++11 compiler 
-- Checking for C++11 compiler - available 
-- Performing Test SUPPORTS_STD_CXX11 
-- Performing Test SUPPORTS_STD_CXX11 - Success 
-- Performing Test SUPPORTS_STD_CXX01 
-- Performing Test SUPPORTS_STD_CXX01 - Success 
-- Found Eigen: /usr/local/include/eigen3 (Required is at least version "2.91.0") 
CMake Warning at /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:743 (message): 
    Imported targets not available for Boost version 106200 
Call Stack (most recent call first): 
    /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:842 (_Boost_COMPONENT_DEPENDENCIES) 
    /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:1395 (_Boost_MISSING_DEPENDENCIES) 
    python/CMakeLists.txt:2 (find_package) 


-- Boost version: 1.62.0 
-- Found the following Boost libraries: 
-- python 
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10") 
-- Found PythonInterp: /Users/hilman_dayo/.virtualenvs/cv/bin/python2.7 (found version "2.7.12") 
-- Found NumPy: version "1.11.1" /Users/hilman_dayo/.virtualenvs/cv/lib/python2.7/site-packages/numpy/core/include 
-- Configuring done 
CMake Warning (dev): 
    Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake 
    --help-policy CMP0042" for policy details. Use the cmake_policy command to 
    set the policy and suppress this warning. 

    MACOSX_RPATH is not specified for the following targets: 

    pyopengv 

This warning is for project developers. Use -Wno-dev to suppress it. 

-- Generating done 
-- Build files have been written to: /Users/hilman_dayo/opengv/build 
+1

标题是错误的:要么CMake的没有找到提升(这似乎找到)或编译器不找到标题。当您使用'make install VERBOSE = 1'时,您可以获得实际的编译器调用,这有助于查明问题。 – usr1234567

+0

谢谢。问题现在已经解决了。 – Hilman

回答

1

确定。评论@ usr1234567给我一个提示找到答案。快速搜索后,我需要做的仅仅是执行此命令行:

xcode-select --install