Dr. David Kirkby wrote: > Michael Droettboom wrote: >> A colleague of mine also suggested an alternative workaround that is >> almost humorously simple. Define both the C and C++ compilers to be >> "CC" when building matplotlib. That is, set the environment variable >> "CC" to "CC" and "CXX" to "CC". Distutils will then use the C++ >> compiler for everything (which for matplotlib we get lucky and it >> just works). >> >> Mike > > As I understand it, C++ compilers do not generate as efficient > binaries as C compilers do, so there would be a loss of speed I think. > How much I do not know. > > That seems more of a hack than a real solution to the problem, though > in some cases, hacks are the best choice. > > I know nothing about mathplotlib, other than it presented issues on > Solaris. If it not CPU/memory intensive, then I suspect the > performance penalty of using a C++ compiler to compile C could would > not be significant. It's mostly C++ anyway, with the exception of some of the font conversion, contouring and the (mostly obsolete) Gdk extension. I suspect it makes very little difference.
Mike > > David Kirkby. > > > >> Michael Droettboom wrote: >>> I've attached patches against Python 2.5 and 2.6 to that bug. >>> Neither is significantly different from the original patch. >>> >>> http://bugs.python.org/issue1222585 >>> >>> Once doing that, you'll also need to make the following change to >>> matplotlib so that the correct C++ runtime libraries are used. Once >>> I figure out how to correctly detect the compiler being used, I'll >>> make this change in the matplotlib SVN repository. (This is >>> non-trivial, since distutils doesn't have a Sun compiler >>> specialization -- it uses the "generic" Unix compiler support for >>> both gcc and Sun Studio.) >>> >>> Mike >>> >>> Index: setupext.py >>> =================================================================== >>> --- setupext.py (revision 7979) >>> +++ setupext.py (working copy) >>> @@ -221,7 +221,7 @@ >>> if sys.platform == 'win32' and win32_compiler == 'msvc': >>> std_libs = [] >>> else: >>> - std_libs = ['stdc++', 'm'] >>> + std_libs = ['m', 'Crun', 'Cstd'] >>> >>> def has_pkgconfig(): >>> if has_pkgconfig.cache is not None: >>> >>> >>> Michael Droettboom wrote: >>> >>>> This is a years-old known bug in distutils (which it looks like >>>> you've already commented on...). I've looked at it many times over >>>> those years, and it's really very difficult to fix from outside >>>> without terrible monkey-patching hacks that are certain to break on >>>> as many systems as they fix. We just may be forced to deal with it >>>> at this point, though. (FWIW, we run Solaris here, too, but we >>>> build matplotlib on gcc). I'll comment on that bug as well and see >>>> if we can get some movement on it. >>>> >>>> In the meantime, I'll investigate whether the scons work by David >>>> Cournapeau resolves this problem. See here: >>>> >>>> http://github.com/cournape/matplotlib/tree/scons_build >>>> >>>> Mike >>>> >>>> Dr. David Kirkby wrote: >>>> >>>>> I was trying to build matplotlib 0.99.0 as part of Sage >>>>> >>>>> http://www.sagemath.org/ >>>>> >>>>> on a Sun Blade 2000 workstation running Solaris 10 update 7, using >>>>> the Sun Studio compiler version 12.1 (not gcc). >>>>> >>>>> CC and CXX were defined properly as C and C++ compilers, but it >>>>> would appear that the C compiler is being called to compile the >>>>> file src/ft2font.cpp, which is of course a C++ file. >>>>> >>>>> You might get away with this with gcc, but the Sun C compiler will >>>>> not compile C++ code. >>>>> >>>>> Here's the error I get: >>>>> >>>>> >>>>> /opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 >>>>> -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API >>>>> -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include >>>>> >>>>> -I/usr/sfw/include -I/usr/sfw/include/freetype2 >>>>> -I/usr/local/include -I. >>>>> -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ >>>>> -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 >>>>> >>>>> -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o >>>>> cc: No valid input files specified, no output generated >>>>> error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit >>>>> status 1 >>>>> >>>>> This is recorded in the Sage trac as: >>>>> >>>>> http://trac.sagemath.org/sage_trac/ticket/7028 >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> >>>>> Let Crystal Reports handle the reporting - Free Crystal Reports >>>>> 2008 30-Day trial. Simplify your report design, integration and >>>>> deployment - and focus on what you do best, core application >>>>> coding. Discover what's new with >>>>> Crystal Reports now. http://p.sf.net/sfu/bobj-july >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Matplotlib-users@lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>> >>>> >>> >>> >> > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users