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

Skip to content

Issues compiling with clang + Python 3.x #733

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
Mar 1, 2012

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Mar 1, 2012

When trying to compile matplotlib with Python 3.x on MacOS 10.7, the compilation fails:

clang -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -O2 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/Users/Shared/Jenkins/Home/virtualenvs/python3.2-numpy1.5.0/lib/python3.2/site-packages/numpy/core/include -I/opt/local/include/freetype2 -I/opt/local/include -I. -I/opt/local/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c src/ft2font.cpp -o build/temp.macosx-10.7-x86_64-3.2/src/ft2font.o
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:6:
In file included from ./CXX/Extensions.hxx:42:
In file included from ./CXX/Python3/Extensions.hxx:52:
./CXX/Python3/Objects.hxx:416:14: warning: 'Py::Null::accepts' hides overloaded virtual function [-Woverloaded-virtual]
        bool accepts( PyObject *pyob )
             ^
./CXX/Python3/Objects.hxx:239:22: note: hidden overloaded virtual function 'Py::Object::accepts' declared here
        virtual bool accepts( PyObject *pyob ) const
                     ^
./CXX/Python3/Objects.hxx:1523:25: error: member reference base type 'SeqBase<T> *const' is not a structure or union
                if( seq.ptr() != other.seq.ptr() )
                    ~~~ ^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1

The same compilation works with gcc (but this is not the default compiler on 10.7). I found this after setting up a Jenkins instance to test matplotlib with different Python and Numpy versions, and C compilers.

@mdboom - maybe you have some ideas since you fixed the clang errors with Python 2.x?

@mdboom
Copy link
Member

mdboom commented Mar 1, 2012

I don't have a Python 3.x install handy under OS-X 10.7 ATM, so I hope you don't mind doing a bit remote compilation for me ;) Does the attached branch resolve this? (There might be other errors behind it, of course). If this works, I should submit these changes to CXX upstream.

Any plans to make the Jenkins results public? I had considered making a Shining Panda project for matplotlib, but the time limits on the free plan there would be prohibitive.

@astrofrog
Copy link
Contributor Author

@mdboom - it seems to work! Matplotlib now compiles on MacOS 10.7 with Python 2.5, 2.6, 3.1, and 3.2 with both clang and gcc :-)

@astrofrog
Copy link
Contributor Author

@mdboom - regarding Jenkins, I'm planning on publishing results as soon as the publisher plugin supports proxy settings: https://issues.jenkins-ci.org/browse/JENKINS-12406

mdboom added a commit that referenced this pull request Mar 1, 2012
Issues compiling with clang + Python 3.x
@mdboom mdboom merged commit 80d1a7c into matplotlib:master Mar 1, 2012
@mdboom
Copy link
Member

mdboom commented Mar 2, 2012

From Barry Scott: "Committed as r272 on trunk. Will make it into 6.2.4 that I'm about to release."

@mdboom mdboom deleted the clang-py3-fixes branch March 3, 2015 18:43
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