Install ANUGA on Windows using Gohlke Binaries

Stephen Roberts edited this page Aug 10, 2016 · 17 revisions

Introduction

This page describes installing ANUGA on Windows using Gohlke Binaries

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.

We use python as our programming environment together with a number of standard python packages such as numpy, scipy, matplotlib, netcdf4, gdal, nose. One way to install all the required packages is to use the standard python distribution and then install pre-compiled binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs.

In the instructions that follow, example file download names are presented as current in August 2016. As time passes these will be replaced by more up to date versions. Care is therefore needed in selecting appropriate versions. The versions that relate to Python 2.7 and Windows 32 should be the selected versions.

Before Starting:

  • Make sure you are logged on as administrator! (not just a member of the administrator's group as there seems to be differences in permissions between these users in Windows 10)

  • Make sure python, python's dependences and the gcc (mingw) compiler have all been de-installed and their files all removed before starting an installation (or reinstallation).

Python Installation

  • Download and run the Python 2.7 installer (eg python-2.7.9.msi)

  • Select Install for all users on the computer(unless it really is a one user installation)(Default setting)

  • Then select install on your directory c:\python27\ (default setting)

  • Then select python – install all features on local hard drive (this ensures pip is installed and sets path to c:\python27 and c:\python27\scripts).

Unfortunately, the pip installed with Python 2.7.9 is a very old version 1.5.3 and is not compatible with some of the gohike binaries (numpy in particular). To install an up to date version of pip type into the command line::

 pip install --upgrade pip 

this will upgrade pip to version 8.x.x as required for successful installation of the binaries.

At the moment anuga has memory problems with win64 so avoid that for the time being. You are most welcome to help track down the problems and provide a bug fix :-).

Python dependencies Installation

We need to download a number of pre-compiled python packages to support the operation of Anuga.

Download the following whl files (or later versions maintaining the ‘27’ python and ‘win 32’ version references:

From the directory where you have downloaded the whl files. At the cmd line use pip to install each of the above packages in the following order::

    pip install numpy-1.11.1+mkl-cp27-cp27m-win32.whl
    pip install scipy-0.18.0-cp27-cp27m-win32.whl
    pip install netCDF4-1.2.4 cp27 cp27m win32.whl
    pip install matplotlib-1.5.2-cp27-cp27m-win32.whl
    pip install GDAL-2.0.3-cp27-cp27m-win32.whl
    pip install nose-1.3.7-py2-none-any.whl

GCC compiler installation

We need a gcc compiler with openmp support to install anuga.

We suggest that you download and install the version of MinGW provided by TDM-GCC.

Select the ‘TDM-32’ bundle to download (this downloads as tdm-gcc-5.1.0-3.exe) and run Select the ‘create’ button Select the ‘Mingw/tdm(32bit)’ installation option Select the ‘C:\TDM-GCC-32’ (default) directory for installation Select the ‘sourceforge’ (default) mirror Click the ‘gcc’ component box to expand and tick the openmp and gfortran options. Leave all other component boxes ticked including in particular ‘add to path’.

Setup distutils

We need to force the python installation scripts to use the TDM-GCC compiler. Add a configuration file named pydistutils.cfg to your home directory C:\Users\yourName with the contents::

[build]
compiler=mingw32

If multiple users will run Anuga on this PC – add to each users home directory.

Installing ANUGA

You should now have all the dependencies installed. You should fire up a new cmd.exe and install anuga

Install current development version

Our preferred method of obtaining the most current (development) version of anuga is to use git (Though you can use subversion or download a zipped file). This will download the full repo with example code and manual using git.

Obtain git

First download git from http://git-scm.com/download/win_ and then run the windows git installer

  • Accept default install directory c:\Program Files (x86)Git
  • Accept default components
  • Accept default menu folder Git
  • Accept default ‘Use Windows Git from the Windows command prompt’
  • Accept default ‘Checkout Windows-style…’
  • Chose ‘Use windows default console window’ (not default)
  • Accept default caching and credentials manager

We then need to obtain (clone) the anuga source code using git clone From a new cmd window run the following command::

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

Build and Install ANUGA

You should now have an anuga_core directory.

Now go to the directory anuga_core and build and install anuga. Change to the anuga_core directory and run::

python setup.py install

Hopefully no errors.

Run Unit tests

From the anuga_core directory run the unit tests via::

python runtests.py

Alternative pip install of latest released version of Anuga

An alternative to installing the current development version of the code is to use pip to install the latest released version of anuga. The current (as of 10 Aug 2016) released version is 2.0.

Use pip via::

pip install anuga

If the install is successful, test the install via::

python -c "import anuga; anuga.test()"

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 (along with the user manual in anuga_core/doc) to see how to use anuga.

Updating ANUGA

From time to time, you should update your version of anuga. This is fairly easy if you used subversion or git to obtain the source. You will then just need to pull (with git) or update (with subversion).

I.e. if using git fire up cmd.exe, 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 install
python runtests.py