boost python python, Mac-, , , .
...
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python
Python 2.7.2 (default, Nov 17 2011, 00:52:26)
$ sudo ./bootstrap.sh --with-libraries=python --with-python-root=/opt/local/Library/Frameworks/Python.framework/Versions/2.7
$ ./b2
$ cd /Users/YourName/Downloads/boost_1_48_0/libs/python/example/tutorial
$ ../../../../bjam
...patience...
...patience...
...found 1577 targets...
...updating 12 targets...
common.mkdir bin
common.mkdir bin/darwin-4.2.1
common.mkdir bin/darwin-4.2.1/debug
darwin.compile.c++ bin/darwin-4.2.1/debug/hello.o
darwin.link.dll bin/darwin-4.2.1/debug/hello_ext.so
common.copy libboost_python.dylib
common.copy hello_ext.so
common.mkdir bin/hello.test
common.mkdir bin/hello.test/darwin-4.2.1
common.mkdir bin/hello.test/darwin-4.2.1/debug
capture-output bin/hello.test/darwin-4.2.1/debug/hello
**passed** bin/hello.test/darwin-4.2.1/debug/hello.test
...updated 12 targets...
$ ls
Jamroot hello.cpp hello_ext.so
bin hello.py libboost_python.dylib
$ python
Python 2.7.2 (default, Nov 17 2011, 00:52:26)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello_ext
>>> hello_ext.greet()
'hello, world'
>>>
, , mac-, . , boost.python , 1.47 1.48.
$ port info boost
boost @1.47.0, Revision 2 (devel)
Variants: debug, no_single, no_static, openmpi, python24, python25, python26, python27, python31, python32, regex_match_extra,
universal
Description: Boost provides free portable peer-reviewed C++ libraries. The emphasis is on portable libraries which work well with
the C++ Standard Library.
Homepage: http://www.boost.org
Library Dependencies: zlib, expat, bzip2, icu
Platforms: darwin
License: Boost-1.0
Maintainers: adfernandes@macports.org
, , , :).
$echo $press-TAB