Download and Install Devito

There are two main approaches to installing Devito.

  • Docker, for those looking for the least-friction way to try Devito

  • Virtual environment, for those looking to use Devito as part of a project alongside other packages

Docker

For detailed installation instructions and information on the Devito Docker image library please follow the docker/README.md

Virtual environment

venv route

Devito is available as a pip package in PyPI.

Create a Python virtual environment

python3 -m venv <your_venv_name>

Source the newly created venv. This needs to be repeated each time a new terminal is open.

source <your_venv_name>/bin/activate

To install the latest Devito release along with any additional dependencies, follow:

pip install devito
# ...or to install additional dependencies:
# pip install devito[extras,mpi,nvidia,tests]

To install the latest Devito development version, without the tutorials, follow:

pip install git+https://github.com/devitocodes/devito.git
# ...or to install additional dependencies:
# pip install git+https://github.com/devitocodes/devito.git#egg=project[extras,mpi,nvidia,tests]

Additional dependencies:

  • extras : optional dependencies for Jupyter notebooks, plotting, benchmarking

  • tests : optional dependencies required for testing infrastructure

  • mpi : optional dependencies for MPI (mpi4py)

  • nvidia : optional dependencies for targetting GPU deployment

Note that here, you do not need to get the code via git clone. Depending on your needs, this might also be the recommended setup for using Devito in a production-like environment. However, since some components need to be compiled before use, this approach may be sensitive to the C/C++ compilers present on your system and the related environment, including what other packages you might have installed.

conda route

Please install either Anaconda or Miniconda.

# Create new env with the name devito
conda create --name devito
# Activate the environment
conda activate devito

and finally, install Devito along with any extra dependencies:

pip install devito
# ... or to install additional dependencies
# pip install devito[extras,mpi,nvidia,tests]

For developers

First clone Devito:

git clone https://github.com/devitocodes/devito.git
cd devito

and then install the requirements in your virtual environment (venv or conda):

# Install requirements
pip install -e .
# ...or to install additional dependencies
# pip install -e .[extras,mpi,nvidia,tests]

Facing issues?

If you are facing any issues, we are happy to help on Slack. Also, have a look at our list of known installation issues.