Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread John Hunter
On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby
 wrote:
> William Stein wrote:
>>
>> Hi,
>>
>> I spent several hours yesterday trying to get matplotlib for Sage to
>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>> another test machine (bsd.math) the workaround from my laptop doesn't
>> work.  So at this point Sage still does not support OS X 10.6.
>
>
> Just to add (which I've also CC'ed to John), mathplotlib (at least the
> version in Sage), is not respecting CXX properly. I specified CC as the Sun
> C compiler, and CXX as the Sun C++ compiler. The code then tries to build a
> C++ file (src/ft2font.cpp) with the Sun C compiler, which fails.
>
> /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
>
> I've not looked at this in detail, so it could be a Sage-specific issue.

I forwarded the original message on to matplotlib-devel.  It would be
helpful if when replying to this message or any in this thread if we
CC the matplotlib-devel mailing list.  I'm the list moderator so I can
approve these messages and you won't need to subscribe.  I don't have
any immediate answers for you now, but hopefully we can come up with
some.

JDH

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Fwd: OS X 10.6 port

2009-09-28 Thread Michael Droettboom
John Hunter wrote:
> I spent several hours yesterday trying to get matplotlib for Sage to
> work on OS X 10.6.  On my laptop everything works perfectly, but on
> another test machine (bsd.math) the workaround from my laptop doesn't
> work.  So at this point Sage still does not support OS X 10.6.
>
> The problem is in matplotlib's C++ wrapper for freetype2.  It's a
> Python extension module implemented directly in C++, and it simply
> doesn't work correctly at all.  For example, whenever it tries to
> raise a Python exception, it just terminates Python with
>
> "11713 Abort trap  sage-ipython "$@" -i"
>   
Can you run this inside of gdb and get a traceback?
> I'm cc'ing John Hunter -- author of matplotlib, in case he has any
> advice to share.  In particular, he has an account on
> bsd.math.washington.edu and build tests matplotlib there, so I'm
> curious if he has any issues with that.  Note that Sage builds
> freetype from source, which could be relevant.
>
> I will try updating freetype in Sage (our version is slightly out of
> date), and also checking if there is some sort of conflict with a
> system-wide freetype.  My worry is that Matplotlib has some weird
> custom C++ code for writing extensions that maybe uses signals or
> something to raise exceptions, and it is just broken when used with OS
> X 10.6.  Hopefully this is not that the case, and something special to
> Sage is happening.
>   
CXX is the name of the C++ wrapper mechanism we use and is reasonably 
well-maintained.  I can't find out if it has been tested on 10.6 yet, 
but it's certainly been tested on the gcc version that comes with it.  
There are no signals involved, only standard C++ exceptions which are 
delegated to Python exceptions.  Is it possible there is any C++ code 
linked to this that was generated with another compiler version?

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread Michael Droettboom
I forgot a detail: you have to use a script to edit the commandline 
arguments to pass to gcc:

#!/bin/sh
y=""
for x in $*
do
   case "$x"
   in
   -xcode*)
   echo skip $x
   ;;
   *)
   y="$y $x"
   ;;
   esac
done
gcc $y

and then do

CC=gcc_hack python setup.py build

(where gcc_hack is the path to the above script)

Mike

John Hunter wrote:
> On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby
>  wrote:
>   
>> William Stein wrote:
>> 
>>> Hi,
>>>
>>> I spent several hours yesterday trying to get matplotlib for Sage to
>>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>>> another test machine (bsd.math) the workaround from my laptop doesn't
>>> work.  So at this point Sage still does not support OS X 10.6.
>>>   
>> Just to add (which I've also CC'ed to John), mathplotlib (at least the
>> version in Sage), is not respecting CXX properly. I specified CC as the Sun
>> C compiler, and CXX as the Sun C++ compiler. The code then tries to build a
>> C++ file (src/ft2font.cpp) with the Sun C compiler, which fails.
>>
>> /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
>>
>> I've not looked at this in detail, so it could be a Sage-specific issue.
>> 
>
> I forwarded the original message on to matplotlib-devel.  It would be
> helpful if when replying to this message or any in this thread if we
> CC the matplotlib-devel mailing list.  I'm the list moderator so I can
> approve these messages and you won't need to subscribe.  I don't have
> any immediate answers for you now, but hopefully we can come up with
> some.
>
> JDH
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread Michael Droettboom
This is a very long-standing bug in distutils:

   http://bugs.python.org/issue1222585

