[9627] | 1 | |
---|
| 2 | |
---|
[9737] | 3 | ****************** |
---|
| 4 | Anuga Installation |
---|
| 5 | ****************** |
---|
[9627] | 6 | |
---|
| 7 | .. contents:: |
---|
| 8 | |
---|
[9737] | 9 | |
---|
[9627] | 10 | Introduction |
---|
[9737] | 11 | ============ |
---|
[9627] | 12 | |
---|
[9687] | 13 | AnuGA_ is a python package with some C extensions (and an optional fortran |
---|
[9680] | 14 | extension). At present AnuGA has only been run and tested using python 2.x. |
---|
| 15 | We recommend python 2.7. |
---|
[9627] | 16 | |
---|
| 17 | |
---|
[9717] | 18 | Dependencies |
---|
[9737] | 19 | ============ |
---|
[9687] | 20 | |
---|
[9680] | 21 | AnuGA 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] | 32 | Installing the latest DEVELOPMENT version on Ubuntu |
---|
| 33 | =================================================== |
---|
[9717] | 34 | |
---|
[9734] | 35 | AnuGA is developed on Ubuntu. The preferred way to install the dependencies is |
---|
| 36 | to use the standard ubuntu ``apt-get`` method. |
---|
[9717] | 37 | |
---|
[9737] | 38 | We suggest installing the latest version of ANUGA_ from Github_. |
---|
| 39 | We try to maintain the *master* branch stable and |
---|
| 40 | `passing all tests <https://travis-ci.org/GeoscienceAustralia/anuga_core/branches>`_, |
---|
| 41 | so it should be safe to use. |
---|
| 42 | |
---|
| 43 | First, you'll need to `install git`_. |
---|
| 44 | Then, open a terminal and run:: |
---|
| 45 | |
---|
| 46 | git clone git://github.com/GeoscienceAustralia/anuga_core.git |
---|
| 47 | |
---|
| 48 | This will fetch the source code from Github_ |
---|
| 49 | and place it in a folder called ``anuga_core`` in the directory where you ran the |
---|
| 50 | command. |
---|
| 51 | |
---|
| 52 | We 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] | 54 | which when run from the ``anuga_core`` directory will install AnuGA and all the dependencies using ``apt-get`` |
---|
| 55 | and ``pip`` to install the dependencies. |
---|
[9734] | 56 | |
---|
[9737] | 57 | Parallel Support |
---|
| 58 | ---------------- |
---|
| 59 | |
---|
| 60 | At this stage you can decide whether you want Parallel support or not. |
---|
| 61 | We support two versions of MPI, ``mpich`` and ``openmpi`` |
---|
| 62 | |
---|
| 63 | Just during the setup stage, you should create an environment variable ``ANUGA_PARALLEL`` via:: |
---|
| 64 | |
---|
| 65 | export ANUGA_PARALLEL=openmpi |
---|
| 66 | |
---|
| 67 | or:: |
---|
| 68 | |
---|
| 69 | export ANUGA_PARALLEL=mpich |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | then the install script will load the ``openmpi`` or ``mpich`` libraries and binaries respectively. |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | If you don't want parallel support set the variable to something else, e.g:: |
---|
| 76 | |
---|
| 77 | export ANUGA_PARALLEL=false |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | Running the installation script |
---|
| 81 | ------------------------------- |
---|
| 82 | |
---|
| 83 | Change 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 | |
---|
| 90 | Some of the commands in this script use sudo, so you will have to provide |
---|
| 91 | a password to install into the system wide directories. |
---|
| 92 | |
---|
| 93 | If all has been successful then anuga should be installed. |
---|
| 94 | |
---|
| 95 | Testing the install |
---|
| 96 | ------------------- |
---|
| 97 | |
---|
| 98 | To test the installation, from the ``anuga_core`` directory run ``python runtests.py``:: |
---|
| 99 | |
---|
| 100 | python runtests.py |
---|
| 101 | |
---|
| 102 | If there are no errors then you have successfully installed aunga. |
---|
| 103 | |
---|
| 104 | Errors with runtests |
---|
| 105 | -------------------- |
---|
| 106 | |
---|
| 107 | If you get an error message or a weird result when running ``runtests.py``, |
---|
| 108 | please write to the `mailing list`_ or `create an issue on the github site |
---|
| 109 | <https://github.com/GeoscienceAustralia/anuga_core/issues>`__. |
---|
| 110 | |
---|
| 111 | To make it easier for us to debug you problem, please include the following |
---|
| 112 | information: |
---|
| 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 | |
---|
| 124 | For 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 | |
---|
| 129 | Alternative Ubuntu Install |
---|
[9737] | 130 | ========================== |
---|
[9734] | 131 | |
---|
| 132 | An alternative is to install the dependencies using the Anaconda_ or the Miniconda_ Python |
---|
[9680] | 133 | distributions by `Continuum Analytics`_. |
---|
[9687] | 134 | |
---|
[9734] | 135 | Miniconda_ has the advantage of allowing you to create multiple |
---|
[9687] | 136 | python environments and is particularly |
---|
[9680] | 137 | useful if you want to keep multiple versions of AnuGA. |
---|
[9627] | 138 | |
---|
[9687] | 139 | Both Anaconda_ and Miniconda_ do not require administrative rights |
---|
| 140 | to your computer and do not interfere with the Python installed |
---|
| 141 | in your system. |
---|
[9627] | 142 | |
---|
[9687] | 143 | |
---|
[9734] | 144 | Anaconda and Miniconda |
---|
[9737] | 145 | ---------------------- |
---|
[9627] | 146 | |
---|
[9734] | 147 | Once you have downloaded and installed Anaconda_ or Miniconda_ |
---|
| 148 | open a terminal (or ``cmd.exe`` on Windows). |
---|
[9680] | 149 | |
---|
[9734] | 150 | With Miniconda_, you can create |
---|
| 151 | a specific environment for AnuGA, by running:: |
---|
| 152 | |
---|
| 153 | conda create -n anuga_env python=2.7 |
---|
| 154 | source activate anuga_env |
---|
| 155 | |
---|
| 156 | |
---|
| 157 | With 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] | 162 | and 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] | 169 | Windows Dependency Installation |
---|
[9737] | 170 | =============================== |
---|
[9680] | 171 | |
---|
[9734] | 172 | We have successfully install AnuGA on windows using Gohlke Binaries and using Miniconda. |
---|
| 173 | At present we recommend using the Gohlke Binaries. |
---|
[9680] | 174 | |
---|
[9734] | 175 | Follow 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] | 179 | Alternatively 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] | 186 | GCC dependency for Windows users |
---|
[9737] | 187 | -------------------------------- |
---|
[9680] | 188 | |
---|
[9687] | 189 | Unfortunately, the ``gcc`` compiler MinGW_ included in Anaconda or |
---|
| 190 | installable via Miniconda_ doesn't have OpenMP_ support. This is required to compile |
---|
| 191 | some extension modules in AnuGA (those that have multi-threaded parallel code). |
---|
[9680] | 192 | |
---|
[9687] | 193 | We 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] | 195 | Don't forget to mark the ``openmp`` and ``gfortran`` options in the "Choose Components" part of |
---|
[9680] | 196 | the 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] | 200 | Installing the latest development version of AnuGA om Windows |
---|
| 201 | ============================================================= |
---|
[9680] | 202 | |
---|
[9737] | 203 | We suggest instaling the latest code and features, |
---|
| 204 | by installing AnuGA directly from Github_. |
---|
[9680] | 205 | We try to maintain the *master* branch stable and |
---|
[9717] | 206 | `passing all tests <https://travis-ci.org/GeoscienceAustralia/anuga_core/branches>`__, |
---|
[9680] | 207 | so it should be safe to use. |
---|
| 208 | |
---|
| 209 | First, you'll need to `install git`_. |
---|
| 210 | Then, open a terminal and run:: |
---|
| 211 | |
---|
[9717] | 212 | git clone git://github.com/GeoscienceAustralia/anuga_core.git |
---|
[9680] | 213 | |
---|
| 214 | This will fetch the source code from Github_ |
---|
| 215 | and place it in a folder called ``anuga_core`` in the directory where you ran the |
---|
| 216 | command. |
---|
| 217 | Then, just ``cd`` into the directory and run ``pip``:: |
---|
| 218 | |
---|
| 219 | cd anuga_core |
---|
| 220 | pip install --upgrade . |
---|
| 221 | |
---|
[9687] | 222 | |
---|
[9680] | 223 | Testing the install |
---|
[9627] | 224 | ------------------- |
---|
| 225 | |
---|
[9680] | 226 | |
---|
[9737] | 227 | From the source directory run ``python runtests.py``:: |
---|
[9680] | 228 | |
---|
| 229 | python runtests.py |
---|
| 230 | |
---|
| 231 | |
---|
| 232 | If you get an error message or weird result, |
---|
[9737] | 233 | please write to the `mailing list`_ or `create an issue on the github site |
---|
| 234 | <https://github.com/GeoscienceAustralia/anuga_core/issues>`__. |
---|
| 235 | |
---|
[9680] | 236 | To make it easier for us to debug you problem, please include the following |
---|
| 237 | information: |
---|
| 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] | 246 | Using pip_ to install anuga |
---|
| 247 | =========================== |
---|
| 248 | |
---|
| 249 | You can alternatively use pip_ to install the lateest released version of `anuga` |
---|
| 250 | |
---|
| 251 | Open a terminal (or ``cmd.exe`` on Windows) and run:: |
---|
| 252 | |
---|
| 253 | pip install anuga |
---|
| 254 | |
---|
| 255 | |
---|
| 256 | If you already have AnuGA installed and want to **upgrade** to a newer |
---|
| 257 | released version, use:: |
---|
| 258 | |
---|
| 259 | pip install anuga --upgrade |
---|
| 260 | |
---|
| 261 | To 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 |
---|