On 9/16/10 11:16 PM, Eric Firing wrote: > On 09/16/2010 05:15 PM, Jason Grout wrote: >> On 9/16/10 10:00 PM, Eric Firing wrote: >>> On 09/16/2010 04:12 PM, Jason Grout wrote: >>>> On 9/16/10 9:03 PM, Jason Grout wrote: >>>>> On 9/16/10 8:00 PM, Eric Firing wrote: >>>>> >>>>>>>> I tested your patch with Ubuntu 10.10, and it failed. The problem is >>>>>>>> that something is including setjmp.h before libpng.h tries to do so via >>>>>>>> pngconf.h, resulting in an error as the compiler trips over the >>>>>>>> following: >>>>>>> >>>>>> >>>>>> Python.h includes pyfpe.h which includes setjmp.h. >>>>>> >>>>>> Eric >>>>>> >>>>> >>>>> Ah, good catch. So we just need to include Python.h first, and then set >>>>> that extra #def so that libpng doesn't try to include it? >>>>> >>>>> #include "Python.h" >>>>> #def PNG_SKIP_SETJMP_CHECK >>>>> #include<png.h> >>>>> >>>> >>>> Let me try again: >>>> >>>> In _backend_agg.cpp and _png.cpp, just add >>>> >>>> #define PNG_SKIP_SETJMP_CHECK >>>> >>>> right above >>>> >>>> #include<png.h> >>>> >>>> Does that fix it? >>> >>> Sure does. Your patch with that modification is committed to branch and >>> trunk, 8706, 8707. Thank you! >>> >> >> Did someone check on Windows? I was hoping things wouldn't break in >> WrapPython.h when I switched the order of includes, but you never know... > > Jason, > > Big trouble, even without Windows. First, after doing more reading, I > am far from sure that skipping the check is OK. Second, it doesn't work > on earlier Linux versions, for which pngconf.h lacks that SKIP variable > entirely. > > What a pain. I see that Andrew Straw ran into this wall a couple years ago. > > Time to revert and re-think. It may be that your patch is almost OK, > but will need a tweak for Linux.
An equivalent, but very hackish, fix is to just undef _SETJMP_H. That's almost as bad as the original undef, though. Maybe putting this: #ifdef __linux__ #undef _SETJMP_H #endif #define PNG_SKIP_SETJMP_CHECK right before including png.h would work, at least until distros (eventually) upgrade to a libpng past April 2009 (when the check was added) or until we stop supporting the old distros. Thanks, Jason ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel