0

我正在运行 Ubuntu 13.10 。我安装了 libboost1.54-dev。

我对 Boost 进行了 Git 签出,并对“boost-1.54.0”进行了签出。

我在源代码中将目录更改为 boost/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?我错过了什么?

4

2 回答 2

3

您可以创建自己的 boost-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 ;
于 2015-01-16T20:00:42.083 回答
1

本质上,bjam 是一个解释器,而 Boost.Build 是一个用 bjam 文件编写的构建系统。当 bjam 启动时,它将尝试查找 Boost.Build 的 jam 文件。在这种情况下,bjam 尝试boost-build.jam相对于教程进行定位,并在它丢失时出错。要构建教程,请执行以下任一操作:

  • 验证boost/tools/build子模块是否已从 boost git 存储库中初始化。Boost.Python 有其他依赖项,因此初始化所有子模块可能更容易。这将允许从libboost1.54-dev包中安装的 bjam 解释器从存储库中找到 Boost.Build,并构建教程及其依赖项。
  • 要针对打包的库进行构建:

    • 安装libboost1.54软件包。这将安装 Boost.Python 共享库及其依赖项。
    • 修改教程的 Jamroot 文件。它不应再尝试使用 boost 项目,而应明确列出 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包安装 Boost.Python 库的位置进行更改。

    • BOOST_BUILD_PATH环境变量设置为安装包的/usr/share/boost-build/kernel位置或位置。libboost1.54-devboost-build.jam
于 2014-03-03T00:30:32.697 回答