Error compiling agg.cxx on Mac OS X, python 2.5b2

I’m trying out the brand new python2.5b2. One of the reasons I am excited to upgrade is that ctypes are included in the new python, and this is pretty hard to get going by hand on the intel Macs because of an absent libffi. I get

error: invalid conversion from ‘const char*’ to ‘char’

when trying to compile matplotlib on my intel Mac with python 2.5b2. I don’t get a similar error with python 2.4.x. The full output is attached below. I tried to recompile agg.cxx with swig (recompiled to link with python 2.5b2) using this command

python makeswig.py

and I get the same error. BTW, numpy compiles without any complaints, and seems to work just fine. Any ideas?

-Rob

[…copying…]

running build_ext

building ‘matplotlib._isnan’ extension

C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3

creating build/temp.macosx-10.3-fat-2.5

creating build/temp.macosx-10.3-fat-2.5/src

compile options: ‘-I/usr/local/include -I/usr/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c’

gcc: src/_isnan.c

In file included from /usr/include/math.h:26,

from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:200,

from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,

from src/_isnan.c:1:

/usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function ‘scalb’

gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/_isnan.o -L/usr/local/lib -L/usr/lib -o build/lib.macosx-10.3-fat-2.5/matplotlib/_isnan.so

building ‘matplotlib._agg’ extension

C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3

creating build/temp.macosx-10.3-fat-2.5/agg23

creating build/temp.macosx-10.3-fat-2.5/agg23/src

compile options: ‘-Iagg23/include -Isrc -Iswig -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c’

gcc: agg23/src/agg_rasterizer_scanline_aa.cpp

gcc: agg23/src/agg_curves.cpp

gcc: agg23/src/agg_trans_affine.cpp

gcc: agg23/src/agg_vcgen_dash.cpp

gcc: agg23/src/agg_bezier_arc.cpp

gcc: src/agg.cxx

src/agg.cxx: In function ‘int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)’:

src/agg.cxx:2051: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)’:

src/agg.cxx:2051: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’:

src/agg.cxx:31756: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’:

src/agg.cxx:31756: error: invalid conversion from ‘const char*’ to ‘char*’

lipo: can’t figure out the architecture type of: /var/tmp//ccBRU9rF.out

src/agg.cxx: In function ‘int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)’:

src/agg.cxx:2051: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)’:

src/agg.cxx:2051: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’:

src/agg.cxx:31756: error: invalid conversion from ‘const char*’ to ‘char*’

src/agg.cxx: In function ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’:

src/agg.cxx:31756: error: invalid conversion from ‘const char*’ to ‘char*’

lipo: can’t figure out the architecture type of: /var/tmp//ccBRU9rF.out

error: Command “gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Iagg23/include -Isrc -Iswig -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/agg.cxx -o build/temp.macosx-10.3-fat-2.5/src/agg.o” failed with exit status 1

···

Rob Hetland, Assistant Professor

Dept. of Oceanography, Texas A&M University

http://pong.tamue.edu/~rob

phone: 979-458-0096, fax: 979-845-6331