【发布时间】:2015-04-18 17:53:44
【问题描述】:
我正在尝试为 Boost.Python 设置和编译 Hello World 示例:http://www.boost.org/doc/libs/1_57_0/libs/python/doc/tutorial/doc/html/python/hello.html
我从 Homebrew 安装了 bjam、boost、boost-build 和 boost-python:
brew install bjam
brew install boost
brew install boost-build
brew install boost-python
我的 python 安装也是通过 Homebrew 安装的。我不确定如何正确修改示例 Jamroot 文件,以使其与我的系统设置兼容。我将提升路径更改为: /usr/local/Cellar/boost;,但我不确定需要更改的其他路径。当前设置给了我以下错误:
> bjam
notice: no Python configured in user-config.jam
notice: will use default configuration
Jamroot:26: in modules.load
*** argument error
* rule use-project ( id : where )
* called with: ( boost : /usr/local/Cellar/boost; project : requirements <library>/boost/python//boost_python <implicit-dependency>/boost//headers : usage-requirements <implicit-dependency>/boost//headers )
* extra argument project
/usr/local/share/boost-build/build/project.jam:1138:see definition of rule 'use-project' being called
/usr/local/share/boost-build/build/project.jam:311: in load-jamfile
/usr/local/share/boost-build/build/project.jam:64: in load
/usr/local/share/boost-build/build/project.jam:145: in project.find
/usr/local/share/boost-build/build-system.jam:535: in load
/usr/local/share/boost-build/kernel/modules.jam:289: in import
/usr/local/share/boost-build/kernel/bootstrap.jam:139: in boost-build
/usr/local/share/boost-build/boost-build.jam:8: in module scope
【问题讨论】:
-
你能试试像:
BOOST_ROOT=/usr/local/Cellar/boost BOOST_BUILD_PATH=/usr/local/Cellar/boost/tools/build/src bjam吗?我曾经遇到过类似的问题,我发现通过环境变量明确告诉 bjam 在哪里寻找东西解决了我的问题。不确定是否有帮助。
标签: python boost boost-python bjam