building from SVN on Mac OS X 10.5

Thanks for posting that Ariel (and thanks to everyone else who pitched in). I was finally able to install the svn trunk successfully. I will say that I still had a build problem which was probably due to my libpng version. To solve it, I rebuilt libpng in /usr/local/ and explicitly pointed the build to it by modifying Ariels directions:

CFLAGS=-Os -arch i386 -I/usr/local/include/libpng12
LDFLAGS=-Os -arch i386 -L/usr/local/lib

and I set the ‘darwin’ key in to ‘/usr/local’

I also manually deleted the python egg I had leftover from the EPD installation.

I am not sure which of these things actually fixed the problem, but I can finally successfully plot.



---------- Forwarded message ----------
From: Ariel Rokem <arokem@…453…>

To: John Hunter <jdh2358@…714…>
Date: Sat, 22 Aug 2009 12:48:41 -0700
Subject: Re: [matplotlib-devel] building from SVN on Mac OS X 10.5
Hi folks -

just to add to the noise. Here is what eventually worked for me (with

OS 10.5.8 and EPD 4.3), with help from Mike McKerns:

  1. I removed the ~/.matplotlib folder (“rm -rf ~/.matplotlib”).

  2. I edited /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile,

removing all occurrences of “-arch ppc” (3 occurrences), changing the


“MACOSX_DEPLOYMENT_TARGET=10.5” and changing the occurrences of

“MacOSX10.54u.sdk” into “MacOSX10.5.sdk” (3 occurrences). Here is the

full diff:


< BASECFLAGS= -arch i386 -isysroot MacOSX10.5.sdk -fno-strict-aliasing

-Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic

BASECFLAGS= -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


< LDFLAGS= -arch i386 -isysroot MacOSX10.5.sdk -g -L/usr/local/lib


LDFLAGS= -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/4.3.0/lib








< (CC) -o (LDLIBRARY) -arch i386 -dynamiclib \

          $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
  1. In /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/easy-install.pth,

I commented out the line containing the directory in which the

previous version of MPL was installed

(“./matplotlib-”, in my case). If

I don’t do this, when I import matplotlib, it imports the previous

version I had of MPL and just ignores the new installation. This is a

setuptools problem, so if you didn’t have setuptools, good for you and

ignore this.

  1. I ran the attached shell-script (“sh ./”),

based on a script by Mike McKerns, in the directory in which I wanted

my source to be. This script sets some local variable (CFLAGS,

LDFLAGS, PKG_CONFIG_PATH, ARCHFLAGS), removes previous installations,

downloads the source, builds and installs it. The backend seems to be

set to MacOSX.

I would be happy if someone who’s had similar problems to the ones I

have had could test this procedure and see if it works for them as




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