我过去在其他mac上安装了boost-python而没有任何问题,但由于某些原因我在新MacBook上遇到了问题。当我尝试运行“quickstart”boost-python示例时,bjam在链接第二个时挂起。这是我的构建日志,它显示第一个示例构建和传递,但第二个示例永远不会完成链接(bjam挂起在日志的最后一行)。有什么可能导致这种情况的猜测?
(顺便说一句,我使用的是python 2.7,boost 1.49,osx 10.7和clang 3.1)
>>> cd boost_1_49_0/libs/python/example/quickstart/
>>> ../../../../bjam -a --verbose-test test
...patience...
...patience...
...found 1692 targets...
...updating 40 targets...
darwin.compile.c++ bin/darwin-4.2.1/debug/embedding.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/numeric.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/list.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/long.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/dict.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/tuple.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/str.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/slice.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/converter/from_python.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/converter/registry.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/converter/type_id.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/enum.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/class.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/function.o
../../../../libs/python/src/object/function.cpp: In member function ‘PyObject* boost::python::objects::function::call(PyObject*, PyObject*) const’:
../../../../libs/python/src/object/function.cpp:169: warning: comparison is always true due to limited range of data type
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/inheritance.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/life_support.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/pickle_support.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/errors.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/module.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/converter/builtin_converters.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/converter/arg_to_python_base.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/iterator.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/stl_iterator.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object_protocol.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object_operators.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/wrapper.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/import.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/exec.o
darwin.compile.c++ ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/object/function_doc_signature.o
darwin.link.dll ../../../../bin.v2/libs/python/build/darwin-4.2.1/debug/libboost_python.dylib
darwin.link bin/darwin-4.2.1/debug/embedding
testing.capture-output bin/test_embed.test/darwin-4.2.1/debug/test_embed.run
====== BEGIN OUTPUT ======
registering extension module embedded_hello...
defining Python class derived from Base...
testing derived class from C++...
success!
running file script.py...
Hello World !
success!
intentionally causing a python exception...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'unknown' is not defined
No errors detected.
EXIT STATUS: 0
====== END OUTPUT ======
**passed** bin/test_embed.test/darwin-4.2.1/debug/test_embed.test
common.mkdir bin/test_ext.test
common.mkdir bin/test_ext.test/darwin-4.2.1
common.mkdir bin/test_ext.test/darwin-4.2.1/debug
darwin.compile.c++ bin/darwin-4.2.1/debug/extending.o
darwin.link.dll bin/darwin-4.2.1/debug/extending.so
答案 0 :(得分:1)
听起来很像this错误。我自己无法找到修复程序,但是在过去的几周里我一直在使用Boost.Python,而不会影响我自己的代码。
请注意,如果您的Python测试文件(可能在构建后调用)因任何原因(例如在pdb断点处)挂起,那么您将看到类似的行为。