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

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 make, but must be run manually.

Optionally, the following tools can be needed:

  • Graphviz, to visualize project hierarchy with doxygen;
  • hugo, to generate web documentation.

Other build instructions

See

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 .. -DDEV=ON

This activates additional build targets. In particular, all contents of the auto directory is regenerated if out of sync.