[PySide] shiboken build issue with PythonLibs

Amos Anderson amos.anderson at protabit.com
Wed Sep 11 00:55:01 CEST 2013


Hello PySide list!

I'm trying to compile PySide on an OSX 10.6 machine, but I run into a problem where shiboken is linking to a python symbol __PyTrash_thread_deposit_object which doesn't exist in the local python it's supposed to be linking against (the symbol __PyTrash_deposit_object exists there instead, c.f. the text pasted below). That is, I'm storing a version of python in a project directory, and shiboken is supposed to link against that, but it appears to be linking against the python in /Library/Frameworks/Python.framework (which has extra symbols that my project python does not have). The environment.sh script is finding my python, and my python's libraries are on DYLD_LIBRARY_PATH, but shiboken and/or cmake seem to be ignoring them. The build works if I delete my python from /Library/Frameworks/Python.framework.

I even tried adding:
-DPYTHON_LIBRARY=/Users/amosa/triad/tools/python/lib/libpython2.7.dylib -DPYTHON_INCLUDE=/Users/amosa/triad/tools/python/include
to the cmake command in build_and_install, but that didn't help. it printed:
-- Found PythonLibs: /Users/amosa/triad/tools/python/lib/libpython2.7.dylib (found suitable version "2.7.5", minimum required is "2.6") 
-- Found PythonInterp: /Users/amosa/triad/tools/python/bin/python2.7 (found version "2.7.3")
I can't explain the version discrepancy (my Frameworks version is 2.7.5, my local version is 2.7.3)

I'm using cmake 2.8.10.1

So anyway, I have a solution available, but it's a hack... it would be nice to know if there's a way available that's less of a hack. Any suggestions?

Thanks!
Amos.















[tower]/Users/amosa/triad> ./triad.sh
mercurial version: 12958:b1a1cd107c97
Python 2.7.3 (default, Sep 10 2013, 11:59:53) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide import QtGui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/amosa/triad/tools/pyside/pyside-sandbox/lib/python2.7/site-packages/PySide/QtGui.so, 2): Symbol not found: __PyTrash_thread_deposit_object
  Referenced from: /Users/amosa/triad/tools/pyside/pyside-sandbox/lib/libshiboken-python2.7.1.1.dylib
  Expected in: flat namespace
 in /Users/amosa/triad/tools/pyside/pyside-sandbox/lib/libshiboken-python2.7.1.1.dylib
>>> import OpenGL
>>> import PySide
>>> 
[tower]/Users/amosa/triad/tools/pyside/pyside-sandbox/lib> nm libshiboken-python2.7.1.1.dylib | grep Trash
                 U __PyTrash_thread_deposit_object
                 U __PyTrash_thread_destroy_chain
[tower]/Users/amosa/triad/tools/pyside/pyside-sandbox/lib> nm ../../../python/lib/libpython2.7.dylib | grep Trash
000000000018ed20 D __PyTrash_delete_later
000000000018ed18 D __PyTrash_delete_nesting
00000000000561e0 T __PyTrash_deposit_object
0000000000056200 T __PyTrash_destroy_chain
[tower]/Library/Frameworks/Python.framework/Versions/2.7> nm Python | grep Trash
0000000000193f00 D __PyTrash_delete_later
0000000000193ef8 D __PyTrash_delete_nesting
0000000000057140 T __PyTrash_deposit_object
0000000000057190 T __PyTrash_destroy_chain
0000000000057160 T __PyTrash_thread_deposit_object
00000000000571d0 T __PyTrash_thread_destroy_chain



[tower]/Users/amosa/triad/tools/pyside/test/PySide-BuildScripts-2763427> diff build_and_install ../../BuildScripts/build_and_install
36c36
<             PYSIDE_BS_CMAKE_FLAGS="-DALTERNATIVE_QT_INCLUDE_DIR=/Library/Frameworks/"
---
>             PYSIDE_BS_CMAKE_FLAGS="-DALTERNATIVE_QT_INCLUDE_DIR=/Users/amosa/triad/tools/qt/include/"



[tower]/Users/amosa/triad/tools/pyside/test/PySide-BuildScripts-2763427> diff environment.sh ../../BuildScripts/environment.sh 
21c21
<     export PYSIDESANDBOXPATH=$HOME/pkg/pyside-sandbox-python3
---
>     export PYSIDESANDBOXPATH=/Users/amosa/triad/tools/pyside/pyside-sandbox-python3
24,25c24,25
<     PYTHONXY=`python -V 2>&1 | sed -e 's/Python \(2\.[0-9]*\).*/python\1/'`
<     export PYSIDESANDBOXPATH=$HOME/pkg/pyside-sandbox
---
>     PYTHONXY=`/Users/amosa/triad/tools/python/bin/python -V 2>&1 | sed -e 's/Python \(2\.[0-9]*\).*/python\1/'`
>     export PYSIDESANDBOXPATH=/Users/amosa/triad/tools/pyside/pyside-sandbox
33a34,37
> echo "#### python ="`which python`
> echo "#### path = $PATH"
> echo "#### dyld = $DYLD_LIBRARY_PATH"
> 




#### python =/Users/amosa/triad/tools/python/bin/python
#### path = /Users/amosa/triad/tools/pyside/pyside-sandbox/bin:/Users/amosa/triad/tools/python/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/texbin:/Users/amos/bin:/Users/amosa/triad/apps:/Users/amosa/triad/tools/cmake/bin/
#### dyld = /Users/amosa/triad/tools/pyside/pyside-sandbox/lib:/Users/amosa/triad/tools/python/lib::/Users/amosa/triad/lib:/usr/local/cuda/lib





More information about the PySide mailing list