| 1 | ============================ |
|---|
| 2 | Simple Mac OS X Installation |
|---|
| 3 | ============================ |
|---|
| 4 | |
|---|
| 5 | .. contents:: |
|---|
| 6 | :local: |
|---|
| 7 | :depth: 2 |
|---|
| 8 | |
|---|
| 9 | We present two comparatively simple routes to installing |FiPy| on `Mac OS |
|---|
| 10 | X`_. The `Fink Installation`_ procedure is appropriate if you are already |
|---|
| 11 | familiar with the Fink_ package manager. The `Binary Installation`_ |
|---|
| 12 | procedure is the most expedient if you have never heard of Fink_ or if |
|---|
| 13 | you are not comfortable with it. Please see the more general |
|---|
| 14 | |INSTALLATION-txt| for detailed installation instructions. These |
|---|
| 15 | instructions are not the only ways to set up |FiPy| on `Mac OS X`_ but |
|---|
| 16 | represent the most expedient ways, from our experience, to have a usable |
|---|
| 17 | installation 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 | |
|---|
| 30 | Binary 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 | |
|---|
| 46 | Pre-built binaries for many of the required packages are available at |
|---|
| 47 | http://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 | |
|---|
| 51 | Python |
|---|
| 52 | ------ |
|---|
| 53 | |
|---|
| 54 | Python is pre-installed on `Mac OS X`_, but installation of other packages |
|---|
| 55 | is 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 |
|---|
| 58 | installation 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 | |
|---|
| 79 | NumPy |
|---|
| 80 | ----- |
|---|
| 81 | |
|---|
| 82 | Download and install the latest version of |
|---|
| 83 | ``numpy-X.XX-py2.4-macosx10.4.mpkg.zip`` from pythonmac_. |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | matplotlib |
|---|
| 88 | ---------- |
|---|
| 89 | |
|---|
| 90 | In order to see simulation results, you will need a viewer. We recommend |
|---|
| 91 | you download and install the latest version of |
|---|
| 92 | ``matplotlib-X.XX.X-py2.4-macosx10.4.mpkg.zip`` from pythonmac_. |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | matplotlib requires: |
|---|
| 96 | |
|---|
| 97 | wxPython |
|---|
| 98 | ~~~~~~~~ |
|---|
| 99 | |
|---|
| 100 | Download and install the latest version of |
|---|
| 101 | ``wxPythonX.X-osx-unicode-X.X.X.X-universal10.4-py2.4.dmg`` from |
|---|
| 102 | pythonmac_. |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | PySparse |
|---|
| 106 | -------- |
|---|
| 107 | |
|---|
| 108 | http://sourceforge.net/project/showfiles.php?group_id=101403 |
|---|
| 109 | |
|---|
| 110 | Download and install the latest version of |
|---|
| 111 | ``pysparse-X.XX.XXX.macosx-10.4-py24.dmg`` |
|---|
| 112 | |
|---|
| 113 | |FiPy| |
|---|
| 114 | ------ |
|---|
| 115 | |
|---|
| 116 | http://www.ctcms.nist.gov/fipy/ |
|---|
| 117 | |
|---|
| 118 | Download and unpack the source archive (``FiPy-x.y.tar.gz``). |
|---|
| 119 | |
|---|
| 120 | From 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 | |
|---|
| 132 | Fink 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 | |
|---|
| 142 | The Fink_ package manager automatically handles the many intricate |
|---|
| 143 | dependencies involved in building open source software. Fink_ is based on |
|---|
| 144 | the Debian_ tools and the package manager model will be familiar to Linux_ |
|---|
| 145 | users. |
|---|
| 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 | |
|---|
| 151 | Xcode Development Tools |
|---|
| 152 | ----------------------- |
|---|
| 153 | |
|---|
| 154 | http://developer.apple.com/tools/xcode |
|---|
| 155 | |
|---|
| 156 | Some required packages are not available from Fink_ as binaries, so you |
|---|
| 157 | will need to have the developer tools for `Mac OS X`_. They may already |
|---|
| 158 | be installed in the ``/Developer/`` directory, but a different version may |
|---|
| 159 | be 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 | |
|---|
| 167 | X11 |
|---|
| 168 | --- |
|---|
| 169 | |
|---|
| 170 | Open the X11 application. |
|---|
| 171 | |
|---|
| 172 | Set 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 | |
|---|
| 182 | Fink |
|---|
| 183 | ---- |
|---|
| 184 | |
|---|
| 185 | http://fink.sourceforge.net/download |
|---|
| 186 | |
|---|
| 187 | Ensure 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 | |
|---|
| 194 | unstable tree |
|---|
| 195 | ~~~~~~~~~~~~~ |
|---|
| 196 | |
|---|
| 197 | Follow 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 | |
|---|
| 209 | Remaining Fink packages |
|---|
| 210 | ~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 211 | |
|---|
| 212 | Execute 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 | |
|---|
| 217 | Take note of the version of Python that gets installed (`python |
|---|
| 218 | --version`). Many other packages, indicated by a "`-pyXX`" suffix, require |
|---|
| 219 | you substitute the Python version. E.g., Python 2.4 takes "`-py24`", Python |
|---|
| 220 | 2.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 | |
|---|
| 236 | A few changes are needed to allow matplotlib_ to run:: |
|---|
| 237 | |
|---|
| 238 | $ mkdir ~/.matplotlib |
|---|
| 239 | $ curl http://matplotlib.sourceforge.net/matplotlibrc \ |
|---|
| 240 | > ~/.matplotlib/matplotlibrc |
|---|
| 241 | |
|---|
| 242 | You may now choose to either edit the "backend" configuration in |
|---|
| 243 | ``~/.matplotlib/matplotlibrc`` to read:: |
|---|
| 244 | |
|---|
| 245 | backend : TkAgg |
|---|
| 246 | |
|---|
| 247 | or 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 | |
|---|
| 253 | PySparse installation |
|---|
| 254 | --------------------- |
|---|
| 255 | |
|---|
| 256 | http://sourceforge.net/project/showfiles.php?group_id=101403 |
|---|
| 257 | |
|---|
| 258 | Download and unpack the latest version of |
|---|
| 259 | ``pysparse-X.XX.XXX.tar.gz`` |
|---|
| 260 | |
|---|
| 261 | From within the PySparse directory, execute:: |
|---|
| 262 | |
|---|
| 263 | $ python setup.py build |
|---|
| 264 | $ sudo python setup.py install |
|---|
| 265 | |
|---|
| 266 | |FiPy| installation |
|---|
| 267 | ------------------- |
|---|
| 268 | |
|---|
| 269 | Install |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 | |
|---|
| 278 | Optional Packages |
|---|
| 279 | ================= |
|---|
| 280 | |
|---|
| 281 | ipython |
|---|
| 282 | ------- |
|---|
| 283 | |
|---|
| 284 | http://ipython.scipy.org/moin/Download |
|---|
| 285 | |
|---|
| 286 | This interactive Python shell is nicer to use than the default, and |
|---|
| 287 | integrates nicely with matplotlib_. Download the source and follow the |
|---|
| 288 | building and installation instructions for `Mac OS X`_. |
|---|
| 289 | |
|---|
| 290 | Gmsh |
|---|
| 291 | ---- |
|---|
| 292 | |
|---|
| 293 | http://www.geuz.org/gmsh |
|---|
| 294 | |
|---|
| 295 | If you wish to run examples that have unstructured meshes, it is |
|---|
| 296 | necessary to install Gmsh. Download and unpack the latest version of |
|---|
| 297 | Gmsh for `Mac OS X`. Create a link on your ``$path`` or a shell alias that |
|---|
| 298 | points to ``<Gmsh path>/Gmsh.app/Contents/MacOS/Gmsh``. |
|---|
| 299 | |
|---|
| 300 | .. note:: |
|---|
| 301 | |
|---|
| 302 | This is a required package for superfill examples. |
|---|
| 303 | |
|---|
| 304 | MayaVi |
|---|
| 305 | ------ |
|---|
| 306 | |
|---|
| 307 | `MayaVi 1`_ is a requirement if you wish to view 3D problems or improve the |
|---|
| 308 | viewing capabilities of the superfill examples. This is one package that is |
|---|
| 309 | probably much easier to install via Fink_ than by hand. You might attempt |
|---|
| 310 | to follow the instructions at |
|---|
| 311 | http://mayavi.sourceforge.net/mwiki/BuildingVTKOnOSX but they are quite out |
|---|
| 312 | of date and did not work for us. |
|---|
| 313 | |
|---|
| 314 | If you have already followed the `Fink Installation`_ instructions, then |
|---|
| 315 | you 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 | |
|---|
| 327 | SciPy |
|---|
| 328 | ----- |
|---|
| 329 | |
|---|
| 330 | http://www.scipy.org/ |
|---|
| 331 | |
|---|
| 332 | This 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 |
|---|
| 334 | is 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 | |
|---|
| 374 | Using |FiPy| on Mac OS X |
|---|
| 375 | ======================== |
|---|
| 376 | |
|---|
| 377 | We do a substantial amount of our |FiPy| development on `Mac OS X`_, so you |
|---|
| 378 | can assume that it is well-tested on this platform. We exlusively use the |
|---|
| 379 | unix command line to interact with |FiPy|. The commands in |examples/| are |
|---|
| 380 | written with the assumption that they will be executed from the command |
|---|
| 381 | line. For instance, from within the main |FiPy| directory, you can type:: |
|---|
| 382 | |
|---|
| 383 | $ python examples/diffusion/mesh1D.py |
|---|
| 384 | |
|---|
| 385 | A matplotlib_ viewer should appear and you should be prompted |
|---|
| 386 | through 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 | |
|---|
| 395 | IDLE Environment |
|---|
| 396 | ---------------- |
|---|
| 397 | |
|---|
| 398 | For those that are averse to the command line, the IDLE_ environment is |
|---|
| 399 | installed by the pythonmac_ Python_ installer and will appear in the |
|---|
| 400 | MacPython 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 | |
|---|
| 409 | You can use the IDLE_ file browser to open the examples and run the |
|---|
| 410 | module. |
|---|
| 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 | |
|---|
| 419 | The script will open in an editor window. |
|---|
| 420 | |
|---|
| 421 | - Choose Run > Run Module |
|---|
| 422 | |
|---|
| 423 | A matplotlib_ viewer should appear and the Python Shell should prompt you |
|---|
| 424 | through a series of examples. |
|---|
| 425 | |
|---|
| 426 | Another way to use |FiPy| examples is to import the example file and then |
|---|
| 427 | run any functionality it may have. For example, execute the following |
|---|
| 428 | commands 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 | |
|---|
| 435 | If you have installed the optional packages, a viewer should |
|---|
| 436 | appear 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 | |
|---|