Bookmark and Share FiPy: A Finite Volume PDE Solver Using Python
Version 2.1.3

Previous topic

Installation

Next topic

Simple Windows Installation

This Page

Contact

FiPy developers
Jonathan Guyer
Daniel Wheeler
James Warren

Join our mailing list

100 Bureau Drive, M/S 6555
Gaithersburg, MD 20899

301-975-5329 Telephone
301-975-4553 Facsimile

Simple Mac OS X Installation

We present four comparatively simple routes to installing FiPy on Mac OS X. The Fink Installation procedure is appropriate if you are already familiar with the Fink package manager. Enthought Python Distribution will get FiPy running in a minumum number of steps. The Binary Installation procedure is the next most expedient if you have never heard of Fink or if you are not comfortable with it. Please see the more general Installation for detailed installation instructions. These instructions are not the only ways to set up FiPy on Mac OS X but represent the most expedient ways, from our experience, to have a usable installation up and running.

Attention

You must have an administrator account to install most of the following packages.

Enthought Python Distribution

http://www.enthought.com/epd

This installer provides a very large number of useful scientific packages for Python, including Python, NumPy, SciPy, Matplotlib, and IPython.

Attention

PySparse and FiPy are not presently included in EPD, so you will need to separately install them manually.

Binary Installation

Attention

Choose this method if you have never heard of Fink or if you are not comfortable with it for any reason. Binary installation is the fastest way to get FiPy up and running, but may offer less flexibility in the long run.

Pre-built binaries for many of the required packages are available at http://pythonmac.org/packages/py24-fat/.

Python

Python is pre-installed on Mac OS X, but installation of other packages is much easier if you upgrade to the latest version of python-2.4.X-XXXX-XX-XX.dmg` from pythonmac (or possibly some variant on Universal-MacPython-2.4.X-XXXX-XX-XX.dmg`). Your existing installation will not be harmed.

Note

Any command-line instructions that start with python will either need to be explicitly typed as /usr/local/bin/python or you will need to adjust your $path variable so that this version of python is found before the pre-installed version.

Note

Another option is ActivePython, which probably is the most heavily supported installation on the Mac, but seems to lack readline support, but these instructions

worked for us.

NumPy

Download and install the latest version of numpy-X.XX-py2.4-macosx10.4.mpkg.zip from pythonmac.

matplotlib

In order to see simulation results, you will need a viewer. We recommend you download and install the latest version of matplotlib-X.XX.X-py2.4-macosx10.4.mpkg.zip from pythonmac.

matplotlib requires:

wxPython

Download and install the latest version of wxPythonX.X-osx-unicode-X.X.X.X-universal10.4-py2.4.dmg from pythonmac.

PySparse

http://sourceforge.net/project/showfiles.php?group_id=101403

Download and install the latest version of pysparse-X.XX.XXX.macosx-10.4-py24.dmg

FiPy

http://www.ctcms.nist.gov/fipy/

Download and unpack the source archive (FiPy-x.y.tar.gz).

From within the FiPy directory, execute the command-line instruction:

$ python setup.py build
$ sudo python setup.py install

Note

You may now choose to install Optional Packages or you may choose proceed directly to Using FiPy on Mac OS X.

Fink Installation

Attention

Choose this method if you are already familiar with Fink or with Linux package managers in general (such as Debian packages or RPMs). Fink installation takes considerably longer than Binary Installation, but offers a wealth of other programs that can make it worthwhile.

The Fink package manager automatically handles the many intricate dependencies involved in building open source software. Fink is based on the Debian tools and the package manager model will be familiar to Linux users.

Xcode Development Tools

http://developer.apple.com/tools/xcode

Some required packages are not available from Fink as binaries, so you will need to have the developer tools for Mac OS X. They may already be installed in the /Developer/ directory, but a different version may be required by Fink; see the recommendations at http://fink.sourceforge.net/download

Note

Free registration with the Apple Developer Connection is required.

X11

Open the X11 application.

Set your DISPLAY environment variable to :0.0.

Note

If the X11 application is not already present in the /Applications/Utilities/ directory, it should be available as an optional package on the OS installation media that came with your computer.

Fink

http://fink.sourceforge.net/download

