Numpy, Scipy, Matplotlib rebuild recipie (Leopard)

The steps I used to refresh the trinity of python packages goes something like:
Nuke all old versions. *ALL* old versions! Fortune favours the bold – of course it will work!

svn co http://svn.scipy.org/svn/numpy/trunk numpy
cd numpy
python setup.py build
sudo python setup.py install


svn co http://svn.scipy.org/svn/scipy/trunk scipy

or just svn update if I’m feeling lazy. Then in the scipy source directory,

setenv MACOSX_DEPLOYMENT_TARGET 10.5
python setup.py build_src build_clib --fcompiler=gnu95 build_ext --fcompiler=gnu95 build
sudo python setup.py install

Not sure if the deployment target variable works for 10.5, but it seems logical.

Then get the matplotlib egg (it was a pita to build the first time so screw that). You may need to rename it (to the name below), otherwise it might try to download and build everything, which is ok if you have the spare time and patience to troubleshoot the build process.

sudo easy_install matplotlib-0.98.0-py2.5.egg

Matplotlib is not much good in the atmospheric sciences without Basemap. /opt/local is for macports, so the Geos library can just live in /opt. Basemap documentation. Setting GEOS_DIR didn’t seem to help Basemap find the library (I seem to remember having this problem with another python package, CDAT probably), so I had to add it manually to setup.py

Warning!

These notes are for me, for quality advice always use the documentation provided by the tool distributors and the mailing lists. To do: build optimised atlas, lapack etc and configure scipy to use these.
http://www.scipy.org/Installing_SciPy/Mac_OS_X

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: