= Installing current version of ANUGA research code on Windows = == 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}}}. ==== Python xy ==== So first install [http://code.google.com/p/pythonxy/ python xy]. This will be a large download, maybe 500 MB or more, but will provide a complete installation (well see NetCDF4 note below) of {{{python}}} for our needs . You should first remove any other version of {{{python}}} and {{{mingw}}} that may be on your system. The {{{python xy}}} package is currently only 32 bits, but this will still work on 64 bit Windows. Be sure to choose the win32 {{{python 2.7}}} version. This is the version for which we are developing. ==== Netcdf4 Note ==== Check that netcdf is available. From a command line, try {{{ python -c "import netCDF4" }}} If no error occurs then netCDF4 is available and you can disregard the rest of this note. But unfortunately version 2.7.3.1 (April 2013) {{{python xy}}} seems to be missing {{{netCDF4}}}. __Please let us know if later versions are ok.__ If it is missing then you need to install another package to cover this loss. For this we can use the precompiled scientific python binaries from [http://www.lfd.uci.edu/~gohlke/pythonlibs/#scientificpython]. I suggest you choose {{{ScientificPython-2.9.2.win32-py2.7.‌exe}}} to install. To test this install try: {{{ python -c "import Scientific.IO.NetCDF" }}} ==== 64 bit ==== At the moment {{{python xy}}} is only 32 bit, but there seems to be a promise that a 64 bit distribution is not too far away. There is a 64 bit python distribution package from Enthought, but is free only to academic users. So at present we recommend win32 {{{python xy}}}. ==== 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 === Setup PYTHONPATH === We need to tell python where the anuga source code is located. This is done via the {{{PYTHONPATH}}} environment variable. For instance, if your {{{anuga_core}}} directory was located at {{{ C:\Users\Steve\anuga_core }}} then you should add {{{ C:\Users\Steve\anuga_core\source }}} to your {{{PYTHONPATH}}} Environment variables are accessed via {{{control panel -> advanced system settings -> Environment Variables}}} and then add a new Environment variable {{{PYTHONPATH}}} with value {{{C:\Users\Steve\anuga_core\source}}} (or what ever is appropriate for your installation) === Compiling ANUGA === Now go to the directory anuga_core and compile the anuga files. Fire up a cmd terminal, change to the {{{anuga_core}}} directory and run {{{ python compile_all.py }}} Check that all the files have been compiled correctly. There should be an "OK" at the end of each separate compile command. === Run Unit tests === From the anuga_core directory run the unit tests via: {{{ python test_all.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 compile_all.py python test_all.py }}}