61 lines
2.9 KiB
Text
61 lines
2.9 KiB
Text
/**
|
|
\page installnumarray Installing numarray
|
|
|
|
If you plan to use %Cantera from Python, or want to run any of the Python demo scripts, or use the graphical MixMaster application, then you need to install the 'numarray' package.
|
|
|
|
Numarray provides capabilities for Python to work efficiently work large matrices, and is
|
|
used by the %Cantera Python package.
|
|
|
|
\section numWin Installing numarray on Windows
|
|
|
|
If you are using a PC running Windows, go to http://sourceforge.net/projects/numpy and download the Windows binary installer for numarray. All you need to do is to execute this installer to install numarray.
|
|
|
|
\section numUnix Building and Installing numarray on a unix-like platform
|
|
|
|
On a unix-like (linux, Mac OS X) platform, you need to build numarray from source code. The procedure to do this is largely automated, and takes only a few minutes. Here's what you do:
|
|
|
|
- Get the source code from http://sourceforge.net/projects/numpy. This file should have a
|
|
name like numarray-1.x.x.tar.gz.
|
|
- Unpack the compresssed tar archive:
|
|
\verbatim
|
|
gunzip numarray-1.x.x.tar.gz
|
|
tar xvf numarray-1.x.x.tar \endverbatim
|
|
- Go into the directory created by unpacking the archive, and type at a shell prompt
|
|
\verbatim
|
|
python setup.py build \endverbatim
|
|
This compiles everything, and puts the files in a temporary directory, ready to be
|
|
installed wherever you specify in the next step.
|
|
.
|
|
|
|
\section numAll Installing numarray for all users
|
|
|
|
If your are the system administrator and want to install numaray so that every user can access it, then simply type
|
|
|
|
\verbatim
|
|
python setup.py install
|
|
\endverbatim
|
|
|
|
You will probably have to run this command as super-user. Doing the install step this way will put
|
|
the numarray module in the 'site-packages' subdirectory within the python 'lib' directory. This
|
|
has the advantage that Python always looks in this directory for modules -- there is no need to
|
|
set PYTHONPATH for the interpreter to find numarray. But it does require write access to the
|
|
Python 'lib' directory, which typically only the system administrator has.
|
|
|
|
\section numLocal Installing a local version of numarray
|
|
|
|
If you are not the system administrator, then you can install a local version of numarray in your
|
|
home directory by adding the --home option to the 'install' step. For example, if you want to
|
|
install all numarray files within a directory named 'python_modules' in your home directory, then do this:
|
|
|
|
\verbatim
|
|
python setup.py build
|
|
python setup.py install --home=$HOME/python_modules
|
|
\endverbatim
|
|
|
|
Note that if you use the --home option, you will need to configure %Cantera so that it knows where to
|
|
find numarray. To do this, you can either set environment variable NUMARRAY_HOME to the directory
|
|
you specified with the --home option (e.g. $HOME/python_modules), or edit the
|
|
cantera 'preconfig' script to set this variable there.
|
|
|
|
*/
|
|
|