【问题标题】:boost_python3 missing from ubuntu 16.04ubuntu 16.04 中缺少 boost_python3
【发布时间】:2016-08-26 09:12:08
【问题描述】:

我正在尝试在 Ubuntu 16.04 中安装 boost.numpy。我尝试了这些命令来安装 boost.numpy

**git clone https://github.com/ndarray/Boost.NumPy.git
 cd Boost.NumPy && mkdir build && cd build
 cmake -DPYTHON_LIBRARY=$HOME/anaconda3/lib/libpython3.5m.so ../**

在做 cmake 之后我遇到了这个错误:

检测到的架构“x86_64”

-- Using Python3

    CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
      Unable to find the requested Boost libraries.

  Boost version: 1.59.0
  Boost include path: /home/sumit/Documents/Software/boost_1_59_0
  Could not find the following static Boost libraries:

          boost_python3

  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:48 (find_package)


 Boost Paths:
Include  : /home/sumit/Documents/Software/boost_1_59_0
 **Libraries**: /home/sumit/Documents/Software/boost_1_59_0/libs
Configuring incomplete, errors occurred!

另请参阅“/home/sumit/Documents/Software/Boost.NumPy/build/CMakeFiles/CMakeOutput.log”。

以前无法找到 boost 库 sp 我手动将 CmakeList.txt 库路径更改为 boost_1_59_0 库路径的路径。当我执行 cmake 时,此路径出现在库选项中。但仍然缺少 boost_python3。我是新手,我尝试过的只是谷歌的结果。 请帮忙。

【问题讨论】:

  • 您是使用开发版还是官方发布版?

标签: python git ubuntu numpy boost


【解决方案1】:

在 Ubuntu 上,用于 boost 的库名称是: libboost_pythonlibboost_python-py35libboost_python-py27

这意味着在cmake 中,您需要将它们称为python-py35 而不是python3。或者,如果您不控制CMakeLists.txt,您可以创建一个符号链接: /usr/lib/x86_64-linux-gnu/libboost_python-py35.so -> /usr/lib/x86_64-linux-gnu/libboost_python3.so

在我的 CMakeLists.txt 文件中,我有以下内容:

if(UNIX)
    set( BOOST_PYTHONLIB python-py35)
else()
    set( BOOST_PYTHONLIB python3)
endif()

find_package (Boost 1.58 REQUIRED COMPONENTS
    coroutine
    context
    filesystem
    program_options
    system
    thread
    ${BOOST_PYTHONLIB}
    chrono
    )

【讨论】:

    【解决方案2】:

    对此的简单回答是,只要指定了 boost_python3, 你用 boost_python-py35 替换它。

    我在为 python 3.5 设置 caffe 时尝试过这个。在 Makefile.config 文件中,我只进行了上述更改,对我来说效果很好。

    【讨论】:

      猜你喜欢
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 2017-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多