source: trunk/anuga_core/INSTALL.rst @ 9737

Last change on this file since 9737 was 9737, checked in by steve, 9 years ago

Commit svn after a lot of git updates

File size: 8.8 KB
RevLine 
[9627]1
2
[9737]3******************
4Anuga Installation
5******************
[9627]6
7.. contents::
8
[9737]9
[9627]10Introduction
[9737]11============
[9627]12
[9687]13AnuGA_ is a python package with some C extensions (and an optional fortran
[9680]14extension). At present AnuGA has only been run and tested using python 2.x.
15We recommend python 2.7. 
[9627]16
17
[9717]18Dependencies
[9737]19============
[9687]20
[9680]21AnuGA requires the following packages:
[9627]22
[9680]23* `numpy <http://numpy.scipy.org/>`_
24* `scipy <http://scipy.org/>`_
25* `matplotlib <http://matplotlib.sourceforge.net/>`_
26* `gdal <http://gdal.org/>`_
[9687]27* `netcdf <http://www.unidata.ucar.edu/software/netcdf/>`_
[9680]28* `nose <http://nose.readthedocs.org/en/latest/>`_
[9687]29* A C compiler (preferably GCC or TDM-GCC_ MinGW_ on Windows)
[9627]30
[9717]31
[9737]32Installing the latest DEVELOPMENT version on Ubuntu
33===================================================
[9717]34
[9734]35AnuGA is developed on Ubuntu. The preferred way to install the dependencies is
36to use the standard ubuntu ``apt-get`` method.
[9717]37
[9737]38We suggest installing the latest version of ANUGA_ from Github_.
39We try to maintain the *master* branch stable and
40`passing all tests <https://travis-ci.org/GeoscienceAustralia/anuga_core/branches>`_,
41so it should be safe to use.
42
43First, you'll need to `install git`_.
44Then, open a terminal and run::
45
46    git clone git://github.com/GeoscienceAustralia/anuga_core.git
47
48This will fetch the source code from Github_
49and place it in a folder called ``anuga_core`` in the directory where you ran the
50command.
51
52We have a script in the ``anuga_core/tools`` directory,
[9734]53`install_ubuntu.sh <https://github.com/GeoscienceAustralia/anuga_core/blob/master/tools/install_ubuntu.sh>`_
[9737]54which when run from the ``anuga_core`` directory will install AnuGA and all the dependencies using ``apt-get`` 
55and ``pip`` to install the dependencies.
[9734]56
[9737]57Parallel Support
58----------------
59
60At this stage you can decide whether you want Parallel support or not.
61We support two versions of MPI, ``mpich`` and ``openmpi``
62
63Just during the setup stage, you should create an environment variable  ``ANUGA_PARALLEL`` via::
64
65    export ANUGA_PARALLEL=openmpi
66
67or::
68
69    export ANUGA_PARALLEL=mpich
70
71
72then the install script will load the  ``openmpi`` or ``mpich`` libraries and binaries respectively.
73
74
75If you don't want parallel support set the variable to something else, e.g::
76
77    export ANUGA_PARALLEL=false
78
79
80Running the installation script
81-------------------------------
82
83Change into the newly downloaded ``anuga_core`` directory and run the installation script
84(this will take 5 to 10 minutes depending on your network connection)::
85
86        cd anuga_core
87        bash tools/install_ubuntu.sh
88
89
90Some of the commands in this script use sudo, so you will have to provide
91a password to install into the system wide directories.
92
93If all has been successful then anuga should be installed.
94
95Testing the install
96-------------------
97
98To test the installation, from the ``anuga_core`` directory run ``python runtests.py``::
99
100    python runtests.py
101   
102If there are no errors then you have successfully installed aunga.
103
104Errors with runtests
105--------------------
106
107If you get an error message or a weird result when running ``runtests.py``,
108please write to the `mailing list`_ or `create an issue on the github site
109<https://github.com/GeoscienceAustralia/anuga_core/issues>`__.
110
111To make it easier for us to debug you problem, please include the following
112information:
113
114* Operating system
115* Python distribution (Anaconda_, PythonXY_, `ETS/Canopy`_, own install)
116* Python version (2.6, 2.7 etc)
117* The script you ran (and gave you an error/weird result)
118* The error message (the part that says ``Traceback: ...``) or result (figure,
119  numbers, etc)
120
121
122
123
124For extended instructions on installing on Ubuntu checkout the wiki page
[9734]125`install ANUGA on Ubuntu <https://github.com/GeoscienceAustralia/anuga_core/wiki/Install-ANUGA-on-Ubuntu>`_
126
127
128
129Alternative Ubuntu Install
[9737]130==========================
[9734]131
132An alternative is to install the dependencies using the Anaconda_ or the Miniconda_ Python
[9680]133distributions by `Continuum Analytics`_.
[9687]134
[9734]135Miniconda_ has the advantage of allowing you to create multiple
[9687]136python environments and is particularly
[9680]137useful if you want to keep multiple versions of AnuGA.
[9627]138
[9687]139Both Anaconda_ and Miniconda_ do not require administrative rights
140to your computer and do not interfere with the Python installed
141in your system.
[9627]142
[9687]143
[9734]144Anaconda and Miniconda
[9737]145----------------------
[9627]146
[9734]147Once you have downloaded and installed Anaconda_ or Miniconda_
148open a terminal (or ``cmd.exe`` on Windows).
[9680]149
[9734]150With  Miniconda_, you can create
151a specific environment for AnuGA, by running::
152
153    conda create -n anuga_env python=2.7
154    source activate anuga_env
155   
156   
157With either Anaconda_ or Miniconda_ you can now install the dependencies by running::
158
[9687]159    conda install pip nose numpy scipy matplotlib netcdf4
[9680]160    conda install -c pingucarsti gdal
161   
[9737]162and setup GDAL_DATA environment variable::
[9680]163
164    export GDAL_DATA=`gdal-config --datadir`
165   
[9686]166(You should add this command to your .bashrc file.)   
167
[9680]168
[9734]169Windows Dependency Installation
[9737]170===============================
[9680]171
[9734]172We have successfully install AnuGA on windows using Gohlke Binaries and using Miniconda.
173At present we recommend using the Gohlke Binaries.
[9680]174
[9734]175Follow the instructions
176`install ANUGA on Windows using the Gohlke Binaries
177<https://github.com/GeoscienceAustralia/anuga_core/wiki/Install-ANUGA-on-Windows-using-Gohlke-Binaries>`_
[9680]178
[9734]179Alternatively if you want ot use Miniconda, follow the instructions
180`install ANUGA on Windows using Miniconda
181<https://github.com/GeoscienceAustralia/anuga_core/wiki/Install-ANUGA-on-Windows-using-Miniconda>`_
182
183
184
[9737]185
[9734]186GCC dependency for Windows users
[9737]187--------------------------------
[9680]188
[9687]189Unfortunately, the ``gcc`` compiler MinGW_ included in Anaconda or
190installable via Miniconda_ doesn't have OpenMP_ support. This is required to compile
191some extension modules in AnuGA (those that have multi-threaded parallel code).
[9680]192
[9687]193We suggest that you download and install the version of MinGW_ provided by TDM-GCC_
[9680]194**after** you've installed Anaconda and **before** you install AnuGA.
[9688]195Don't forget to mark the ``openmp`` and ``gfortran`` options in the "Choose Components" part of
[9680]196the installation. See this `excellent documentation for Windows users`_
[9687]197(they even have screenshots!). The same applies if you are using Miniconda_.
[9680]198
[9734]199
[9737]200Installing the latest development version of AnuGA om Windows
201=============================================================
[9680]202
[9737]203We suggest instaling the latest code and features,
204by installing AnuGA directly from Github_.
[9680]205We try to maintain the *master* branch stable and
[9717]206`passing all tests <https://travis-ci.org/GeoscienceAustralia/anuga_core/branches>`__,
[9680]207so it should be safe to use.
208
209First, you'll need to `install git`_.
210Then, open a terminal and run::
211
[9717]212    git clone git://github.com/GeoscienceAustralia/anuga_core.git
[9680]213
214This will fetch the source code from Github_
215and place it in a folder called ``anuga_core`` in the directory where you ran the
216command.
217Then, just ``cd`` into the directory and run ``pip``::
218
219    cd anuga_core
220    pip install --upgrade .
221   
[9687]222
[9680]223Testing the install
[9627]224-------------------
225
[9680]226
[9737]227From the source directory run ``python runtests.py``::
[9680]228
229    python runtests.py
230   
231
232If you get an error message or weird result,
[9737]233please write to the `mailing list`_ or `create an issue on the github site
234<https://github.com/GeoscienceAustralia/anuga_core/issues>`__.
235
[9680]236To make it easier for us to debug you problem, please include the following
237information:
238
239* Operating system
240* Python distribution (Anaconda_, PythonXY_, `ETS/Canopy`_, own install)
[9687]241* Python version (2.6, 2.7 etc)
[9680]242* The script you ran (and gave you an error/weird result)
243* The error message (the part that says ``Traceback: ...``) or result (figure,
244  numbers, etc)
245   
[9737]246Using pip_ to install anuga
247===========================
248   
249You can alternatively use  pip_ to install the lateest released version of `anuga`
250
251Open a terminal (or ``cmd.exe`` on Windows) and run::
252
253    pip install anuga
254
255
256If you already have AnuGA installed and want to **upgrade** to a newer
257released version, use::
258
259    pip install anuga --upgrade
260
261To uninstall simply run::
262
263    pip uninstall anuga
264
265
266
267.. note::
268
269    The Windows installer from older versions is no longer supported.
270   
271   
272.. _AnuGA: http://anuga.anu.edu.au/
[9680]273.. _install git: http://git-scm.com/
274.. _Github: https://github.com/stoiver/anuga_core/
275.. _Python: http://www.python.org/
276.. _pip: http://www.pip-installer.org
277.. _MinGW: http://www.mingw.org/
278.. _mailing list: anuga-user@lists.sourceforge.net
279.. _Continuum Analytics: http://continuum.io/
280.. _Anaconda: http://continuum.io/downloads
281.. _Miniconda: http://conda.pydata.org/miniconda.html
282.. _PythonXY: http://code.google.com/p/pythonxy/
283.. _ETS/Canopy: http://code.enthought.com/projects/index.php
284.. _OpenMP: http://openmp.org/
285.. _TDM-GCC: http://tdm-gcc.tdragon.net/
286.. _excellent documentation for Windows users: http://docs-windows.readthedocs.org/en/latest/devel.html#mingw-with-openmp-support
Note: See TracBrowser for help on using the repository browser.