While distutils distinguishes between C and C++ for *linking*, it does 
not do so for *compiling*.  This doesn't matter for gcc and msvc (which 
are arguably the two most popular compilers for Python), but probably 
does for most commercial Unix compilers.  I have no idea why this patch 
has never been applied in all these years -- but please jump on that bug 
report so we can see about getting it fixed.

As for us at STScI, we just build matplotlib with gcc on Solaris and it 
works fine.

Mike

John Hunter wrote:
> On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby
>  wrote:
>   
>> William Stein wrote:
>> 
>>> Hi,
>>>
>>> I spent several hours yesterday trying to get matplotlib for Sage to
>>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>>> another test machine (bsd.math) the workaround from my laptop doesn't
>>> work.  So at this point Sage still does not support OS X 10.6.
>>>   
>> Just to add (which I've also CC'ed to John), mathplotlib (at least the
>> version in Sage), is not respecting CXX properly. I specified CC as the Sun
>> C compiler, and CXX as the Sun C++ compiler. The code then tries to build a
>> C++ file (src/ft2font.cpp) with the Sun C compiler, which fails.
>>
>> /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
>>
>> I've not looked at this in detail, so it could be a Sage-specific issue.
>> 
>
> I forwarded the original message on to matplotlib-devel.  It would be
> helpful if when replying to this message or any in this thread if we
> CC the matplotlib-devel mailing list.  I'm the list moderator so I can
> approve these messages and you won't need to subscribe.  I don't have
> any immediate answers for you now, but hopefully we can come up with
> some.
>
> JDH
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Fwd: OS X 10.6 port

2009-09-28 Thread Tony S Yu

On Sep 28, 2009, at 2:14 AM, John Hunter wrote:

> in case anyone has some suggestions, I'm forwarding this from the  
> sage list
>
>
> -- Forwarded message --
> From: William Stein 
> Date: Sun, Sep 27, 2009 at 10:51 PM
> Subject: OS X 10.6 port
> To: sage-devel , John Hunter  >
>
>
> Hi,
>
> I spent several hours yesterday trying to get matplotlib for Sage to
> work on OS X 10.6.  On my laptop everything works perfectly, but on
> another test machine (bsd.math) the workaround from my laptop doesn't
> work.  So at this point Sage still does not support OS X 10.6.
>
> The problem is in matplotlib's C++ wrapper for freetype2.  It's a
> Python extension module implemented directly in C++, and it simply
> doesn't work correctly at all.  For example, whenever it tries to
> raise a Python exception, it just terminates Python with
>
> "11713 Abort trap  sage-ipython "$@" -i"

I thought I'd chime in since I recently upgraded to OSX 10.6. I don't  
think I ever got this error, so I probably didn't have the same issue,  
but just in case...

I reinstalled freetype2, but I'm not sure if I needed to. I also made  
a change to setupext.py so that the setup script could find freetype2,  
but this doesn't seem to be your problem because your errors don't  
occur during the build.

Did you happen to build on top of an old install? I had to clean out  
the old compiled extensions before everything would build properly. I  
had to clean out the build directory (obviously), but there are also  
*.so files in lib/matplotlib and lib/matplotlib/backends.

I should note that I'm built on top of the system python (2.6.1) and I  
did not use make.osx.

-Tony



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread Dr. David Kirkby
Michael Droettboom wrote:
> This is a very long-standing bug in distutils:
> 
>   http://bugs.python.org/issue1222585
> 
> While distutils distinguishes between C and C++ for *linking*, it does 
> not do so for *compiling*.  This doesn't matter for gcc and msvc (which 
> are arguably the two most popular compilers for Python), but probably 
> does for most commercial Unix compilers.  I have no idea why this patch 
> has never been applied in all these years -- but please jump on that bug 
> report so we can see about getting it fixed.
> 
> As for us at STScI, we just build matplotlib with gcc on Solaris and it 
> works fine.
> 
> Mike


