Install ANUGA on Windows using Miniconda

Stephen Roberts edited this page Nov 23, 2017 · 22 revisions

Introduction

anuga is developed on Linux (Ubuntu) and hence the installation on Linux (Ubuntu) is more streamlined. But it is possible to install on windows. First you need to install the required python environment, then download the anuga source and then compile and test. The most time consuming part of the process is getting the python environment setup.

This page describes how to use miniconda as it allows you to only install the packages that are needed (so is a bit quicker).

We use python as our programming environment together with a number of standard python packages such as numpy, scipy, matplotlib, netcdf4, gdal.
One way to install all the required packages is to use a distribution like python_xy, Anaconda and the related miniconda environments. Also it is possible to download the appropriate pre-compiled packages using the Gohlke Binaries.

But our preferred option is now Miniconda.

Miniconda

Download and run the Miniconda installer.

Choose either the win64 or the win32 python 2.7 version. Python 2.7 is the version for which we are developing.

To ensure the path is set correctly, you should run the activate.bat script. It lives in the miniconda\scripts directory. The miniconda directory should be located in your home directory.

You will have to run the activate.bat script every time you open up the command line to run anuga. I have setup a shortcut on the desktop to open the cmd.exe and run this batch script.

Anuga python package dependencies

Assuming conda is now installed, we need to install a number of other packages, via the conda install command.

Fire up cmd.exe and run the activate.bat script. Now install all the packages via

conda install -c conda-forge python=2.7 git pip nose numpy scipy netcdf4 matplotlib gdal mingwpy

Clone anuga via git

Our preferred method of installing anuga and updating is to use git (Though you can use subverson or download a zipped file).

To obtain the anuga repo from github use git clone i.e.

    git clone https://github.com/GeoscienceAustralia/anuga_core.git

Install ANUGA

You should now have an anuga_core directory.

Now go to the directory anuga_core and build and install anuga. From the cmd terminal, change to the anuga_core directory and run

   python setup.py build --compiler=mingw32
   python setup.py install --skip-build 

Hopefully no errors.

You can avoid adding the options --compiler=mingw32 and --skip-build if you edit the file setup.cfg in the anuga_core directory and set the build option to compiler=mingw32. Then you can simply run

   python setup.py install

Run Unit tests

From the anuga_core directory run the unit tests via

   python runtests.py

Conclusion

Hopefully all the unit tests pass. As this is bleeding edge there are sometimes a small number of failures as this is a work in progress. Have a look at the examples in the directory anuga_core/examples and anuga_core/doc to see how to use anuga.

Updating

From time to time you should update your version of anuga.

Fire up cmd.exe and run activate.bat, change into the anuga_core directory and run

git pull

Then re-install the latest version of the code and check the unit tests via::

   python setup.py clean
   python setup.py build --compiler=mingw32
   python setup.py install --skip-build 
   python runtests.py

or simply

   python setup.py install
   python runtests.py

if you have changed the file setup.cfg to use the compiler mingw32 for building anuga.