Problems building matplotlib on OSX Leopard

Hi All,

I've been compiling svn versions of matplotlib on OSX for quite a while with no (or few...) problems.

On upgrading to leopard on my mac pro, I've run into the
error messages below.

External libs are from fink. There seems to be some problem with attempts to build a universal binary.

Any ideas?

Andrew

   << ...removed... >>

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/usr/X11/lib -L/sw/lib/freetype2/lib -L/sw/lib/freetype219/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices,-framework,ApplicationServices
ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zy/zyE6hlZdE-S3suWR4ie8RE+++TI/-Tmp-//ccWqjNip.out (No such file or directory)
ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zy/zyE6hlZdE-S3suWR4ie8RE+++TI/-Tmp-//ccWqjNip.out (No such file or directory)
error: Command "g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/usr/X11/lib -L/sw/lib/freetype2/lib -L/sw/lib/freetype219/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices,-framework,ApplicationServices" failed with exit status 1

The error you are getting looks like libjpeg wasn't built as a
universal binary, and you *might* have success by setting the arch
flags, eg

export ARCHFLAGS="-arch i386"
export MACOSX_DEPLOYMENT_TARGET=10.5
export CFLAGS="-arch i386"
export LDFLAGS="-arch i386"
export CXXFLAGS="-arch i386"

but I tried in vein earlier to get a build respecting these flags
working (wasn't using fink though).

You might want to simply edit setupext.py to *remove* the /sw fink
paths, and follow the instructions

  http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes

and

  http://ipython.scipy.org/moin/Py4Science/InstallationOSX

Hope this helps,
JDH

···

On Dec 6, 2007 5:40 AM, Andrew Jaffe <a.h.jaffe@...287...> wrote:

Hi All,

I've been compiling svn versions of matplotlib on OSX for quite a while
with no (or few...) problems.

On upgrading to leopard on my mac pro, I've run into the
error messages below.

External libs are from fink. There seems to be some problem with
attempts to build a universal binary.