【问题标题】:cmake boost trouble and intern can't install dlibcmake boost 麻烦和实习生无法安装 dlib
【发布时间】:2016-11-21 09:16:26
【问题描述】:

不知何故,当使用 boost 安装 python3.5 时,cmake 找不到它。 我正在尝试安装 lib,但当我安装时出现此错误。我已经安装了 boost - python。

CMake Warning at 
/usr/local/Cellar/cmake/3.6.0_1/share/cmake/Modules/FindBoost.cmake:1459 (message):
  No header defined for python-py34; skipping header check
Call Stack (most recent call first):
  /Users/pascaljardin/Desktop/dlib-19.0/dlib/add_python_module:60 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
-- Could NOT find Boost
-- Could NOT find Boost
-- Found PythonLibs: /usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib (found suitable version "3.5.2", minimum required is "3.4")

--  *****************************************************************************************************
--  To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder
--  and run these commands:
--     ./bootstrap.sh --with-libraries=python
--     ./b2
--     sudo ./b2 install
--  *****************************************************************************************************
CMake Error at /Users/pascaljardin/Desktop/dlib-19.0/dlib/add_python_module:108 (message):
   Boost python library not found.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)
-- Configuring incomplete, errors occurred!
See also "/Users/pascaljardin/Desktop/dlib-19.0/tools/python/build/CMakeFiles/CMakeOutput.log".
error: cmake configuration failed!

从头开始。这就是我在 macbook air os x el Captain 版本 10.11.5 上安装所有内容的方式

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew install python3
$ brew install boost --with-python3
$ brew install cmake

那么,当我安装所有东西时,是否有什么地方做得不对?我真的不知道为什么会这样,我真的很想使用

安装 dlib
python3 setup.py install

在 lib 文件夹中。

或者有没有更简单的方法用 python3 安装 dlib?

【问题讨论】:

标签: cmake python-3.5 boost-python dlib


【解决方案1】:

你忽略了安装 boost::python。

brew install boost-python --with-python3

前段时间,Homebrew 把它们分成了两个包。

【讨论】:

  • 当我安装 python3 setup.py install [100%] Linking CXX shared library dlib.so undefined symbols for architecture x86_64: "boost::python::detail::init_module(PyModuleDef&, void () ())”,引用自:PyInit_dlib in dlib.cpp.o ld:未找到架构 x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)make[ 2]: ** [dlib.so] 错误 1 ​​make[1]: *** [CMakeFiles/dlib.dir/all] 错误 2 make: *** [all] 错误 2 错误: cmake build failed !
  • 这可能是由于尝试在您的项目中使用 2 个不同的 python 安装。如果您安装了另一个 python(例如通过 Homebrew),您需要确保您的项目和 boost::python 使用相同的 python。
猜你喜欢
  • 2016-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-07
  • 1970-01-01
  • 2014-08-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多