Installation

Maybe somebody else installed Octopus for you. In that case, the files should be under some directory that we can call PREFIX/ , the executables in PREFIX/bin/ (e.g. if PREFIX/ =/usr/local/ , the main Octopus executable is then in /usr/local/bin/octopus ); the pseudopotential files that Octopus will need in PREFIX/share/octopus/PP/ , etc.

However, you may be unlucky and that is not the case. In the following we will try to help you with the still rather unfriendly task of compiling and installing the Octopus.

Installing with Spack

Getting Spack

You can compile Octopus and all required dependencies using Spack. On many HPC systems Spack is provided to you. Follow your HPC’s instructions on how to activate and use it (Octopus specific details below). If Spack is not provided (e.g. on your laptop) you can get and activate it as follows:

git clone https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh

Installing Octopus with Spack

The simplest option to install Octopus is to run the following command:

spack install octopus

This will install Octopus with a default set of features (e.g. with MPI support) . The Spack package provides support for most of the optional features/libraries (called variant in Spack’s terminology), which can be activated with +variant or deactivated with ~variant. For example, to compile Octopus with CGAL and ELPA, run:

spack install octopus+cgal+elpa

To install a specific version, e.g. 16.2, use the following syntax (can be combined with variants):

spack install octopus@16.2
# or, if you need cgal and elpa support:
spack install octopus@16.2+cgal+elpa

To get a list of all available variants run:

spack info octopus

If an optional library is missing please open an issue.

Spack can use packages available on the system, e.g. an MPI implementation. To make use of that you first need to tell Spack about the external package, e.g. for a custom OpenMPI implementation you can run:

spack external find --not-buildable openmpi

You can now run spack install octopus... as normal and Spack will use the external MPI instead of compiling an MPI implementation itself.

Compiling Octopus and dependencies takes some time. You can expect a runtime on the order of 1 hour depending on your hardware and number of optional dependencies that you have activated.

You can install Octopus multiple times, e.g. different versions, or with different optional dependencies, using the same Spack instance.

Using Octopus installed with Spack

To use Octopus installed with Spack, run:

spack load octopus

If you have installed multiple versions of Octopus, you need to uniquely specify one. Spack will tell you about all installations. E.g. to use the one with CGAL and ELPA support shown above, you could use:

spack load octopus+cgal+elpa

Installing manually

Downloading

Download the latest Octopus version here: Octopus main .

Building

Quick instructions

For the impatient, here is the quick-start:

$ tar xzf octopus-main.tar.gz
$ cd octopus-main
$ cmake -B ./build -G Ninja --install-prefix=<INSTALLATION_DIR>

$ cmake --build ./build
$ ctest --test-dir ./build -L short-run
$ cmake --install ./build

With CMake it is now possible to use any version directly from the Gitlab repository.

$ git clone https://gitlab.com/octopus-code/octopus
$ cd octopus
$ cmake -B ./build -G Ninja
...

This will probably not work, so before giving up, just read the following more detailed pages.

For more details on building Octopus using CMake see the CMake readme.

In case you are used to compiling Octopus using Autotools, you can find more information in the Autotools migration page.