I've registered on the python bug tracker, and submitted a request that 
this bug is solved. The patch on there is against a 3-year old version 
of python, so I'd rather not try to integrate it myself, especially as 
the patch is non-trivial.

I expected that trying to build Sage with Sun Studio would uncover some 
bugs in other software, but even I am amazed at just how many bugs this 
uncovers.


Dave





> 
> John Hunter wrote:
>> On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby
>>  wrote:
>>  
>>> William Stein wrote:
>>>
 Hi,

 I spent several hours yesterday trying to get matplotlib for Sage to
 work on OS X 10.6.  On my laptop everything works perfectly, but on
 another test machine (bsd.math) the workaround from my laptop doesn't
 work.  So at this point Sage still does not support OS X 10.6.
   
>>> Just to add (which I've also CC'ed to John), mathplotlib (at least the
>>> version in Sage), is not respecting CXX properly. I specified CC as 
>>> the Sun
>>> C compiler, and CXX as the Sun C++ compiler. The code then tries to 
>>> build a
>>> C++ file (src/ft2font.cpp) with the Sun C compiler, which fails.
>>>
>>> /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
>>>
>>> I've not looked at this in detail, so it could be a Sage-specific issue.
>>> 
>>
>> I forwarded the original message on to matplotlib-devel.  It would be
>> helpful if when replying to this message or any in this thread if we
>> CC the matplotlib-devel mailing list.  I'm the list moderator so I can
>> approve these messages and you won't need to subscribe.  I don't have
>> any immediate answers for you now, but hopefully we can come up with
>> some.
>>
>> JDH
>>
>> --
>>  
>>
>> Come build with us! The BlackBerry® Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and 
>> stay ahead of the curve. Join us from November 9-12, 2009. 
>> Register now!
>> http://p.sf.net/sfu/devconf
>> ___
>> Matplotlib-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>   
> 


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread William Stein
On Mon, Sep 28, 2009 at 4:54 AM, John Hunter  wrote:
> On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby
>  wrote:
>> William Stein wrote:
>>>
>>> Hi,
>>>
>>> I spent several hours yesterday trying to get matplotlib for Sage to
>>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>>> another test machine (bsd.math) the workaround from my laptop doesn't
>>> work.  So at this point Sage still does not support OS X 10.6.
>>
>>
>> Just to add (which I've also CC'ed to John), mathplotlib (at least the
>> version in Sage), is not respecting CXX properly. I specified CC as the Sun
>> C compiler, and CXX as the Sun C++ compiler. The code then tries to build a
>> C++ file (src/ft2font.cpp) with the Sun C compiler, which fails.
>>
>> /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
>>
>> I've not looked at this in detail, so it could be a Sage-specific issue.
>
> I forwarded the original message on to matplotlib-devel.  It would be
> helpful if when replying to this message or any in this thread if we
> CC the matplotlib-devel mailing list.  I'm the list moderator so I can
> approve these messages and you won't need to subscribe.  I don't have
> any immediate answers for you now, but hopefully we can come up with
> some.

If you could just try running your matplotlib build on
bsd.math.washington.edu and reporting about whether or not it works,
that would be very helpful, since it will indicate whether the problem
is somehow in Sage or in pyCXX or Matplotlib itself or something else.

 -- William

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Fwd: OS X 10.6 port

