= Installing current 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 (which involves either a 500 MB download and some fixes, or a sequence of smaller downloads (see manual install)). But it can be done. == Packages to install == === 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. === Miniconda === Download and run the [http://conda.pydata.org/miniconda.html 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. ==== Build environment and Load dependencies ==== First we need to create a specific python environment (called {{{anuga_env}}} and then activate the environment via {{{ conda create -n anuga_env python=2.7 activate anuga_env }}} Now in install all the packages {{{ conda install pip nose numpy scipy netcdf4 matplotlib gdal geos }}} === GCC compiler === We need a gcc compiler to install {{{anuga}}}. We suggest that you download and install the version of [http://www.mingw.org/ MinGW] provided by [http://tdm-gcc.tdragon.net/ TDM-GCC]. Don't forget to mark the ``openmp`` and ``gfortran`` options in the "Choose Components" part of the installation. See this `excellent documentation for Windows users`_ (they even have screenshots!). ==== Manual install ==== 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. == Installing anuga == So now to actually installing anuga. === Checkout anuga via svn === First we need to get the actual anuga source code. We do this by checking out the anuga repository using subversion. I suggest installing [http://tortoisesvn.net/downloads.html 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 }}} This should produce an anuga_core directory === Compiling ANUGA === Now go to the directory anuga_core and build and install the anuga files. Fire up a cmd terminal, change to the {{{anuga_core}}} directory and run {{{ python setup.py build --compiler=mingw32 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 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. Just choose the directory to "update" and then right click and choose "tortoise update" to update the code. Then again from the {{{anuga_core}}} directory recompile the code and check the unit tests via {{{ python setup.py build --compiler=mingw32 install python runtests.py }}} === Notes === You can add a text file {{{pydistutils.cfg}}} to your C:\Users\Username directory contaning the configuration info {{{ [build] compiler=mingw32 }}} so that the command {{{ python setup.py install }}} will now build using the mingw32 compiler.