2014-03-01 29 views
0

我正在運行Ubuntu 13.10。我安裝了libboost1.54-dev。樓宇助推器-python示例

我做了Boost的Git結賬,並做了「boost-1.54.0」的結賬。

我改變了目錄來升級/ libs/python/example/tutorial在源代碼中。

我跑了「bjam」。我得到:

$ bjam 
Unable to load Boost.Build: could not find build system. 
--------------------------------------------------------- 
/home/dustin/build/boost/libs/python/example/boost-build.jam attempted to load the build system by invoking 

    'boost-build ../../../tools/build/v2 ;' 

but we were unable to find "bootstrap.jam" in the specified directory 
or in BOOST_BUILD_PATH (searching /home/dustin/build/boost/libs/python/example/../../../tools/build/v2, /usr/share/boost-build). 

Please consult the documentation at 'http://www.boost.org'. 

只有三個中的示例目錄下的文件:

-rw-r--r-- 1 dustin dustin 484 Mar 1 12:59 hello.cpp 
-rwxr-xr-x 1 dustin dustin 275 Mar 1 12:59 hello.py 
-rw-r--r-- 1 dustin dustin 1445 Mar 1 15:43 Jamroot 

的方向說,這應該是這麼簡單:http://www.boost.org/doc/libs/1_54_0/libs/python/doc/tutorial/doc/html/python/hello.html

最後的strace的幾行是:

openat(AT_FDCWD, "/home/dustin/build/boost/libs/python/example/tutorial", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 
openat(AT_FDCWD, "/home/dustin/build/boost/libs/python/example", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 
openat(AT_FDCWD, "/usr/share/boost-build", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 
open("/home/dustin/build/boost/libs/python/example/boost-build.jam", O_RDONLY) = 3 

爲什麼它尋找boost-build.jam?我錯過了什麼?

回答

1

實質上,bjam是一個解釋器,而Boost.Build是一個用bjam文件編寫的構建系統。當bjam啓動時,它會嘗試找到Boost.Build的卡紙文件。在這種情況下,bjam試圖找到boost-build.jam相對於教程和錯誤時的錯誤。要構建本教程,請執行以下任一操作:

  • 驗證boost/tools/build子模塊是否已從boost git存儲庫中初始化。 Boost.Python有其他依賴項,所以初始化所有子模塊可能會更容易。這將允許從libboost1.54-dev包安裝的bjam解釋器從存儲庫中找到Boost.Build,並構建教程及其依賴關係。
  • 要建立對打包庫:

    • 安裝libboost1.54包。這將安裝Boost.Python共享庫及其依賴項。
    • 修改教程的Jamroot文件。它應該不再嘗試使用升壓項目,應明確列出Boost.Python的共享庫路徑:

      -# Specify the path to the Boost project. If you move this project, 
      -# adjust this path to refer to the Boost root directory. 
      -use-project boost 
      - : ../../../.. ; 
      - 
      # Set up the project-wide requirements that everything uses the 
      -# boost_python library from the project whose global ID is 
      -# /boost/python. 
      +# boost_python library. 
      project 
      - : requirements <library>/boost/python//boost_python ; 
      + : requirements <library>/usr/lib/libboost_python-py27.so ; 
      

      庫路徑和名稱可能需要改變基於其中打包libboost-python1.54-dev安裝升壓。 Python庫。

    • BOOST_BUILD_PATH環境變量設置爲/usr/share/boost-build/kernel或安裝libboost1.54-dev程序包的任何地方boost-build.jam
+0

討論我想在的Archlinux相同的任務(做蟒蛇教程)和我有類似的問題。第二種方法(針對打包庫構建)改善了情況,但我仍然遇到問題。我的boost-build.jam文件在'/ usr/local/share/boost-build/src/kernel /'中,我相應地修改了環境路徑。但bjam報告遞歸問題:'/usr/local/share/boost-build/src/build/targets.jam:589:從模塊目標開始建設 錯誤:主目標引用遞歸' – stefano

+0

忘記我以前的評論。修訂後的Jamroot文件末尾留下了一個分號。這足以拋出遞歸問題。一切工作正常與您的(第二個)解決方案(並與結束分號!) – stefano

3

您可以創建自己的升壓build.jam中。對於快速啓動的示例(已損壞),只需創建一個名爲boost-build.jam的文件,並確保它指向src目錄。在此http://lists.boost.org/boost-build/2014/11/27738.php

# Edit this path to point at the tools/build/v2 subdirectory of your 
# Boost installation. Absolute paths work, too. 
boost-build ../../../../tools/build/src ;