Thanks to visit codestin.com
Credit goes to github.com

Skip to content

incorrect linkage if system PyCXX is found #1884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Apr 8, 2013

as reported on matotlib-devel by @fperez
If current matplotlib HEAD is built on a system with PyCXX installed its extensions ends up with different incorrect linkage than when it does not find a system installation:
On ubuntu 12.10
with python-cxx-dev installed:

...
                 pycxx: yes [version None]
...

g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/src/_png.o build/temp.linux-x86_64-2.7/src/mplutils.o build/temp.linux-x86_64-2.7/usr/share/python2.7/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/usr/share/python2.7/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/usr/share/python2.7/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/usr/share/python2.7/CXX/cxxextensions.o -L/usr/local/lib -lstdc++ -lm -lstdc++ -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -lstdc++ -lm -o build/lib.linux-x86_64-2.7/matplotlib/_png.so

without python-cxx-dev installed

...
                 pycxx: yes [Couldn't import.  Using local copy.]
...
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/src/_png.o build/temp.linux-x86_64-2.7/src/mplutils.o build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/CXX/cxxextensions.o -L/usr/local/lib -lpng12 -lstdc++ -lm -o build/lib.linux-x86_64-2.7/matplotlib/_png.so

note the much longer list of libraries and in the second case, especially -lpng12 is missing if python-cxx-dev is installed which prevents startup of matplotlib with

undefined symbol: png_create_read_struct

matplotlib also seems to be looking for a PyCXX.pc file which is not provided by upstream (and thus not by the package)

Package PyCXX was not found in the pkg-config search path.
Perhaps you should add the directory containing `PyCXX.pc'
to the PKG_CONFIG_PATH environment variable
No package 'PyCXX' found

…n't exist upstream and in many packages). Don't overwrite existing libraries on an extension if pkg-config fails for one component. Don't spew pkg-config error messages to the console.
@mdboom
Copy link
Member

mdboom commented Apr 8, 2013

@juliantaylor , @fperez : Can you confirm this patch fixes the original issue. I was able to reproduce on Fedora by moving the PyCXX.pc file, but haven't had yet tested on Debian or Ubuntu.

@juliantaylor
Copy link
Contributor Author

it fixes the issue for me on ubuntu 13.04

mdboom added a commit that referenced this pull request Apr 25, 2013
incorrect linkage if system PyCXX is found
@mdboom mdboom merged commit 386b4e5 into matplotlib:master Apr 25, 2013
@mdboom mdboom deleted the pycxx-system-library branch August 7, 2014 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants