+++
title = "Configure"
weight = 10
+++

## Configure for development

We recommend, and assume in the following,
that development is done under Linux.
Expert developers who prefer to work under another operating system
will have to adapt the following on their own.

#### Python

We need a Python installation, preferable in a virtual environment
so that we easily install and uninstall modules, and switch between
different versions of Python. See
- user-oriented [Python installation](/deploy/py) instructions;
- more on [Pyenv](pyenv).

#### Other prerequisites

Developers need additional tools, beyond those required for building BornAgain from source:
- Swig, to regenerate `auto/Wrap`;
- ccache, to avoid unnecessary recompilation;
- Ruby, which provides the embedded interpreter erb, to regenerate `auto/Examples` and `auto/MiniExamples`;
- Doxygen, to autogenerate the API documentation;
- clang-format, to enforce proper source formatting.

Of these, clang-format is not controlled by the build system, but must be run
manually.

Optionally, the following tools can be needed:
- Graphviz, to visualize project hierarchy with doxygen;
- hugo, to generate [web documentation](/dev/dev/webdoc).

#### Other build instructions

See
- user-oriented [build instructions](/deploy/build/unix);
- our Continuous Integration (CI) setup in [.gitlab-ci.yml]({{% url-src %}}/.gitlab-ci.yml).

#### CMake with ccache and ninja

To wrap compilers by ccache, and to replace Make by Ninja,
add the following to your `.bashrc`:
```
alias cm='cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
```
Then use `cm` instead of `cmake ..`.

#### CMake parameterization

As developer, configure CMake with
```
cmake .. -GNinja -DDEV=ON
```
This activates additional build targets.
In particular, all contents of the `auto` directory is regenerated if out of sync.