2009-09-28 Thread William Stein
On Mon, Sep 28, 2009 at 8:47 AM, John Hunter  wrote:
> -- Forwarded message --
> From: Tony S Yu 
> Date: Mon, Sep 28, 2009 at 8:41 AM
> Subject: Re: [matplotlib-devel] Fwd: OS X 10.6 port
> To: John Hunter 
> Cc: matplotlib development list 
>
>
>
> On Sep 28, 2009, at 2:14 AM, John Hunter wrote:
>
>> in case anyone has some suggestions, I'm forwarding this from the sage list
>>
>>
>> -- Forwarded message --
>> From: William Stein 
>> Date: Sun, Sep 27, 2009 at 10:51 PM
>> Subject: OS X 10.6 port
>> To: sage-devel , John Hunter 
>>
>>
>> Hi,
>>
>> I spent several hours yesterday trying to get matplotlib for Sage to
>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>> another test machine (bsd.math) the workaround from my laptop doesn't
>> work.  So at this point Sage still does not support OS X 10.6.
>>
>> The problem is in matplotlib's C++ wrapper for freetype2.  It's a
>> Python extension module implemented directly in C++, and it simply
>> doesn't work correctly at all.  For example, whenever it tries to
>> raise a Python exception, it just terminates Python with
>>
>> "11713 Abort trap              sage-ipython "$@" -i"

The stack trace looks like this:

#4  0x00010cd907e2 in ~PythonExtension [inlined] () at
/Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Extensions.hxx:778
#5  0x00010cd907e2 in FT2Font::FT2Font (this=0x10baf2b10,
facefi...@0x10bab6da0) at src/ft2font.cpp:778
#6  0x00010cd90e98 in ft2font_module::new_ft2font (this=, args=) at src/ft2font.cpp:778
#7  0x00010cd94912 in
Py::ExtensionModule::invoke_method_varargs
(this=0x10ce05f10, na...@0x7fff5fbf7030, ar...@0x7fff5fbf6fe0) at
Extensions.hxx:422
#8  0x00010cda3190 in method_varargs_call_handler
(_self_and_name_tuple=, _args=) at CXX/cxx_extensions.cxx:1403
...


> I thought I'd chime in since I recently upgraded to OSX 10.6. I don't
> think I ever got this error, so I probably didn't have the same issue,
> but just in case...
>
> I reinstalled freetype2, but I'm not sure if I needed to. I also made
> a change to setupext.py so that the setup script could find freetype2,
> but this doesn't seem to be your problem because your errors don't
> occur during the build.
>
> Did you happen to build on top of an old install? I had to clean out
> the old compiled extensions before everything would build properly. I
> had to clean out the build directory (obviously), but there are also
> *.so files in lib/matplotlib and lib/matplotlib/backends.
>
> I should note that I'm built on top of the system python (2.6.1) and I
> did not use make.osx.
>

I did a 100% clean build from source of Sage, which means building
Python and essentially all dependencies (including freetype) in a
single self-contained directory.I've replicated this on maybe 5 or
6 different OS X 10.6 machines.  It is a total show stopper for
releasing the next version of Sage, and is in fact the only problem
left (of many) in porting Sage to OS X 10.6

I used the latest version of XCode, which comes with OS X 10.6:
  gcc version 4.2.1 (Apple Inc. build 5646)

The version of Python  is:
Python 2.6.2 (r262:71600, Sep 27 2009, 13:41:53)

The Abort trap appears when building the font cache the moment an
exception is raised in C++ code.  By hacking around that exception
getting raised, the Abort trap happens when some exception somewhere
else happens in Matplotlib's C++ code.  Etc.

I'm going to try looking into pyCXX now, since that seems the best hope.

William

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Fwd: OS X 10.6 port

