root/trunk/MACOSX-INSTALLATION.txt

Revision 2901, 13.5 kB (checked in by guyer, 7 days ago)

Copying comments on state of MayaVi? to all INSTALLATION.txt docs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1============================
2Simple Mac OS X Installation
3============================
4
5.. contents::
6   :local:
7   :depth: 2
8
9We present two comparatively simple routes to installing |FiPy| on `Mac OS
10X`_. The `Fink Installation`_ procedure is appropriate if you are already
11familiar with the Fink_ package manager. The `Binary Installation`_
12procedure is the most expedient if you have never heard of Fink_ or if
13you are not comfortable with it. Please see the more general
14|INSTALLATION-txt| for detailed installation instructions. These
15instructions are not the only ways to set up |FiPy| on `Mac OS X`_ but
16represent the most expedient ways, from our experience, to have a usable
17installation up and running.
18
19.. attention::
20
21   You must have an administrator account to install most of the following
22   packages.
23
24.. include:: utils/include.txt
25
26.. |INSTALLATION-txt| replace:: |htmlINSTALL| |latexINSTALL|
27.. _Mac OS X: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.apple.com/macosx/
28.. _Fink: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://fink.sourceforge.net
29
30Binary Installation
31===================
32
33.. attention::
34
35   Choose this method if you have never heard of Fink_ or if you are not
36   comfortable with it for any reason. Binary installation is the fastest
37   way to get |FiPy| up and running, but may offer less flexibility in the
38   long run.
39   
40   .. note::
41   
42      If you wish to view 3D models, the MayaVi_ viewer is required, which
43      is best installed via Fink_, so you should follow the `Fink
44      Installation`_ instructions.
45
46Pre-built binaries for many of the required packages are available at
47http://pythonmac.org/packages/py24-fat/.
48
49.. _pythonmac: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://pythonmac.org/packages/py24-fat/
50
51Python
52------
53
54Python is pre-installed on `Mac OS X`_, but installation of other packages
55is much easier if you upgrade to the latest version of
56``python-2.4.X-XXXX-XX-XX.dmg`` from pythonmac_ (or possibly some variant on
57``Universal-MacPython-2.4.X-XXXX-XX-XX.dmg``). Your existing
58installation will not be harmed.
59
60.. note::
61
62   Any command-line instructions that start with ``python`` will either
63   need to be explicitly typed as ``/usr/local/bin/python`` or you will
64   need to adjust your ``$path`` variable so that this version of
65   ``python`` is found before the pre-installed version.
66
67.. note::
68
69   Another option is ActivePython_, which probably is the most heavily
70   supported installation on the Mac, but seems to lack `readline` support,
71   but these instructions
72
73       http://www.friday.com/bbum/2006/03/06/python-mac-os-x-and-readline/
74
75   worked for us.
76
77.. _ActivePython: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.activestate.com/Products/ActivePython/
78
79NumPy
80-----
81
82Download and install the latest version of
83``numpy-X.XX-py2.4-macosx10.4.mpkg.zip`` from pythonmac_.
84
85
86
87matplotlib
88----------
89
90In order to see simulation results, you will need a viewer. We recommend
91you download and install the latest version of
92``matplotlib-X.XX.X-py2.4-macosx10.4.mpkg.zip`` from pythonmac_.
93
94
95matplotlib requires:
96
97wxPython
98~~~~~~~~
99
100Download and install the latest version of
101``wxPythonX.X-osx-unicode-X.X.X.X-universal10.4-py2.4.dmg`` from
102pythonmac_.
103
104
105PySparse
106--------
107
108http://sourceforge.net/project/showfiles.php?group_id=101403
109
110Download and install the latest version of
111``pysparse-X.XX.XXX.macosx-10.4-py24.dmg``
112
113|FiPy|
114------
115
116http://www.ctcms.nist.gov/fipy/
117
118Download and unpack the source archive (``FiPy-x.y.tar.gz``).     
119
120From within the |FiPy| directory, execute the command-line instruction::
121
122    $ python setup.py build
123    $ sudo python setup.py install
124
125.. note::
126
127   You may now choose to install `Optional Packages`_ or you may choose
128   proceed directly to `Using FiPy on Mac OS X`_.
129
130
131
132Fink Installation
133=================
134   
135.. attention::
136
137   Choose this method if you are already familiar with Fink_ or with Linux_
138   package managers in general (such as Debian_ packages or RPMs). Fink_
139   installation takes considerably longer than `Binary Installation`_, but
140   offers a wealth of other programs that can make it worthwhile.
141
142The Fink_ package manager automatically handles the many intricate
143dependencies involved in building open source software. Fink_ is based on
144the Debian_ tools and the package manager model will be familiar to Linux_
145users.
146
147.. _Debian: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.debian.org
148.. _Linux: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.linux.org
149
150
151Xcode Development Tools
152-----------------------
153
154http://developer.apple.com/tools/xcode
155
156Some required packages are not available from Fink_ as binaries, so you
157will need to have the developer tools for `Mac OS X`_. They may already
158be installed in the ``/Developer/`` directory, but a different version may
159be required by Fink_; see the recommendations at http://fink.sourceforge.net/download
160
161.. note::
162
163   Free registration with the `Apple Developer Connection`_ is required.
164   
165.. _Apple Developer Connection:
166
167X11
168---
169
170Open the X11 application.
171
172Set your ``$DISPLAY`` environment variable to ``:0.0``.
173
174.. note::
175
176   If the X11 application is not already present in the
177   ``/Applications/Utilities/`` directory, it should be available as an
178   optional package on the OS installation media that came with your
179   computer.
180
181
182Fink
183----
184
185http://fink.sourceforge.net/download
186
187Ensure that Fink_ is installed and up to date for your OS.
188
189.. note::
190
191   The following steps have been tested with Fink_ 0.8.1 on `Mac OS X`_
192   10.4 "Tiger". Variations may be necessary for other OS versions.
193
194unstable tree
195~~~~~~~~~~~~~
196
197Follow the directions at http://www.finkproject.org/faq/usage-fink.php#unstable
198
199.. note::
200
201   We recommend that you accept all defaults presented by
202   ``fink selfupdate``.
203
204.. note::
205
206   "unstable" is not as scary as it sounds. The Fink_ administrators tend
207   to be very conservative about what packages are designated "stable".
208
209Remaining Fink packages
210~~~~~~~~~~~~~~~~~~~~~~~
211
212Execute the following commands from Terminal application (you can use
213``xterm`` or any other terminal application of your choosing)::
214
215    $ fink --use-binary-dist install python
216
217Take note of the version of Python that gets installed (`python
218--version`). Many other packages, indicated by a "`-pyXX`" suffix, require
219you substitute the Python version. E.g., Python 2.4 takes "`-py24`", Python
2202.5 takes "`-py25`", and so on.
221
222    $ fink --use-binary-dist install matplotlib-pyXX
223
224.. attention::
225
226   The matplotlib_ installation will automatically download and build a
227   number of other packages. This process can take quite awhile. We
228   recommend that you accept all defaults offered at the beginning of this
229   process.
230   
231.. note::
232
233   If the installation of matplotlib-pyXX fails for some reason, we
234   recommend you execute the ``install`` command again.
235     
236A few changes are needed to allow matplotlib_ to run::
237
238    $ mkdir ~/.matplotlib
239    $ curl http://matplotlib.sourceforge.net/matplotlibrc \
240      > ~/.matplotlib/matplotlibrc
241
242You may now choose to either edit the "backend" configuration in
243``~/.matplotlib/matplotlibrc`` to read::
244
245    backend      : TkAgg
246   
247or you can install wxPython with::
248
249    $ fink --use-binary-dist install wxpython-pyXX
250   
251(the second choice takes awhile, as it needs to build things).
252
253PySparse installation
254---------------------
255
256http://sourceforge.net/project/showfiles.php?group_id=101403
257
258Download and unpack the latest version of
259``pysparse-X.XX.XXX.tar.gz``
260
261From within the PySparse directory, execute::
262
263    $ python setup.py build
264    $ sudo python setup.py install
265
266|FiPy| installation
267-------------------
268
269Install |FiPy|_ packages as explained above.
270
271.. note::
272
273   You may now choose to install `Optional Packages`_ or you may choose
274   proceed directly to `Using FiPy on Mac OS X`_.
275
276..
277
278Optional Packages
279=================
280
281ipython
282-------
283
284http://ipython.scipy.org/moin/Download
285
286This interactive Python shell is nicer to use than the default, and
287integrates nicely with matplotlib_. Download the source and follow the
288building and installation instructions for `Mac OS X`_.
289
290Gmsh
291----
292
293http://www.geuz.org/gmsh
294
295If you wish to run examples that have unstructured meshes, it is
296necessary to install Gmsh. Download and unpack the latest version of
297Gmsh for `Mac OS X`. Create a link on your ``$path`` or a shell alias that
298points to ``<Gmsh path>/Gmsh.app/Contents/MacOS/Gmsh``.
299
300.. note::
301
302   This is a required package for superfill examples.
303
304MayaVi
305------
306
307`MayaVi 1`_ is a requirement if you wish to view 3D problems or improve the
308viewing capabilities of the superfill examples. This is one package that is
309probably much easier to install via Fink_ than by hand. You might attempt
310to follow the instructions at
311http://mayavi.sourceforge.net/mwiki/BuildingVTKOnOSX but they are quite out
312of date and did not work for us.
313
314If you have already followed the `Fink Installation`_ instructions, then
315you can go to the command line and type::
316
317    $ sudo apt-get install mayavi-pyXX
318   
319.. note::
320
321   `MayaVi 1`_ is outdated and we hope to have compatilibiltiy with
322   `MayaVi 2`_ as soon as possible.
323
324.. _MayaVi 1: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://mayavi.sourceforge.net
325.. _MayaVi 2: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://code.enthought.com/projects/mayavi
326
327SciPy
328-----
329
330http://www.scipy.org/
331
332This is a very powerful set of tools that augments the capabilities of
333|FiPy|. Although not required for using |FiPy|, some tests will fail if it
334is not present:
335
336    * If you followed the `Binary Installation`_ procedure, there are a few
337      different choices for obtaining prebuilt binaries of SciPy, each with
338      their own issues:
339
340          - We presently recommend obtaining SciPy from the ScipySuperpack_
341
342            .. warning::
343
344               We do *not* recommend installing the other components from the
345               ScipySuperpack_. In particular, matplotlib_ was not usable
346               when we tried it.
347
348          - pythonmac_ includes a build of SciPy, but the latest version we
349            tried from pythonmac_, ``scipy-0.5.1-py2.4-macosx10.4.mpkg.zip
350            (MD5: 15daecd1b5709f04a41154102269359f)``, was apparently not
351            linked correctly and does not work properly, c.f.
352
353                http://projects.scipy.org/pipermail/scipy-user/2007-January/010820.html
354
355          - We *may* provide builds of SciPy from `our own site`_ if we
356            conclude that we can better serve |FiPy| users that way.
357
358    * If you followed the `Fink Installation`_ procedure, then you should be
359      able to type::
360
361          $ sudo apt-get install scipy-pyXX
362
363
364.. _ScipySuperpack: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://trichech.us/?page_id=4
365
366.. _our own site: http://www.ctcms.nist.gov/fipy/download/
367
368.. note::
369
370   You are now ready to proceed to `Using FiPy on Mac OS X`_.
371     
372   
373   
374Using |FiPy| on Mac OS X
375========================
376
377We do a substantial amount of our |FiPy| development on `Mac OS X`_, so you
378can assume that it is well-tested on this platform. We exlusively use the
379unix command line to interact with |FiPy|. The commands in |examples/| are
380written with the assumption that they will be executed from the command
381line. For instance, from within the main |FiPy| directory, you can type::
382
383    $ python examples/diffusion/mesh1D.py
384
385A matplotlib_ viewer should appear and you should be prompted
386through a series of examples.
387
388.. note::
389
390   We strongly recommend you proceed through |examples/|, but at
391   the very least work through |examples/diffusion/mesh1D-py| to understand
392   the notation and basic concepts of |FiPy|.
393
394
395IDLE Environment
396----------------
397
398For those that are averse to the command line, the IDLE_ environment is
399installed by the pythonmac_ Python_ installer and will appear in the
400MacPython 2.4 folder of the Applications folder.
401
402.. note:: We are not aware of a Fink_ package for IDLE_.
403
404.. attention::
405
406   We have no experience with using the IDLE_ environment on `Mac OS X`_,
407   but the following steps do work.
408
409You can use the IDLE_ file browser to open the examples and run the
410module.
411
412    - Open the IDLE_ application, located in ``/Applications/MacPython 2.4/``
413    - Select the Python Shell window.
414      You can close the Console window if it appears.
415    - Choose File > Open
416    - Select ``/Path/To/Base/FiPy/Directory/examples/diffusion/mesh1D.py``
417      and click the Open button
418
419The script will open in an editor window.
420
421    - Choose Run > Run Module
422   
423A matplotlib_ viewer should appear and the Python Shell should prompt you
424through a series of examples.
425
426Another way to use |FiPy| examples is to import the example file and then
427run any functionality it may have. For example, execute the following
428commands in the Python Shell:
429
430    >>> import sys
431    >>> sys.path.append('\Path\To\Base\FiPy\Directory')
432    >>> from examples.levelSet.electroChem.inputGold import runGold
433    >>> runGold(numberOfSteps = 100)
434
435If you have installed the optional packages, a viewer should
436appear with a trench filling simulation.
437
438.. _IDLE: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.python.org/idle/
439.. |FiPy| replace:: |htmlFiPy| |latexFiPy|
440.. |examples/| replace:: |htmlExamples/| |latexExamples/|
441
442.. |latexMesh1D-py| raw:: latex
443
444   Section~\ref{sec:Examples:diffusion:mesh1D} ``\titleref{sec:Examples:diffusion:mesh1D}''
445
446.. |htmlMesh1D-py| raw:: html
447
448   Example 7.1: "Module <code>examples.diffusion.mesh1D</code>" of the <a href="download/fipy.pdf">Manual</a>
449
450.. |examples/diffusion/mesh1D-py| replace:: |htmlMesh1D-py| |latexMesh1D-py|
451
452
453
454
455
Note: See TracBrowser for help on using the browser.