File: installation.rst

package info (click to toggle)
nipy 0.1.2%2B20100526-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,992 kB
  • ctags: 13,434
  • sloc: python: 47,720; ansic: 41,334; makefile: 197
file content (164 lines) | stat: -rw-r--r-- 5,519 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.. _installation:

====================
Download and Install
====================

This page covers the necessary steps to install and run NIPY.  Below
is a list of required dependencies, along with additional software
recommendations.

NIPY is currently *ALPHA* quality, but is rapidly improving. If you are
trying to get some work done wait until we have a stable release. For now,
the code will primarily be of interest to developers.

Dependencies
------------

Must Have
^^^^^^^^^

  Python_ 2.5 or later
  
  NumPy_ 1.2 or later

  SciPy_ 0.7 or later
    Numpy and Scipy are high-level, optimized scientific computing libraries.

  Sympy_ 0.6.6 or later
    Sympy is a symbolic mathematics library for Python.  We use it for
    statistical formalae.

  gcc_
    NIPY does contain a few C extensions for optimized
    routines. Therefore, you must have a compiler to build from
    source.  XCode_ (OSX) and MinGW_ (Windows) both include gcc.  (*Once
    we have binary packages, this requirement will not be necessary.*)

  cython_ 0.11.1 or later
    Cython is a language that is a fusion of Python and C.  It allows us
    to write fast code using Python and C syntax, so that it easier to
    read and maintain.  You need Cython if you are building the
    development source code (and that is what you have to do at the
    moment, because we don't yet have a release).

Strong Recommendations
^^^^^^^^^^^^^^^^^^^^^^

  iPython_
    Interactive python environment.

  Matplotlib_
    2D python plotting library.

Installing from binary packages
-------------------------------

Currently we do not have binary packages.  Until we do, the easiest
installation method is to download the source tarball and follow the
:ref:`building_source` instructions below.

.. _building_source:

Building from source code
-------------------------

Developers should look through the 
:ref:`development quickstart <development-quickstart>` 
documentation.  There you will find information on building NIPY, the
required software packages and our developer guidelines.

If you are primarily interested in using NIPY, download the source
tarball and follow these instructions for building.  The installation
process is similar to other Python packages so it will be familiar if
you have Python experience.

Unpack the source tarball and change into the source directory.  Once in the
source directory, you can build the neuroimaging package using::

    python setup.py build

To install, simply do::
   
    sudo python setup.py install

.. note::

    As with any Python_ installation, this will install the modules
    in your system Python_ *site-packages* directory (which is why you
    need *sudo*).  Many of us prefer to install development packages in a
    local directory so as to leave the system python alone.  This is
    mearly a preference, nothing will go wrong if you install using the
    *sudo* method.  To install in a local directory, use the **--prefix**
    option.  For example, if you created a ``local`` directory in your
    home directory, you would install nipy like this::

	python setup.py install --prefix=$HOME/local

.. _install-data:

Installing useful data files
-----------------------------

You can download template and example data used by nipy from the `NIPY
data packages`_ site.  Get the versions of the packages with the most
recent version number.  Install them the normal Python ``setup.py``
routine.  For example, maybe something like this::

   sudo python setup.py install nipy-data-0.2.tar.gz
   sudo python setup.py install nipy-templates-0.2.tar.gz

This will extract the data to a standard path, that should let NIPY find
the data.  

See :ref:`data-files` for details on how to customize the installation
paths.

Building for 64-bit Snow Leopard
--------------------------------

How you install nipy for Snow Leopard depends on which version of
Python you have installed.  There are two versions we know work, using
the Python that shipped with Snow Leopard, and using a 64-bit
MacPorts_ version.

If you are using the Python that shipped with Snow Leopard, there are
detailed instructions on `this blog
<http://blog.hyperjeff.net/?p=160>`_ for installing numpy_ and scipy_.
The critical step is to set the appropriate flags for the C and
Fortran compilers so they match the architecture of your version of
Python.  You can discover the architecture of your Python by doing the
following::

    file `which python`

For example, on my 32-bit Leopard (10.5) it's a Universal binary,
built for both ppc and i386 architectures::

    /usr/local/bin/python: Mach-O universal binary with 2 architectures
    /usr/local/bin/python (for architecture i386):	Mach-O executable i386
    /usr/local/bin/python (for architecture ppc):	Mach-O executable ppc

On a 64-bit MacPorts_ install on Snow Leopard (10.6), it's built for
64-bit only::

    /opt/local/bin/python: Mach-P 64-bit executable x86_64

For the 64-bit MacPorts_ install, set the flags and build using this::

    export MACOSX_DEPLOYMENT_TARGET=10.6
    export LDFLAGS="-arch x86_64 -Wall -undefined dynamic_lookup -bundle -fPIC"
    export FFLAGS="-arch x86_64 -O2 -Wall -fPIC"
    python setup.py build

These sites may also be useful:

* `readline fix for ipython <http://blog.zacharyvoase.com/post/174280299>`_
* `to graphically select the full 64-bit environment
  <http://www.ahatfullofsky.comuv.com/English/Programs/SMS/SMS.html>`_

.. _MacPorts: http://www.macports.org/


.. include:: ../links_names.txt