2009-09-28 Thread William Stein
On Mon, Sep 28, 2009 at 8:55 AM, William Stein  wrote:
> On Mon, Sep 28, 2009 at 8:47 AM, John Hunter  wrote:
>> -- Forwarded message --
>> From: Tony S Yu 
>> Date: Mon, Sep 28, 2009 at 8:41 AM
>> Subject: Re: [matplotlib-devel] Fwd: OS X 10.6 port
>> To: John Hunter 
>> Cc: matplotlib development list 
>>
>>
>>
>> On Sep 28, 2009, at 2:14 AM, John Hunter wrote:
>>
>>> in case anyone has some suggestions, I'm forwarding this from the sage list
>>>
>>>
>>> -- Forwarded message --
>>> From: William Stein 
>>> Date: Sun, Sep 27, 2009 at 10:51 PM
>>> Subject: OS X 10.6 port
>>> To: sage-devel , John Hunter 
>>> 
>>>
>>>
>>> Hi,
>>>
>>> I spent several hours yesterday trying to get matplotlib for Sage to
>>> work on OS X 10.6.  On my laptop everything works perfectly, but on
>>> another test machine (bsd.math) the workaround from my laptop doesn't
>>> work.  So at this point Sage still does not support OS X 10.6.
>>>
>>> The problem is in matplotlib's C++ wrapper for freetype2.  It's a
>>> Python extension module implemented directly in C++, and it simply
>>> doesn't work correctly at all.  For example, whenever it tries to
>>> raise a Python exception, it just terminates Python with
>>>
>>> "11713 Abort trap              sage-ipython "$@" -i"
>
> The stack trace looks like this:
>
> #4  0x00010cd907e2 in ~PythonExtension [inlined] () at
> /Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Extensions.hxx:778
> #5  0x00010cd907e2 in FT2Font::FT2Font (this=0x10baf2b10,
> facefi...@0x10bab6da0) at src/ft2font.cpp:778
> #6  0x00010cd90e98 in ft2font_module::new_ft2font (this= temporarily unavailable, due to optimizations>, args= temporarily unavailable, due to optimizations>) at src/ft2font.cpp:778
> #7  0x00010cd94912 in
> Py::ExtensionModule::invoke_method_varargs
> (this=0x10ce05f10, na...@0x7fff5fbf7030, ar...@0x7fff5fbf6fe0) at
> Extensions.hxx:422
> #8  0x00010cda3190 in method_varargs_call_handler
> (_self_and_name_tuple= optimizations>, _args= optimizations>) at CXX/cxx_extensions.cxx:1403
> ...
>
>
>> I thought I'd chime in since I recently upgraded to OSX 10.6. I don't
>> think I ever got this error, so I probably didn't have the same issue,
>> but just in case...
>>
>> I reinstalled freetype2, but I'm not sure if I needed to. I also made
>> a change to setupext.py so that the setup script could find freetype2,
>> but this doesn't seem to be your problem because your errors don't
>> occur during the build.
>>
>> Did you happen to build on top of an old install? I had to clean out
>> the old compiled extensions before everything would build properly. I
>> had to clean out the build directory (obviously), but there are also
>> *.so files in lib/matplotlib and lib/matplotlib/backends.
>>
>> I should note that I'm built on top of the system python (2.6.1) and I
>> did not use make.osx.
>>
>
> I did a 100% clean build from source of Sage, which means building
> Python and essentially all dependencies (including freetype) in a
> single self-contained directory.    I've replicated this on maybe 5 or
> 6 different OS X 10.6 machines.  It is a total show stopper for
> releasing the next version of Sage, and is in fact the only problem
> left (of many) in porting Sage to OS X 10.6
>
> I used the latest version of XCode, which comes with OS X 10.6:
>  gcc version 4.2.1 (Apple Inc. build 5646)
>
> The version of Python  is:
>        Python 2.6.2 (r262:71600, Sep 27 2009, 13:41:53)
>
> The Abort trap appears when building the font cache the moment an
> exception is raised in C++ code.  By hacking around that exception
> getting raised, the Abort trap happens when some exception somewhere
> else happens in Matplotlib's C++ code.  Etc.
>
> I'm going to try looking into pyCXX now, since that seems the best hope.
>

I rebuild matplotlib using the newest version of pyCXX (which has seen
4 new releases since the version in matplotlib), but the problem
remains the same.  (I've also tried using the latest version of
libfreetype.)

bash-3.2$ python
Python 2.6.2 (r262:71600, Sep 27 2009, 13:41:53)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab
Abort trap

-

