2016-08-26 63 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 
    )