Build dependencies

The default build requires:

  • Python >= 3.10;
  • a compiler with C++20 support;
  • CMake >= 3.26 for the Ninja generator;
  • Ninja;
  • Git;
  • FFTW3;
  • GSL;
  • libcerf with its shared C++ library;
  • libheinz >= 4.1;
  • libformfactor >= 0.5.1.

Prepare an isolated Python environment with the packages listed below.

Python packages

The installed BornAgain package requires:

  • matplotlib >= 3.6.0;
  • numpy >= 1.21.2;
  • packaging >= 20.0;
  • vtk >= 9.4.0.

These versions are declared by the wheel and installed by package managers.

For tests and examples, also install:

  • corner >= 2.1.0;
  • emcee >= 3.1.0;
  • fabio >= 0.13.0;
  • lmfit >= 1.1.0;
  • periodictable >= 1.6.1;
  • scipy >= 1.7.2;
  • tqdm >= 4.15.0.

The HDF5 import snippets use:

  • h5py >= 3.6.0;
  • hdf5plugin >= 2.0.0;
  • nexusformat >= 0.7.2.

Building the wheel requires:

  • pip >= 19.2;
  • setuptools >= 75.8.1;
  • auditwheel >= 5.3.0 (Linux only);
  • patchelf >= 0.14.5 (Linux only).

CMake reports missing packages during configuration. With -DBA_TESTS=OFF, it checks only the wheel tools. To disable the wheel too, use -DBA_TESTS=OFF -DBA_PY_PACK=OFF.

Developer build

A build configured with -DDEV=ON additionally requires:

  • a SWIG 4.5.x release to regenerate the Python API wrappers;
  • Ruby with ERB to regenerate the examples;
  • Doxygen with Graphviz (dot) to generate the API documentation.

Other tools depend on the task:

  • clang-format for developer checks;
  • ccache to reduce rebuild times (optional);
  • Hugo for web documentation.

Linux and macOS

Install the compiler, build tools, FFTW3, GSL, and libcerf with the operating system’s package manager. Package names vary by distribution. Install libheinz and libformfactor from source when suitable packages are not available.

On macOS, Homebrew provides the external tools and libraries:

brew install git cmake ninja fftw gsl libcerf

Pass non-standard installation prefixes to CMake through CMAKE_PREFIX_PATH. See Developer options for the settings.