Compiler error on OS X 10.5.2 in agg

Hello,

I just tried to compile the SVN head of matplotlib (r4994) from source on OS X 10.5.2 (with source builds of python 2.5.2 and the SVN head of numpy), and ran into an "internal compiler error" in the agg code. (pkgconfig 0.23 and wxPython 2.8.7.1 also present and accounted for.)

Here's the compile line and error:

building 'matplotlib.backends._backend_agg' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -I/usr/X11/include/libpng12 -I/usr/local/include -I/usr/include -I/usr/X11R6/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/local/include -I/usr/include -I/usr/X11R6/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/_image.cpp -o build/temp.macosx-10.4-i386-2.5/src/_image.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
src/_image.cpp: In member function ‘Py::Object _image_module::from_images(const Py::Tuple&)’:
src/_image.cpp:842: error: insn does not satisfy its constraints:
(insn 2573 1070 2574 126 agg24/include/agg_color_rgba.h:268 (set (mem:QI (plus:SI (reg/f:SI 6 bp)
               (const_int -280 [0xfffffffffffffee8])) [0 SR.2969+0 S1 A8])
       (reg:QI 5 di)) 56 {*movqi_1} (nil)
   (nil))
src/_image.cpp:842: internal compiler error: in reload_cse_simplify_operands, at postreload.c:391
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

This seems to be an agg and OS X error; it's cropped up here:
http://trac.osgeo.org/mapserver/ticket/2368
and John Hunter reported it on the agg list here:
http://article.gmane.org/gmane.comp.graphics.agg/3963

Unfortunately, the error appears to either not have been fixed by the 10.5.1 update, as suggested in the email thread cited above, or the error re-appeared in 10.5.2.

Changing the optimization flag from -O3 to -Os and compiling _image.cpp manually (along with copying src/_image.cpp to src/image.cpp and compiling that manually in the same way) allowed me to finish building matplotlib, but clearly an optimized agg image library is pretty important... (-O2 didn't work...)

Anyone have any idea at all about this error? Or is just turning off -O3 for this file the best thing to do until Apple fixes the compiler bug? Does anyone who knows more about agg than I want to try to reduce this to a test case?

Zach Pincus

Postdoctoral Fellow
Molecular, Cellular, and Developmental Biology
Yale University

For what it's worth, the standalone agg 2.4 library compiles just fine on my system -- this problem seems to be some sort of matplotlib / agg interaction.

Zach

···

On Mar 9, 2008, at 11:35 PM, Zachary Pincus wrote:

Hello,

I just tried to compile the SVN head of matplotlib (r4994) from source
on OS X 10.5.2 (with source builds of python 2.5.2 and the SVN head of
numpy), and ran into an "internal compiler error" in the agg code.
(pkgconfig 0.23 and wxPython 2.8.7.1 also present and accounted for.)

Here's the compile line and error:

building 'matplotlib.backends._backend_agg' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
madd -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
prototypes -I/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/numpy/core/include -I/usr/X11/include/
libpng12 -I/usr/local/include -I/usr/include -I/usr/X11R6/include -
I. -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/usr/
X11/include/freetype2 -I/usr/X11/include -I/usr/local/include -I/usr/
include -I/usr/X11R6/include -I. -I/Library/Frameworks/
Python.framework/Versions/2.5/include/python2.5 -c src/_image.cpp -o
build/temp.macosx-10.4-i386-2.5/src/_image.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for C/ObjC but not for C++
src/_image.cpp: In member function ‘Py::Object
_image_module::from_images(const Py::Tuple&)’:
src/_image.cpp:842: error: insn does not satisfy its constraints:
(insn 2573 1070 2574 126 agg24/include/agg_color_rgba.h:268 (set
(mem:QI (plus:SI (reg/f:SI 6 bp)
              (const_int -280 [0xfffffffffffffee8])) [0 SR.2969+0
S1 A8])
      (reg:QI 5 di)) 56 {*movqi_1} (nil)
  (nil))
src/_image.cpp:842: internal compiler error: in
reload_cse_simplify_operands, at postreload.c:391
Please submit a full bug report, with preprocessed source if
appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

This seems to be an agg and OS X error; it's cropped up here:
http://trac.osgeo.org/mapserver/ticket/2368
and John Hunter reported it on the agg list here:
http://article.gmane.org/gmane.comp.graphics.agg/3963

Unfortunately, the error appears to either not have been fixed by the
10.5.1 update, as suggested in the email thread cited above, or the
error re-appeared in 10.5.2.

Changing the optimization flag from -O3 to -Os and compiling
_image.cpp manually (along with copying src/_image.cpp to src/
image.cpp and compiling that manually in the same way) allowed me to
finish building matplotlib, but clearly an optimized agg image library
is pretty important... (-O2 didn't work...)

Anyone have any idea at all about this error? Or is just turning off -
O3 for this file the best thing to do until Apple fixes the compiler
bug? Does anyone who knows more about agg than I want to try to reduce
this to a test case?

Zach Pincus

Postdoctoral Fellow
Molecular, Cellular, and Developmental Biology
Yale University

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users