-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
matplotlib 1.2.0 doesn't compile with Solaris Studio 12.3 CC #1839
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
Conversation
I dug up this and the way they deal with it there is to add a cast. I'm not sure how that helps us here, though. |
@rorth: Does the attached patch help? (I have no way of testing, but I did think the line was more specific than necessary and maybe the Solaris compiler doesn't like that). |
Looks like Oracle Solaris Studio is a free download for RHEL. I'll give this a try later tonight when I get home. Thanks for the patch, @mdboom. |
The patch alone is not enough, but the following additional changes allowed all of matplotlib 1.2.0 to compile:
|
@rorth: I think perhaps you closed the bug by accident? |
Certainly: I just meant to attach my tentative patch and mark the comment as closed. The UI isn't really intuitive, |
Agreed -- the "Close & Comment" button is more dangerous than it is useful. |
However, now I am going to close the bug because the fix has been comitted to the repository. 😉 |
It looks like this change missed being included in the zip posted on matplotlib.org (https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.2.1/matplotlib-1.2.1.tar.gz). In order to build on Solaris I had to manually modify line 84 in src/ft2font.h. [EDIT: I modified ft2font, not file_compat] I also had to update numpy, since Solaris 11 comes with Numpy 1.4.1, which does not seem to be compatible with matplotlib. Do we require 1.5.0 at a minimum, now? |
No, version 1.4 is the minimum. What happened to make you think it wasn't |
What did you modify in |
It wouldn't build because src/file_compat.h has a line
I didn't need to change this file, since updating numpy fixed this build issue. This file is not in version 1.4.1 of numpy (https://github.com/numpy/numpy/tree/v1.4.1/numpy/core/include/numpy) It is not included until version 1.5.0 (https://github.com/numpy/numpy/raw/v1.5.0/numpy/core/include/numpy/npy_3kcompat.h) |
Wow. That's a problem. You're totally right. We've been 'supporting' numpy v1.4 all this time without realising we haven't support numpy v1.4 since at least mpl v1.2. I'll open a separate issue for this. |
There is a similar bug in matplotlib 1.2.1 which makes compilation fail on solaris. It can be resolved by changing line 84 in src/ft2font.h to read:
|
@gunnarleffler Thanks for providing some diagnostics for us! In #2198 I implemented your patch. Can you confirm that it works? |
I'm running matplotlib 1.2.1 on my test server (SUN M3000) successfully! In addition to the fix I posted above, the setupext.py requires modification to compile using SolarisStudio. If it isn't modified, then you get "referenced symbol not found" errors when trying to run matplot lib. The patch that @tswast provided seems to be for an earlier version of matplotlib and mangles the setupext.py that ships with 1.2.1. His patch was very informative, and I was able to edit setupext.py to work. I can provide a diff file here that can be used to patch matplotlib 1.2.1, or on my github. Which would you prefer? |
I have to jet, so here is the diff file for setupext.py that should make matplotlib 1.2.1 compile on solaris with solarisstudio 12.3: ~/m3000/matplotlib-1.2.1 > diff setupext.py.bak setupext.py
257a258,260
> elif sys.platform == 'sunos5':
> std_libs = ['Crun', 'Cstd']
> print "sunos5 libraries set"
345c348
<
---
> module.libraries.extend(std_libs)
346a350
> include_dirs.append('/usr/include')
616a621
> module.libraries.extend(std_libs)
1045a1051
> module.libraries.extend(std_libs)
1085a1092
> module.libraries.extend(std_libs)
1094a1102
> module.libraries.extend(std_libs)
1330a1339
> delaunay.libraries.extend(std_libs)
1385a1395
> module.libraries.extend(std_libs) |
@gunnarleffler I'm having problems applying your patch. It doesn't appear to be in unified format. Would you mind applying it to your branch and making a pull request against my |
Unlike the matplotlib 1.1.0 release, which compiles seamlessly with the Solaris Studio 12.3
CC compiler (with a few caveats related to linking as described in http://www.timswast.com/blog/2012/08/06/compiling-matplotlib-with-solaris-studio/), the 1.2.0 release fails to compile
immediately:
building 'matplotlib.ft2font' extension
CC -g -DNDEBUG -O -Kpic -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/vol/python-2.7/lib/python2.7/site-packages/numpy/core/include -I/vol/X11/include/freetype2 -I/vol/X11/include -I. -I/vol/python-2.7/include/python2.7 -c src/ft2font.cpp -o build/temp.solaris-2.10-i86pc-2.7/src/ft2font.o
"/vol/python-2.7/include/python2.7/pyconfig.h", line 1127: Warning (Anachronism): Attempt to redefine _FILE_OFFSET_BITS without using #undef.
"src/ft2font.h", line 84: Error: PythonClass may not have a type qualifier.
"src/ft2font.h", line 84: Error: Py::PythonClassPy::T cannot be initialized in a constructor.
"src/ft2font.h", line 84: Error: Could not find Py::PythonClass::PythonClass() to initialize base class.
"src/ft2font.cpp", line 44: Error: PythonClass may not have a type qualifier.
"src/ft2font.cpp", line 44: Error: Py::PythonClassPy::T cannot be initialized in a constructor.
"src/ft2font.cpp", line 48: Error: Could not find Py::PythonClass::PythonClass() to initialize base class.
"src/ft2font.cpp", line 839: Error: PythonClass may not have a type qualifier.
"src/ft2font.cpp", line 839: Error: Py::PythonClassPy::T cannot be initialized in a constructor.
"src/ft2font.cpp", line 841: Error: Could not find Py::PythonClass::PythonClass() to initialize base class.
"src/ft2font.cpp", line 849: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1026: Warning: ptsize hides FT2Font::ptsize.
"src/ft2font.cpp", line 1027: Warning: dpi hides FT2Font::dpi.
"src/ft2font.cpp", line 1029: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1333: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1383: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1738: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1788: Warning: error hides FT2Font::error.
"src/ft2font.cpp", line 1991: Warning: angle hides FT2Font::angle.
"src/ft2font.cpp", line 2069: Warning: error hides FT2Font::error.
9 Error(s) and 11 Warning(s) detected.
error: command 'CC' failed with exit status 2
Since I don't know any C++, I've no idea what's wrong, but it would be good to restore
compilation with non-g++ compilers.
Thanks.
Rainer