Setup of the Development Environment

This section described how to set up your system for a manual build of the C++ backend from source. This is highly platform dependent, and is described below for each operating system individually. In order to create a Python environment for the python backend, refer to our Python setup instructions.

Windows

In order to be able to compile the source code, you have to install the following tools and dependencies:

Build tools
  • CMake for running the build system (at least CMake 3.21 is required)

  • VCPKG for managing the C++ packages

  • Visual Studio or MinGW as a compiler. We recommend Visual Studio and will use it in further descriptions.

You can use VCPKG with our configuration file to install most C++ dependencies. Further dependencies such as Intel oneAPI MKL and Intel oneAPI TBB can be found in the github workflow and actions folder of the pairinteraction repository.

In addition, you need to adjust your path environment variable if you want to use certain tools from the command line. In order to smoothly run all the commands described on this page, add the following paths to your path environment variable:

Tool

Path to add

Cmake

C:\\path\to\cmake\bin

VCPKG

C:\\path\to\vcpkg

clang-tidy clang-format

C:\\path\to\VisualStudio\Community\VC\Tools\Llvm\bin

You can either adjust your environmental variables by using the GUI provided by the operating system, or immediately from the command line. If you want to use the Windows GUI, which we highly recommend, enter “environment properties” into the search bar and hit Enter. In the System Properties window, click “Environment Variables.” Then click on environment variables. If you want to setup the environment for all Users, search in the “System Variables”, otherwise in the “User Variables for UserName” for the variable Path. Click on Path and then on Edit. You now see a list of all paths that have been added to path. Click on Add and enter the paths to the tools you want to use in the command prompt. If you want to only change your environment variabels temporarily, you can do so by typing

set PATH=%PATH%;C:\your\path\here

Warning

Even though the command setx allows you to permanently override your path variable from the command line, we highly disencourage you from using it, as it might permamently delete parts of your system environment variable.

OS X

Before compiling the source code, you have to install the following tools and dependencies:

Build tools
  • CMake for running the build system (at least CMake 3.21 is required)

  • Homebrew and the clang compiler.

You can obtain the C++ dependencies from the github workflow.

GNU/Linux

Before compiling the source code, you have to install the following tools and dependencies:

Build tools
  • CMake for running the build system (at least CMake 3.21 is required)

  • the distribution’s package manager for managing C++ packages

  • gcc or clang compiler for compiling C++

A complete lists of all C++ dependencies dependencies can be found in the Dockerfiles that we use for continuous integration. The Dockerfiles are located in the docker branch.

Tips independent of the OS

Note

Intel oneAPI MKL is an optional dependency that provides optimized linear algebra routines and the FEAST eigensolver. If this dependency is available, it is important that a compatible version of Intel oneAPI TBB is available as well. For example, on Debian, the package intel-oneapi-mkl-devel-2023.1.0 and intel-oneapi-tbb-devel-2021.13 are compatible that can be installed using APT from the Intel repository. To allow the build system to find these oneAPI libraries, one has to set the CMAKE_PREFIX_PATH and LD_LIBRARY_PATH environment variables. To do so, the libraries provide scripts that can be sourced before running CMake. On Debian, source /opt/intel/oneapi/mkl/latest/env/vars.sh and source /opt/intel/oneapi/tbb/latest/env/vars.sh will set the environment variables.

Note

Advanced examples for the usage of CMake to build the software for various operating systems can be found in the workflows directory of the pairinteraction repository.