= Installing current version of ANUGA research code on Ubuntu = == Packages to install == Install the following packages via the commands {{{ sudo apt-get install subversion python-dev python-numpy python-scipy python-matplotlib netcdf-bin libnetcdf-dev }}} Be sure that the version of {{{python}}} you are using is 2.7. This is the version for which we are developing. === Pre Ubuntu 12.04 === Also need to install the following packages {{{ sudo apt-get install python-argparse sudo apt-get install python-profiler }}} === Scientific python === We use scientific python to provide netcdf support in python. The default python-scientific provided by Ubuntu is version 2.8, and this leads to segmentation faults (at least on 32 bit machines) in Ubuntu 12.04. So we need to install scientific python version 2.9.1 from source. Get Scientific python 2.9.1 source. {{{ wget https://sourcesup.renater.fr/frs/download.php/3420/ScientificPython-2.9.1.tar.gz . }}} You will need to manually extract via the tar command, i.e. {{{ tar xvf ScientificPython-2.9.1.tar.gz }}} You should end up with a directory {{{ScientificPython-2.9.1}}} Change into the directory and install scientific python via {{{ python setup.py build sudo python setup.py install }}} == Installing anuga == Now we should have installed all the packages necessary to run 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. From your home directory run: {{{ svn checkout https://anuga.anu.edu.au/svn/anuga/trunk/anuga_core anuga_core }}} This should produce an anuga_core directory in your home directory === Setup PYTHONPATH === We need to tell python where the anuga source code is located. This is done via the {{{PYTHONPATH}}} environment variable. Put the following in your .bashrc file (if you use the bash shell). {{{ export PYTHONPATH=/home/******/anuga_core/source }}} where the {{{******}}} should be replaced by the name of your home directory. '''Note the inclusion of {{{/source}}} in the name of the file.''' With some versions of Linux you need to put this command in the file {{{.profile}}} You should rerun your .bashrc file with {{{ source .bashrc }}} Actually it is usually safer to fire up a new terminal to see if you have been successful in setting up the PYTHONPATH You can check your PYTHONPATH with the command {{{ printenv PYTHONPATH }}} === Compile ANUGA Code === Now go to the directory anuga_core and compile the anuga files via: {{{ python compile_all.py }}} === 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. From your {{{anuga_core}}} directory update the anuga code via the subversion command {{{ svn update }}} Then again from the {{{anuga_core}}} directory recompile the code and check the unit tests via {{{ python compile_all.py python test_all.py }}}