(gdb) bt
#0  0x7fff82adf096 in __kill ()
#1  0x7fff82b800c2 in abort ()
#2  0x0001015d0d51 in uw_init_context_1 ()
#3  0x0001015d14cc in _Unwind_Resume ()
#4  0x00010182f7f3 in ~PythonExtension [inlined] () at
/Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Python2/ExtensionOldType.hxx:778
#5  0x00010182f7f3 in FT2Font::FT2Font (this=0x101171620,
facefi...@0x7fff5fbf74c0) at src/ft2font.cpp:778
#6  0x00010182fee8 in ft2font_module::new_ft2font (this=, args=) at src/ft2font.cpp:778
#7  0x000101830a80 in
Py::ExtensionModule::invoke_method_varargs
(this=,
method_def=,
args=) at
ExtensionModule.hxx:184
#8  0x00010183f8d0 in method_varargs_call_h

Re: [matplotlib-devel] [sage-devel] PyCXX, Matplotlib and OS X 10.6

2009-09-28 Thread William Stein
On Mon, Sep 28, 2009 at 9:14 AM, John Hunter  wrote:
> On Mon, Sep 28, 2009 at 10:48 AM, William Stein  wrote:
>> If you could just try running your matplotlib build on
>> bsd.math.washington.edu and reporting about whether or not it works,
>> that would be very helpful, since it will indicate whether the problem
>> is somehow in Sage or in pyCXX or Matplotlib itself or something else.
>
> I was able to build into a mostly clean environment (rebuild all deps
> zlip, freetype, png) using my OSX make file in, but I had to update
> the MACOSX_DEPLOYMENT_TARGET  to 10.6 (I've committed this to svn
> HEAD).
>
>
>  PREFIX=~/devtest make -f make.osx fetch deps mpl_build mpl_install
>
> But even simple tests are failing with::
>
> jdh2...@bsd:~> LD_LIBRARY_PATH=~/devtest/lib/
> PYTHONPATH=~/devtest/lib/python2.6/site-packages/ /usr/bin/python -c
> 'import matplotlib; matplotlib.use("Agg"); from matplotlib.pyplot
> import *; plot([1,2,3]); savefig("test")'
> Traceback (most recent call last):
>  File "", line 1, in 
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py",
> line 7, in 
>    from matplotlib.figure import Figure, figaspect
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py",
> line 16, in 
>    import artist
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py",
> line 6, in 
>    from transforms import Bbox, IdentityTransform, TransformedBbox,
> TransformedPath
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py",
> line 34, in 
>    from matplotlib._path import affine_transform
> ImportError: 
> /Users/jdh2358/devtest/lib/python2.6/site-packages/matplotlib/_path.so:
> no appropriate 64-bit architecture (see "man python" for running in
> 32-bit mode)
>
> I'm attaching my build output in case anyone sees anything that might
> be triggering this 32bit/64bit problem (see attached for full output).
>  I did not rebuild numpy and this may be the problem since the failure
> is in the _path module.  I'll give that a try next

I think it's definitely an issue with PyCXX.   I installed the latest
version of PyCXX and tried their test example program, and got the
dreaded "Abort trap":

bash-3.2$ python
Python 2.6.2 (r262:71600, Sep 27 2009, 13:41:53)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import CXX.example
CXX is installed.
The support files you need are in the PYTHON/etc/CXX directory.
The include files are in the distutils include path already.
Just refer to them as "CXX/CXX_Objects.h", etc.

range object created 0x1003140b0
range object destroyed 0x1003140b0
>>> CXX.example.test()
Example Test starting
Trying to convert a NULL to an Py::Int
Abort trap
bash-3.2$ pwd
/Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/pycxx-6.1.1/Demo/Python2



