Installing current development version of ANUGA research code on Windows
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.
Python
We use python
as our programming environment together with a number of standard python packages such as numpy, scipy, matplotlib, netcdf4
. One way to install all the required packages is to use a distribution like python_xy
, Anaconda
and the related miniconda
environments. Also it should be possible to download the appropriate pre-compiled packages from http://www.lfd.uci.edu/~gohlke/pythonlibs.
I suggest miniconda
as it allows you to only install the packages that are needed (so is a bit quicker).
Miniconda
Download and run the Miniconda installer.
Be sure to choose the win32 python 2.7
version. This is the version for which we are developing.
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 :-).
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 install all the packages via
conda install python=2.7 pip nose numpy scipy netcdf4 matplotlib gdal
GCC compiler
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.
Mark the openmp
and
gfortran
options in the "Choose Components" part of the installation.
We need to force the python
installation scripts to use this compiler. Add a configuration file named pydistutils.cfg
to your home directory C:\Users\yourName
with the contents
[build] compiler=mingw32
Git
Our preferred method of installing anuga
and updating is to use git
(Though you can use subverson or download a zipped file).
To install git use the windows download link
Manually install dependencies
It is possible to install the required environment manually. You would need to install Mingw
to provide a compiler, the standard distribution of python27
and then precompiled python libraries for numpy, scipy, matplotlib, netcdf4
from a site like http://www.lfd.uci.edu/~gohlke/pythonlibs/. It would be interesting to hear feedback on this option, as there is an opportunity to use versions using the Intel Math Kernel Library, which should provide a useful increase in speed.
Download ANUGA
You should now have all the dependencies installed. You should fire up a new cmd.exe
and install anuga
You can just install the anuga
library using pip
or download the full repo with example code and manual using git
.
pip install
If just want the latest released version of the package then use pip
via
pip install anuga
If the install is successful, test the instal via
python -c "import anuga; anuga.test()"
Install via source
First we need to get the anuga source code.
Clone anuga via git
To obtain the anuga repo from github use git clone
i.e.
git clone https://github.com/GeoscienceAustralia/anuga_core.git
Checkout anuga via svn
You can also check out the anuga repository using subversion.
I suggest installing tortoise svn downloads and then checking out the following svn repository.
When you installed tortoise svn
it creates a few extra menu items to your right click menu in the file manager. Just choose "tortoise" checkout to download the code.
https://anuga.anu.edu.au/svn/anuga/trunk/anuga_core
Zipped version
Finally a zipped version of the latest development version of anuga
is available from github at https://github.com/GeoscienceAustralia/anuga_core/archive/master.zip and the latest released version at sourceforge http://sourceforge.net/projects/anuga/files/anuga_1.3/anuga_1.3.10.zip You will need to unzip the file into a directory called anuga_core
perhaps in your home directory.
Installing ANUGA
You should now have an anuga_core directory.
Now go to the directory anuga_core and build and install anuga.
Fire up a cmd terminal, 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
Note
At present the Anaconda (conda) version of gdal
is missing the gdal
data directory (presumably to save space). This will cause some error messages of the form "ERROR 4: Unable to open EPSG support file gcs.csv". It should be fine to disregard these errors messages. It would be possible to download the gdal data directory and point the GDAL_DATA
environment variable to the data directory.
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 demos in the directory anuga_core/documentation/user_manual/demos (along with the user manual) to see how to use anuga.
Updating
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