Hi everyone,

I am trying to build the latest svn trunk version of MPL on OS X 10.5.  I am getting the following error:

ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file is not of required architecture for architecture ppc

After googling quite a bit, this seems to be quite a common problem.  However, I could still not find an unambiguous solution.  I have build libpng from source on my machine.  The file output is:
laserson@hobbes:/usr/local/lib$ file libpng*
libpng.3.dylib:   Mach-O dynamically linked shared library i386
libpng.a:         current ar archive random library
libpng.dylib:     Mach-O dynamically linked shared library i386
libpng.la:        ASCII English text
libpng12.0.dylib: Mach-O dynamically linked shared library i386
libpng12.a:       current ar archive random library
libpng12.dylib:   Mach-O dynamically linked shared library i386
libpng12.la:      ASCII English text

It appears that the compiler expects that libpng will also have libraries for ppc.  What do I do?  Do I need to rebuild libpng to be universal?  (How is this done?)  Or do I need to somehow tell distutils to build MPL only for i386?  (How is thid done?)

Below is the full build output.  Thanks for your help!

Uri

============================================================================
BUILDING MATPLOTLIB
            matplotlib: 0.98.6svn
                python: 2.5.2 |EPD with Py2.5 4.0.30002 | (r252:60911, Oct
                        15 2008, 16:58:38)  [GCC 4.0.1 (Apple Computer, Inc.
                        build 5370)]
              platform: darwin

REQUIRED DEPENDENCIES
                 numpy: 1.3.0
             freetype2: 9.20.3

OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.2.34
               Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
              wxPython: 2.8.7.1
                        * WxAgg extension not required for wxPython >= 2.8
                  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
                 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: 1.4
                  pytz: 2008c

OPTIONAL USETEX DEPENDENCIES
                dvipng: 1.11
           ghostscript: 8.62
                 latex: 3.1415926

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.delaunay']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.3-i386-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.macosx-10.3-i386-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.backends._tkagg' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o build/temp.macosx-10.3-i386-2.5/src/_tkagg.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk
ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libfreetype.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/Ln/LnyDoYbfGd8tkbnxDCl7Zk+++TI/-Tmp-//ccHqlli7.out (No such file or directory)
error: command 'g++' failed with exit status 1


--
Uri Laserson
PhD Candidate, Biomedical Engineering
Harvard Medical School (Genetics)
Massachusetts Institute of Technology (Mathematics)
phone +1 917 742 8019
laserson@mit.edu