[C++-sig] OS X boost.python tutorial question

Patrick Hartling patrick.hartling at gmail.com
Fri Jun 24 21:50:31 CEST 2005


On 6/24/05, Gary Robinson <grobinson at goombah.com> wrote:
> 
> 
> Some of this is a repeat of an early question, but I really need an answer if
> one is available to be had. We want to use boost.py in our product, Goombah
> (http://www.python.com). We have it working on Windows, and have C code working
> in the product that uses boost.python on Windows. But we need it to work on OS X
> too if we're going to use it, since Goombah is a cross-platform product.
> 
> I have built boost.python successfully (at least it gives no "failure" or
> "skipped" messages). I did it by going to the root boost directory and entering:
> 
> bjam "-sPYTHON_ROOT=/System/Library/Frameworks/Python.framework/Versions/2.3"
> "-sPYTHON_VERSION=2.3" "-sTOOLS=darwin" "-sBUILD=debug release"
> 
> I then went to the ../examples/tutorial folder and ran bjam with the same
> arguments, and that  too seemed to complete successfully.
> 
> hello.so was created and was in the directory
> /Users/garyrob/Desktop/boost_1_32_0/bin/boost/libs/python/example/tutorial/hello
> .so/darwin/release/shared-linkable-true/hello.so
> 
> However the tutorial text explicitly states that libboost_python.so will be
> created too. No such file was created.  I don't know whether the it's the
> documentation that's in error or whether something didn't work right in the
> build. Can someone tell me which is the case?
> 
> When I enter interactive python and try to import the hello module, I get:
> 
>  import hello Traceback (most recent call last): File "<stdin>", line 1, in ?
> ImportError: Failure linking new module:
> ../../../bin/boost/libs/python/build/libboost_python.dylib/darwin/release/shared
> -linkable-true/libboost_python.dylib: dyld: python can't open library:
> ../../../bin/boost/libs/python/build/libboost_python.dylib/darwin/release/shared
> -linkable-true/libboost_python.dylib  (No such file or directory, errno = 2)
> 
> 
> libboost_python.dylib was created, and is in the stated location (if ../../..
> means ~/Desktop/boost_1_32_0/ on my machine). So I don't know why it's giving me
> an error:
> 
> ls -l
> ~/Desktop/boost_1_32_0/bin/boost/libs/python/build/libboost_python.dylib/darwin/
> release/shared-linkable-true/libboost_python.dylib -rwxr-xr-x  1 root  staff
> 1102392 24 Jun 09:53
> /Users/garyrob/Desktop/boost_1_32_0/bin/boost/libs/python/build/libboost_python.
> dylib/darwin/release/shared-linkable-true/libboost_python.dylib
> Gary-Robinsons-Computer:~/Desktop/boost_1_32_0/bin/boost/libs/python/example/
> tutorial/hello.so/darwin/release/shared-linkable-true garyrob$
> 
> 
> If anyone can help me get the tutorial working I'd really appreciate it.

Do you have the directory
/Users/garyrob/Desktop/boost_1_32_0/bin/boost/libs/python/build/libboost_python.dylib/darwin/release/shared-linkable-true
in your $DYLD_LIBRARY_PATH environment variable?

 -Patrick


-- 
Patrick L. Hartling
http://www.137.org/patrick/



More information about the Cplusplus-sig mailing list