Ensure that Fink is installed and up to date for your OS.

Note

The following steps have been tested with Fink 0.8.1 on Mac OS X 10.4 “Tiger”. Variations may be necessary for other OS versions.

unstable tree

Follow the directions at http://www.finkproject.org/faq/usage-fink.php#unstable

Note

We recommend that you accept all defaults presented by fink selfupdate.

Note

“unstable” is not as scary as it sounds. The Fink administrators tend to be very conservative about what packages are designated “stable”.

Remaining Fink packages

Execute the following commands from Terminal application (you can use xterm or any other terminal application of your choosing):

$ fink --use-binary-dist install python

Take note of the version of Python that gets installed (python --version). Many other packages, indicated by a “-pyXX” suffix, require you substitute the Python version. E.g., Python 2.4 takes “-py24”, Python 2.5 takes “-py25”, and so on:

$ fink --use-binary-dist install matplotlib-pyXX

Attention

The matplotlib installation will automatically download and build a number of other packages. This process can take quite awhile. We recommend that you accept all defaults offered at the beginning of this process.

Note

If the installation of matplotlib-pyXX fails for some reason, we recommend you execute the install command again.

A few changes are needed to allow matplotlib to run:

$ mkdir ~/.matplotlib
$ curl http://matplotlib.sourceforge.net/_static/matplotlibrc \
> ~/.matplotlib/matplotlibrc

You may now choose to either edit the “backend” configuration in ~/.matplotlib/matplotlibrc to read:

backend      : TkAgg

or you can install wxPython with:

$ fink --use-binary-dist install wxpython-pyXX

(the second choice takes awhile, as it needs to build things).

PySparse installation

http://sourceforge.net/project/showfiles.php?group_id=101403

Download and unpack the latest version of pysparse-X.XX.XXX.tar.gz

From within the PySparse directory, execute:

$ python setup.py build
$ sudo python setup.py install

FiPy installation

Install FiPy packages as explained above.

Note

You may now choose to install Optional Packages or you may choose proceed directly to Using FiPy on Mac OS X.

Optional Packages

IPython

http://ipython.scipy.org/

This interactive Python shell is nicer to use than the default, and integrates nicely with matplotlib. Download the source and follow the building and installation instructions for Mac OS X.

Gmsh

http://www.geuz.org/gmsh

If you wish to run examples that have unstructured meshes, it is necessary to install Gmsh. Download and unpack the latest version of Gmsh for Mac OS X. Create a link on your $path or a shell alias that points to <Gmsh path>/Gmsh.app/Contents/MacOS/Gmsh.

Note

This is a required package for superfill examples.

Mayavi

http://code.enthought.com/projects/mayavi/

Mayavi 2 is a requirement if you wish to view 3D problems or improve the viewing capabilities of the superfill examples. The standard instructions for either installing with Enthought Python Distribution or installing manually work fine.

If you have already followed the Fink Installation instructions, then you should be able to go to the command line and type:

$ sudo apt-get install mayavi2-pyXX

SciPy

http://www.scipy.org/

This is a very powerful set of tools that augments the capabilities of FiPy. Although not required for using FiPy, some tests will fail if it is not present:

Note

You are now ready to proceed to Using FiPy on Mac OS X.

Using FiPy on Mac OS X

We do a substantial amount of our FiPy development on Mac OS X, so you can assume that it is well-tested on this platform. See Using FiPy for more information.

IDLE Environment

For those that are averse to the command line, the IDLE environment is installed by the pythonmac Python installer and will appear in the MacPython 2.4 folder of the Applications folder.

Note

We are not aware of a Fink package for IDLE.

Attention

We have no experience with using the IDLE environment on Mac OS X, but the following steps do work.

You can use the IDLE file browser to open the examples and run the module.

  • Open the IDLE application, located in /Applications/MacPython 2.4/
  • Select the Python Shell window. You can close the Console window if it appears.
  • Choose File > Open
  • Select /Path/To/Base/FiPy/Directory/examples/diffusion/mesh1D.py and click the Open button

The script will open in an editor window.

  • Choose Run > Run Module

A matplotlib viewer should appear and the Python Shell should prompt you through a series of examples.