Installing dolfin-adjoint

Note: If you are looking to install the (deprecated) dolfin-adjoint/libadjoint library, visit the dolfin-adjoint/libadjoint webpage.

What is the difference between dolfin-adjoint/dolfin-adjoint and dolfin-adjoint/libadjoint?

Docker images (all platforms)

Docker allows us to build and ship consistent high-performance dolfin-adjoint installations with FEniCS for almost any platform. To get started, follow these 2 steps:

  1. Install Docker. Mac and Windows users should install the Docker Toolbox (this is a simple one-click install) and Linux users should follow these instructions.

If running on Mac or Windows, make sure you run the following commands inside the Docker Quickstart Terminal.

dolfin-adjoint with FEniCS:

You can run dolfin-adjoint with the pre-built images at:

ghcr.io/dolfin-adjoint/dolfin-adjoint

First the FEniCS Docker script:

docker run -ti -v $(pwd):/root/shared --name=name_of_container ghcr.io/dolfin-adjoint/dolfin-adjoint

which can then be restarted at an later instance with:

docker container start -i name_of_container

To update the image call:

docker pull ghcr.io/dolfin-adjoint/dolfin-adjoint

and create a new docker container.

PIP (all platforms)

Install dolfin-adjoint and its Python dependencies with pip:

python3 -m pip install dolfin-adjoint

Test your installation by running:

python3 -c "import fenics_adjoint"

Optional dependencies:

Source code

The source code of dolfin-adjoint is available on https://github.com/dolfin-adjoint/dolfin-adjoint.