Note that installing PyCXX and their test program was not easy.  I
watched their "python setup.py install" fail repeatedly, then I would
copy missing files where they should go, and iterate (about 6 times


I've cc'd the PyCXX maintainer Barry Scott.  Barry, do you have access
to an OS X 10.6 install, since it seems PyCXX is broken there?  If
not, I can give you an account on a machine at University of
Washington.   PyCXX is the single component of Sage
(http://sagemath.org) that is holding us back from finishing the OS X
10.6 port.

 -- William

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread John Hunter
On Mon, Sep 28, 2009 at 11:14 AM, John Hunter  wrote:

> But even simple tests are failing with::
>
> jdh2...@bsd:~> LD_LIBRARY_PATH=~/devtest/lib/
> PYTHONPATH=~/devtest/lib/python2.6/site-packages/ /usr/bin/python -c
> 'import matplotlib; matplotlib.use("Agg"); from matplotlib.pyplot
> import *; plot([1,2,3]); savefig("test")'
> Traceback (most recent call last):
>  File "", line 1, in 
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py",
> line 7, in 
>    from matplotlib.figure import Figure, figaspect
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py",
> line 16, in 
>    import artist
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py",
> line 6, in 
>    from transforms import Bbox, IdentityTransform, TransformedBbox,
> TransformedPath
>  File 
> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py",
> line 34, in 
>    from matplotlib._path import affine_transform
> ImportError: 
> /Users/jdh2358/devtest/lib/python2.6/site-packages/matplotlib/_path.so:
> no appropriate 64-bit architecture (see "man python" for running in
> 32-bit mode)
>
> I'm attaching my build output in case anyone sees anything that might
> be triggering this 32bit/64bit problem (see attached for full output).
>  I did not rebuild numpy and this may be the problem since the failure
> is in the _path module.  I'll give that a try next


Same issue with numpy HEAD

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [sage-devel] OS X 10.6 port

2009-09-28 Thread William Stein
On Mon, Sep 28, 2009 at 9:35 AM, John Hunter  wrote:
> On Mon, Sep 28, 2009 at 11:14 AM, John Hunter  wrote:
>
>> But even simple tests are failing with::
>>
>> jdh2...@bsd:~> LD_LIBRARY_PATH=~/devtest/lib/
>> PYTHONPATH=~/devtest/lib/python2.6/site-packages/ /usr/bin/python -c
>> 'import matplotlib; matplotlib.use("Agg"); from matplotlib.pyplot
>> import *; plot([1,2,3]); savefig("test")'
>> Traceback (most recent call last):
>>  File "", line 1, in 
>>  File 
>> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py",
>> line 7, in 
>>    from matplotlib.figure import Figure, figaspect
>>  File 
>> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py",
>> line 16, in 
>>    import artist
>>  File 
>> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py",
>> line 6, in 
>>    from transforms import Bbox, IdentityTransform, TransformedBbox,
>> TransformedPath
>>  File 
>> "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py",
>> line 34, in 
>>    from matplotlib._path import affine_transform
>> ImportError: 
>> /Users/jdh2358/devtest/lib/python2.6/site-packages/matplotlib/_path.so:
>> no appropriate 64-bit architecture (see "man python" for running in
>> 32-bit mode)
>>
>> I'm attaching my build output in case anyone sees anything that might
>> be triggering this 32bit/64bit problem (see attached for full output).
>>  I did not rebuild numpy and this may be the problem since the failure
>> is in the _path module.  I'll give that a try next
>
>
> Same issue with numpy HEAD

One thing to keep in mind is that the default for GCC on OS X 10.6 is
to build 64-bit binaries.   With OS X 10.5 the default for GCC was to
make 32-bit binaries.  (To get 64-bit you used to have to do "-m64",
but that is now the default.)   So you really have to start from
scratch.

 -- William

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Comparing pdf output in tests

2009-09-28 Thread Jouni K . Seppänen
Jouni K. Seppänen  writes:

> I committed something based on this, and a new rc parameter
> savefig.extension that sets the filename extension when you call savefig
> with a bare filename. The pdf tests seem to be working, at least for me,
> but I am sure that the code can be improved.

The buildbot was getting errors, since the build environments don't have
gs. I changed the tests so that this isn't an error. It might be better
to make it a known fail, but is it possible for the image comparison
decorator to turn one test function into several cases? I.e., the png
case could be pass/fail, and the pdf case a known fail if there is no
Ghostscript.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel