From: John H. <jd...@gm...> - 2009-09-28 06:15:08
|
in case anyone has some suggestions, I'm forwarding this from the sage list ---------- Forwarded message ---------- From: William Stein <ws...@gm...> Date: Sun, Sep 27, 2009 at 10:51 PM Subject: OS X 10.6 port To: sage-devel <sag...@go...>, John Hunter <jd...@gm...> 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'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. William -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org |
From: John H. <jd...@gm...> - 2009-09-28 11:54:32
|
On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby <dav...@on...> 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 |
From: Michael D. <md...@st...> - 2009-09-28 13:59:49
|
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 > <dav...@on...> 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 > Mat...@li... > 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 |
From: Michael D. <md...@st...> - 2009-09-28 14:06:43
|
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 > <dav...@on...> 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 > Mat...@li... > 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 |
From: Dr. D. K. <dav...@on...> - 2009-09-28 15:13:40
|
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 >> <dav...@on...> 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 >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> > |
From: William S. <ws...@gm...> - 2009-09-28 15:48:39
|
On Mon, Sep 28, 2009 at 4:54 AM, John Hunter <jd...@gm...> wrote: > On Mon, Sep 28, 2009 at 4:47 AM, Dr. David Kirkby > <dav...@on...> 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 |
From: William S. <ws...@gm...> - 2009-09-28 15:56:11
|
On Mon, Sep 28, 2009 at 8:47 AM, John Hunter <jd...@gm...> wrote: > ---------- Forwarded message ---------- > From: Tony S Yu <ts...@gm...> > Date: Mon, Sep 28, 2009 at 8:41 AM > Subject: Re: [matplotlib-devel] Fwd: OS X 10.6 port > To: John Hunter <jd...@gm...> > Cc: matplotlib development list <mat...@li...> > > > > 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 <ws...@gm...> >> Date: Sun, Sep 27, 2009 at 10:51 PM >> Subject: OS X 10.6 port >> To: sage-devel <sag...@go...>, John Hunter <jd...@gm...> >> >> >> 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 0x000000010cd907e2 in ~PythonExtension [inlined] () at /Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Extensions.hxx:778 #5 0x000000010cd907e2 in FT2Font::FT2Font (this=0x10baf2b10, facefile=@0x10bab6da0) at src/ft2font.cpp:778 #6 0x000000010cd90e98 in ft2font_module::new_ft2font (this=<value temporarily unavailable, due to optimizations>, args=<value temporarily unavailable, due to optimizations>) at src/ft2font.cpp:778 #7 0x000000010cd94912 in Py::ExtensionModule<ft2font_module>::invoke_method_varargs (this=0x10ce05f10, name=@0x7fff5fbf7030, args=@0x7fff5fbf6fe0) at Extensions.hxx:422 #8 0x000000010cda3190 in method_varargs_call_handler (_self_and_name_tuple=<value temporarily unavailable, due to optimizations>, _args=<value temporarily unavailable, due to 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. William |
From: William S. <ws...@gm...> - 2009-09-28 16:07:40
|
On Mon, Sep 28, 2009 at 8:55 AM, William Stein <ws...@gm...> wrote: > On Mon, Sep 28, 2009 at 8:47 AM, John Hunter <jd...@gm...> wrote: >> ---------- Forwarded message ---------- >> From: Tony S Yu <ts...@gm...> >> Date: Mon, Sep 28, 2009 at 8:41 AM >> Subject: Re: [matplotlib-devel] Fwd: OS X 10.6 port >> To: John Hunter <jd...@gm...> >> Cc: matplotlib development list <mat...@li...> >> >> >> >> 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 <ws...@gm...> >>> Date: Sun, Sep 27, 2009 at 10:51 PM >>> Subject: OS X 10.6 port >>> To: sage-devel <sag...@go...>, John Hunter <jd...@gm...> >>> >>> >>> 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 0x000000010cd907e2 in ~PythonExtension [inlined] () at > /Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Extensions.hxx:778 > #5 0x000000010cd907e2 in FT2Font::FT2Font (this=0x10baf2b10, > facefile=@0x10bab6da0) at src/ft2font.cpp:778 > #6 0x000000010cd90e98 in ft2font_module::new_ft2font (this=<value > temporarily unavailable, due to optimizations>, args=<value > temporarily unavailable, due to optimizations>) at src/ft2font.cpp:778 > #7 0x000000010cd94912 in > Py::ExtensionModule<ft2font_module>::invoke_method_varargs > (this=0x10ce05f10, name=@0x7fff5fbf7030, args=@0x7fff5fbf6fe0) at > Extensions.hxx:422 > #8 0x000000010cda3190 in method_varargs_call_handler > (_self_and_name_tuple=<value temporarily unavailable, due to > optimizations>, _args=<value temporarily unavailable, due to > 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 0x00007fff82adf096 in __kill () #1 0x00007fff82b800c2 in abort () #2 0x00000001015d0d51 in uw_init_context_1 () #3 0x00000001015d14cc in _Unwind_Resume () #4 0x000000010182f7f3 in ~PythonExtension [inlined] () at /Users/was/build/sage-4.1.2.alpha4/spkg/build/matplotlib/trunk/matplotlib/CXX/Python2/ExtensionOldType.hxx:778 #5 0x000000010182f7f3 in FT2Font::FT2Font (this=0x101171620, facefile=@0x7fff5fbf74c0) at src/ft2font.cpp:778 #6 0x000000010182fee8 in ft2font_module::new_ft2font (this=<value temporarily unavailable, due to optimizations>, args=<value temporarily unavailable, due to optimizations>) at src/ft2font.cpp:778 #7 0x0000000101830a80 in Py::ExtensionModule<ft2font_module>::invoke_method_varargs (this=<value temporarily unavailable, due to optimizations>, method_def=<value temporarily unavailable, due to optimizations>, args=<value temporarily unavailable, due to optimizations>) at ExtensionModule.hxx:184 #8 0x000000010183f8d0 in method_varargs_call_handler (_self_and_name_tuple=<value temporarily unavailable, due to optimizations>, _args=<value temporarily unavailable, due to optimizations>) at CXX/cxx_extensions.cxx:1714 #9 0x00000001000b3b25 in PyEval_EvalFrameEx () #10 0x00000001000b4ce0 in PyEval_EvalCodeEx () #11 0x00000001000b2afd in PyEval_EvalFrameEx () #12 0x00000001000b4ce0 in PyEval_EvalCodeEx () |
From: John H. <jd...@gm...> - 2009-09-28 16:14:50
Attachments:
build.out
|
On Mon, Sep 28, 2009 at 10:48 AM, William Stein <ws...@gm...> 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:: jdh2358@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 "<string>", line 1, in <module> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py", line 7, in <module> from matplotlib.figure import Figure, figaspect File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py", line 16, in <module> import artist File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py", line 6, in <module> from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py", line 34, in <module> 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 jdh2358@bsd:mpl> head -30 build.out export PKG_CONFIG_PATH="/Users/jdh2358/devtest//lib/pkgconfig" &&\ export MACOSX_DEPLOYMENT_TARGET=10.6 &&\ export CFLAGS="-arch i386 -arch ppc -I/Users/jdh2358/devtest//include -I/Users/jdh2358/devtest//include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk" &&\ export LDFLAGS="-arch i386 -arch ppc -L/Users/jdh2358/devtest//lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk" &&\ python2.6 setup.py build ============================================================================ BUILDING MATPLOTLIB matplotlib: 1.0.svn python: 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] platform: darwin REQUIRED DEPENDENCIES numpy: 1.2.1 freetype2: found, but unknown version (no pkg-config) * WARNING: Could not find 'freetype2' headers in any * of '.', './freetype2'. OPTIONAL BACKEND DEPENDENCIES libpng: found, but unknown version (no pkg-config) * Could not find 'libpng' headers in any of '.' Tkinter: Tkinter: 67083, Tk: 8.5, Tcl: 8.5 wxPython: no * wxPython not found Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Mac OS X native: yes Qt: no Qt4: no |
From: John H. <jd...@gm...> - 2009-09-28 16:36:06
|
On Mon, Sep 28, 2009 at 11:14 AM, John Hunter <jd...@gm...> wrote: > But even simple tests are failing with:: > > jdh2358@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 "<string>", line 1, in <module> > File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py", > line 7, in <module> > from matplotlib.figure import Figure, figaspect > File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py", > line 16, in <module> > import artist > File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py", > line 6, in <module> > from transforms import Bbox, IdentityTransform, TransformedBbox, > TransformedPath > File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py", > line 34, in <module> > 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 |
From: William S. <ws...@gm...> - 2009-09-28 16:38:21
|
On Mon, Sep 28, 2009 at 9:35 AM, John Hunter <jd...@gm...> wrote: > On Mon, Sep 28, 2009 at 11:14 AM, John Hunter <jd...@gm...> wrote: > >> But even simple tests are failing with:: >> >> jdh2358@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 "<string>", line 1, in <module> >> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py", >> line 7, in <module> >> from matplotlib.figure import Figure, figaspect >> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py", >> line 16, in <module> >> import artist >> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py", >> line 6, in <module> >> from transforms import Bbox, IdentityTransform, TransformedBbox, >> TransformedPath >> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py", >> line 34, in <module> >> 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 |
From: Ondrej C. <on...@ce...> - 2010-04-13 02:11:09
|
On Mon, Sep 28, 2009 at 9:37 AM, William Stein <ws...@gm...> wrote: > > On Mon, Sep 28, 2009 at 9:35 AM, John Hunter <jd...@gm...> wrote: >> On Mon, Sep 28, 2009 at 11:14 AM, John Hunter <jd...@gm...> wrote: >> >>> But even simple tests are failing with:: >>> >>> jdh2358@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 "<string>", line 1, in <module> >>> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/pyplot.py", >>> line 7, in <module> >>> from matplotlib.figure import Figure, figaspect >>> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/figure.py", >>> line 16, in <module> >>> import artist >>> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/artist.py", >>> line 6, in <module> >>> from transforms import Bbox, IdentityTransform, TransformedBbox, >>> TransformedPath >>> File "/Users/jdh2358/devtest//lib/python2.6/site-packages/matplotlib/transforms.py", >>> line 34, in <module> >>> 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. I am now getting the exact same problem with pylab and FEMhub and Mac. I used http://sagemath.org/packages/standard/matplotlib-0.99.1.p4.spkg: ondrej@bsd:~/repos/femhub-0.9.9.beta3-mac(master)$ ./femhub ---------------------------------------------------------------------- | FEMhub Version 0.9.9.beta2, Release Date: 2010-04-02 | | Type lab() for the GUI. | ---------------------------------------------------------------------- In [1]: import pylab /Users/ondrej/repos/femhub-0.9.9.beta3-mac/local/lib/python2.6/site-packages/matplotlib/rcsetup.py:117: UserWarning: rcParams key "numerix" is obsolete and has no effect; please delete it from your matplotlibrc file warnings.warn('rcParams key "numerix" is obsolete and has no effect;\n' /Users/ondrej/repos/femhub-0.9.9.beta3-mac/local/bin/sage-sage: line 203: 28516 Abort trap sage-ipython "$@" -i It's using the "bsd" Mac machine from William, I guess the same as John was using above. Has anybody figured out a solution? Apparently Sage must work on the Mac, so it must be something different than just matplotlib? Some other package, that we have in femhub, but not in Sage, or some different version of something. Here is a list of packages that I have installed: ondrej@bsd:~/repos/femhub-0.9.9.beta3-mac(master)$ ./femhub -i Currently installed packages: blas-20070724 bzip2-1.0.5 cmake-2.6.2.p1 configobj-4.5.3 cython-0.12.1 dir-0.1 docutils-0.5.p0 femhub-lab-97141eb fipy-2.1-eb4aacf fortran-20071120.p8 freetype-2.3.5.p2 gnutls-2.2.1.p3 hermes2d-9bbfd39 ipython-bzr1174 jinja-1.2.p0 judy-1.0.5.p1 lapack-20071123.p1 libfemhub-78c07cb libgcrypt-1.4.3.p2 libgpg_error-1.6.p2 libpng-1.2.35.p0 matplotlib-0.99.1.p4 mayavi-3.3.1.p2 mesa-7.4.4.p3 numpy-1.3.0.p2 pexpect-2.0.p3 prereq-0.3 pygments-0.11.1.p0 pyparsing-1.5.2 pysparse-1.1-6301cea python-2.6.4.p7 python_gnutls-1.1.4.p7 readline-6.0 sage_scripts-3.4.2 scipy-0.7.p4 setuptools-0.6c9.p0 sfepy-2009.3 sphinx-0.6.3.p4 swig-1.3.36 sympy-5d78c29 termcap-1.3.1.p1 twisted-9.0.p2 vtk-cvs-20090316-minimal.p6 zlib-1.2.3.p5 Let me know if you have any hints what to try. Ondrej |
From: Friedrich R. <fri...@gm...> - 2011-11-12 20:13:15
|
Hi Ondrej, Good things last and take time. 2010/4/13 Ondrej Certik <on...@ce...>: > I am now getting the exact same problem with pylab and FEMhub and Mac. > I used http://sagemath.org/packages/standard/matplotlib-0.99.1.p4.spkg: It might a different problem than just architecture mismatch. But maybe I'm getting something wrong and misunderstand you. Michael, notice that 0.99.1 seems to the last version before your commit af9954d46e5 which introduces versioning of the fontcache. (It is not tagged in git, only the commit message reveals it: 8398d9bd2c47. I cannot see from http://trac.sagemath.org/sage_trac/ticket/7022 what happened between the sagemath matplotlib-0.99.1.p2.spkg to matplotlib-0.99.1.p4.spkg (patch 2 => patch 4). But the last post by jhpalmieri on that page might be related: "[...] But with my computer, "uname -r" returns "10.2.0", not "10.0.0". [...]" On my system it returns currently 10.8.0 (I think since it's OS X 10.6.8). > ondrej@bsd:~/repos/femhub-0.9.9.beta3-mac(master)$ ./femhub > ---------------------------------------------------------------------- > | FEMhub Version 0.9.9.beta2, Release Date: 2010-04-02 | > | Type lab() for the GUI. | > ---------------------------------------------------------------------- > In [1]: import pylab > /Users/ondrej/repos/femhub-0.9.9.beta3-mac/local/lib/python2.6/site-packages/matplotlib/rcsetup.py:117: > UserWarning: rcParams key "numerix" is obsolete and has no effect; > please delete it from your matplotlibrc file > warnings.warn('rcParams key "numerix" is obsolete and has no effect;\n' > /Users/ondrej/repos/femhub-0.9.9.beta3-mac/local/bin/sage-sage: line > 203: 28516 Abort trap sage-ipython "$@" -i > > It's using the "bsd" Mac machine from William, I guess the same as > John was using above. > > Has anybody figured out a solution? Apparently Sage must work on the > Mac, so it must be something different than just matplotlib? Can you please check if you do have /Library/Fonts/NISC18030.ttf on your system and maybe do a ``stat -f "%c" /Library/Fonts/NISC18030.ttf`` on it? For me, this one generates a Bus error (32bit) / Abort trap (64bit) on importing matplotlib.figure, for example. My issue is related to loading that font file I specified. It might a different font file for you and it might also be totally unrelated at all :-/ Or maybe you solved the problem in the meantime? Do you still have this machine? William, assumed he's William Stein, was the one who posted http://groups.google.com/group/sage-devel/browse_thread/thread/2c538915abc99946 in 2009, and who was able to partly track it down. >From the page http://trac.sagemath.org/sage_trac/ticket/7022 I see that exactly that font file was installed on it (probably). Thanks, Friedrich > Some > other package, that we have in femhub, but not in Sage, or some > different version of something. Here is a list of packages that I have > installed: > > ondrej@bsd:~/repos/femhub-0.9.9.beta3-mac(master)$ ./femhub -i > Currently installed packages: > blas-20070724 > bzip2-1.0.5 > cmake-2.6.2.p1 > configobj-4.5.3 > cython-0.12.1 > dir-0.1 > docutils-0.5.p0 > femhub-lab-97141eb > fipy-2.1-eb4aacf > fortran-20071120.p8 > freetype-2.3.5.p2 > gnutls-2.2.1.p3 > hermes2d-9bbfd39 > ipython-bzr1174 > jinja-1.2.p0 > judy-1.0.5.p1 > lapack-20071123.p1 > libfemhub-78c07cb > libgcrypt-1.4.3.p2 > libgpg_error-1.6.p2 > libpng-1.2.35.p0 > matplotlib-0.99.1.p4 > mayavi-3.3.1.p2 > mesa-7.4.4.p3 > numpy-1.3.0.p2 > pexpect-2.0.p3 > prereq-0.3 > pygments-0.11.1.p0 > pyparsing-1.5.2 > pysparse-1.1-6301cea > python-2.6.4.p7 > python_gnutls-1.1.4.p7 > readline-6.0 > sage_scripts-3.4.2 > scipy-0.7.p4 > setuptools-0.6c9.p0 > sfepy-2009.3 > sphinx-0.6.3.p4 > swig-1.3.36 > sympy-5d78c29 > termcap-1.3.1.p1 > twisted-9.0.p2 > vtk-cvs-20090316-minimal.p6 > zlib-1.2.3.p5 Looks ok. But I didn't check it in detail. I think it might be unrelated. |
From: Michael D. <md...@st...> - 2009-09-28 13:08:59
|
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 |
From: Tony S Yu <ts...@gm...> - 2009-09-28 14:13:10
|
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 <ws...@gm...> > Date: Sun, Sep 27, 2009 at 10:51 PM > Subject: OS X 10.6 port > To: sage-devel <sag...@go...>, John Hunter <jd...@gm... > > > > > 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 |