Skip to content

Commit

Permalink
Update INSTALL.rst to suggest miniforge
Browse files Browse the repository at this point in the history
  • Loading branch information
stoiveroberts committed May 14, 2022
1 parent c9ceb68 commit 428bc37
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 130 deletions.
190 changes: 108 additions & 82 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,139 +1,165 @@


******************
ANUGA Installation
******************
Installation
============

.. contents::


Introduction
============
------------

ANUGA_ is a python package with some C extensions (and an optional fortran
ANUGA is a python package with some C extensions (and an optional fortran
extension). This version of ANUGA is run and tested using python 3.8.x


Dependencies
============

ANUGA requires the following python packages:
------------

numpy scipy matplotlib nose cython netcdf4 dill future gitpython gdal pyproj pymetis triangle Pmw mpi4py ipython
ANUGA requires python 3.X (X>6) and the following python packages:

.. code-block::
numpy scipy matplotlib pytest cython netcdf4 dill future gitpython gdal pyproj pymetis triangle Pmw mpi4py pytz ipython meshpy Pmw pymetis
Installing the latest version on Ubuntu
===================================================
ANUGA is developed on Ubuntu and so we recommend Ubuntu as your production environment
(though ANUGA can be installed on MacOS and Windows using `Miniconda` or `MiniForge`)

ANUGA is developed on Ubuntu. The preferred way to install the dependencies is
to use a combination of the standard ubuntu ``apt`` method and python pip install.
Ubuntu Install with MiniForge3
------------------------------

From your home directory run the following commands which will download anuga to a directory `anuga_core`, install dependencies, install anuga and run the unit tests::
A clean way to install the dependencies for ANUGA is to use Anaconda,
or Miniconda Python distributions by Continuum Analytics, or the `conda-forge`
distribution Miniforge3.

git clone https://github.com/anuga-community/anuga_core.git
sudo bash anuga_core/tools/install_ubuntu_20_04.sh

Note: This will set ``python`` as ``python3`` and part of the bash shell will run as sudo so will ask for a password. If you like you can run the package installs manually, run the commands in the script ``anuga_core/tools/install_ubuntu_20._04.sh``

You should now install and check the installation of anuga by running the unit tests via::

cd anuga_core
python setup.py install --user
python runtests.py
Installing the latest version on Ubuntu as a developer
===================================================

If you wish to install ANUGA and make changes to the code, the installation procedure is as above, but with the setup step as follows::

python setup.py develop --user
This installation has the advantage of allowing you to create multiple
python environments and is particularly
useful if you want to keep multiple versions of ANUGA

Alternative Ubuntu Install with conda
==========================
Indeed the most stable install is via the `conda-forge` channel
which is easily available using the Miniforge

An alternative is to install the dependencies using the Anaconda_ or the Miniconda_ Python
distributions by `Continuum Analytics`_.
These conda environments do not require administrative rights
to your computer and do not interfere with the Python installed in your system.

Miniconda_ has the advantage of allowing you to create multiple
python environments and is particularly
useful if you want to keep multiple versions of ANUGA.
But it is necessary to install a few packages via :code:`sudo apt-get`.

Both Anaconda_ and Miniconda_ do not require administrative rights
to your computer and do not interfere with the Python installed
in your system. But it is necessary to install a few packages via `sudo apt-get` in particular
a compiler and openmpi for parallel code.
Follow these steps:

Follow these steps::
.. code-block:: bash
sudo apt-get update -q
sudo apt-get install gfortran git wget
sudo apt-get install libopenmpi-dev openmpi-bin
sudo apt-get install git wget
Download and install `Miniconda` if you haven't already::
Download and install Miniforge if you haven't already:

wget http://repo.continuum.io/miniconda3/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh
.. code-block:: bash
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3.sh
Create `anuga_env` conda environment::
Create a conda environment `anuga_env` (or what ever name you like):

.. code-block:: bash
conda update conda
conda create -n anuga_env -c conda-forge python pip numpy scipy cython netcdf4 nose matplotlib gdal dill future gitpython
conda create -n anuga_env python=3.8 pip numpy scipy cython netcdf4 pytest matplotlib gdal dill future gitpython pytz mpi4py meshpy Pmw pymetis
conda activate anuga_env
pip install mpi4py triangle Pmw pymetis
Download, install and test `anuga`::
This will setup an environment using python 3.8. `anuga` has be tested on 3.7, 3.8. 3.9.

Now Download, install and test `anuga`:

.. code-block:: bash
git clone https://github.com/anuga-community/anuga_core.git
cd anuga_core
python setup.py install
python runtests.py
pip install -e .
pytest
Remember, to use ANUGA you will have to activate the `anuga_env` via the command `conda activate anuga_env`.
You might even like to set this up in your `.bashrc` file.

Installing on Ubuntu using apt and pip
---------------------------------------

You can install the `anuga` dependencies via a combination of the
standard ubuntu ``apt`` method and python pip install.

From your home directory run the following commands which will download anuga
to a directory `anuga_core`, install dependencies, install anuga and run the unit tests:

.. code-block:: bash
git clone https://github.com/anuga-community/anuga_core.git
sudo bash anuga_core/tools/install_ubuntu_20_04.sh
Note: This will set ``python`` as ``python3`` and part of the bash shell will run as
sudo so will ask for a password. If you like you can run the package installs manually,
run the commands in the script ``anuga_core/tools/install_ubuntu_20._04.sh``

You should now install anuga:
.. code-block:: bash
cd anuga_core
pip install -e .
And finally check the installation by running the unit tests via:
.. code-block:: bash
pytest
Windows 10 Install using 'Ubuntu on Windows'
==========================
--------------------------------------------

Starting from Windows 10, it is possible to run an Ubuntu Bash console from Windows. This can greatly simplify the install for Windows users. You'll still need administrator access though. First install an ubuntu 20_04 subsystem. Then just use your preferred ubuntu install described above.
Starting from Windows 10, it is possible to run an Ubuntu Bash console from Windows.
This can greatly simplify the install for Windows users.
You'll still need administrator access though. First install an ubuntu 20_04 subsystem.
Then just use your preferred ubuntu install described above.



Windows Installation using MiniForge
------------------------------------

Native Windows Installation using Miniconda
===============================
We have installed `anuga` on `windows` using miniforge.

We have installed `anuga` on `windows` using miniconda.
You can download MiniForge manually
from the MiniForge site https://github.com/conda-forge/miniforge:

Run the following powershell instructions to download miniconda and the MPI files (for parallel runs). You can also just download manually::
Alternatively you can download and install miniforge via CLI commands:

Start-FileDownload "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" C:\Miniconda.exe; echo "Finished downloading miniconda"
Start-FileDownload "https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisetup.exe" C:\msmpisetup.exe; echo "Finished downloading msmpi"
Start-FileDownload "https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisdk.msi" C:\msmpisdk.msi; echo "Finished downloading msmpisdk"
From cmd shell install mpi (for parallel runs) via the instructions::
Run the following powershell instruction to download miniforge.

msiexec.exe /i "C:\msmpisdk.msi" /qn
C:\msmpisetup.exe -unattend
set PATH=%PATH%;"C:\Program Files\Microsoft MPI\bin"
Then install miniconda::
.. code-block:: bash
Start-FileDownload "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" C:\Miniforge.exe; echo "Finished downloading miniforge"
From a standard `cmd` prompt then install miniconda via:

.. code-block:: bash
C:\Miniconda.exe /S /D=C:\Py
C:\Py\Scripts\activate.bat
Install conda and pip packages::
Install conda-forge packages:

.. code-block:: bash
conda install python=3.7 gdal nose numpy cython scipy netcdf4 matplotlib dill future gitpython
pip install mpi4py triangle Pmw pymetis
conda install -c msys2 libpython m2w64-toolchain
conda create -n anuga_env python=3.8 gdal pytest numpy cython scipy netcdf4 matplotlib dill future gitpython mpi4py meshpy Pmw pymetis
conda activate anuga_env
conda install libpython m2w64-toolchain
Download ANUGA and install::
Download ANUGA and install:

.. code-block:: bash
git clone https://github.com/anuga-community/anuga_core.git
cd anuga_core
python setup.py install
cp windows_setup.cfg setup.cfg
pip install -e .
And finally test the installation::
And finally test the installation:

python runtests.py
.. code-block:: bash
Loading

0 comments on commit 428bc37

Please sign in to comment.