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
For detailed installation instructions and information on the Devito Docker image library please follow the docker/README.md
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.
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]
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]
extras : optional dependencies for Jupyter notebooks, plotting, benchmarking
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.
# 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]
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]