2016-08-26 147 views
1

我想在Ubuntu 16.04中安装boost.numpy。我想这些commnads安装boost.numpy从Ubuntu的缺少boost_python3 16.04

**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 /文档/Software/Boost.NumPy/build/CMakeFiles/CMakeOutput.log”。

以前它无法找到boost库sp我manualy用boost_1_59_0 lib路径的路径更改CmakeList.txt库路径。当我做cmake时,这个路径出现在库选项中。但仍然缺少boost_python3。我是新来的,我试过的只是google的结果。 请帮忙。

+0

你想使用的开发版本或正式发布版本? –

回答

1

在Ubuntu库名称为升压是: libboost_pythonlibboost_python-py35,或libboost_python-py27

这意味着在cmake你需要把它们称为python-35,而不是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 
    )