Boost logo

Boost-Build :

Subject: Re: [Boost-build] [boost-build] darwin linker hangs when building boost.python quickstart example
From: Berg, Stuart (bergs_at_[hidden])
Date: 2012-04-02 10:19:39


Thanks for the reply, Steven.

> This is a long-standing bug, that no one's been
> able to track down:
> https://svn.boost.org/trac/boost/ticket/2185
>
>> From the ticket it appears that:
> a) The python command is running
> b) The python command hangs
> c) If the python command is run manually it
> works correctly.

I thought this issue was related to my inability to run boost-python extension modules, but if the command works correctly when run manually, then maybe it was a red herring and my real problem is a different one.

When I attempt to use an extension module, python acts as though I have a version mismatch (see fatal python error, below). But as far as I can tell, the 'file' and 'otool' commands aren't showing anything unusual (unless there's a big difference between 2.7.1 and 2.7.2 -- scroll to the bottom of this output to see what otool says.) I'm out of ideas here . . . Is there anything else I should look at to figure this out?

Thanks again,
Stuart

$ cd libs/python/example/tutorial/
$ ../../../../bjam -a toolset=clang --verbose-test hello
<<snip compiler output>>
50 warnings generated.
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object/life_support.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object/pickle_support.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/errors.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/module.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/converter/builtin_converters.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/converter/arg_to_python_base.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object/iterator.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object/stl_iterator.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object_protocol.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object_operators.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/wrapper.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/import.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/exec.o
clang-darwin.compile.c++ ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/object/function_doc_signature.o
clang-darwin.link.dll ../../../../bin.v2/libs/python/build/clang-darwin-4.2.1/debug/libboost_python.dylib
clang-darwin.link.dll bin/clang-darwin-4.2.1/debug/hello_ext.so
capture-output bin/hello.test/clang-darwin-4.2.1/debug/hello
/bin/sh: line 6: 19223 Abort trap: 6 "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" "hello.py" > "bin/hello.test/clang-darwin-4.2.1/debug/hello.output" 2>&1
====== BEGIN OUTPUT ======
Fatal Python error: Interpreter not initialized (version mismatch?)

EXIT STATUS: 134
====== END OUTPUT ======

    DYLD_LIBRARY_PATH="/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7:/Users/bergs/Downloads/boost_1_49_0/bin.v2/libs/python/build/clang-darwin-4.2.1/debug:/Users/bergs/Downloads/boost_1_49_0/libs/python/example/tutorial/bin/clang-darwin-4.2.1/debug:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH

    PYTHONPATH="bin/clang-darwin-4.2.1/debug"
export PYTHONPATH
 "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" "hello.py" > "bin/hello.test/clang-darwin-4.2.1/debug/hello.output" 2>&1
    status=$?
    echo >> "bin/hello.test/clang-darwin-4.2.1/debug/hello.output"
    echo EXIT STATUS: $status >> "bin/hello.test/clang-darwin-4.2.1/debug/hello.output"
    if test $status -eq 0 ; then
        cp "bin/hello.test/clang-darwin-4.2.1/debug/hello.output" "bin/hello.test/clang-darwin-4.2.1/debug/hello"
    fi
    verbose=1
    if test $status -ne 0 ; then
        verbose=1
    fi
    if test $verbose -eq 1 ; then
        echo ====== BEGIN OUTPUT ======
        cat "bin/hello.test/clang-darwin-4.2.1/debug/hello.output"
        echo ====== END OUTPUT ======
    fi
    exit $status

...failed capture-output bin/hello.test/clang-darwin-4.2.1/debug/hello...
...failed updating 1 target...
...skipped 1 target...
...updated 31 targets…

$ ########################
$ # Version info and otool output:
$ ########################

$ file hello_ext.so
hello_ext.so: Mach-O 64-bit dynamically linked shared library x86_64

$ otool -L hello_ext.so
hello_ext.so:
        hello_ext.so (compatibility version 0.0.0, current version 0.0.0)
        libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0)
        /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.1)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

$ python --version
Python 2.7.2

$ otool -L /Library/Frameworks/Python.framework/Versions/2.7/Python
/Library/Frameworks/Python.framework/Versions/2.7/Python:
        /Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

$ file /Library/Frameworks/Python.framework/Versions/2.7/Python
/Library/Frameworks/Python.framework/Versions/2.7/Python: Mach-O universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.7/Python (for architecture i386): Mach-O dynamically linked shared library i386
/Library/Frameworks/Python.framework/Versions/2.7/Python (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk