Troubleshoot a source build

CMake configuration fails

Configure BornAgain in a new, empty build directory. Reusing a CMake cache after changing the compiler, Python interpreter, or dependency locations can produce misleading results.

Check the first CMake error and verify the dependency paths described in the source-build instructions. The selected compiler, Python interpreter, dependencies, and installation paths are recorded in bornagain_build.log in the build directory after configuration.

When requesting help, include the full CMake output, bornagain_build.log, and CMakeFiles/CMakeConfigureLog.yaml when present.

Compilation fails

Run a verbose build from the build directory:

cmake --build . --verbose

Report the first compiler or linker error and include the complete output. Errors later in the log are often consequences of the first failure.

Python crashes during import

A fatal Python error or crash while importing a self-built BornAgain can mean that the module was built against a different Python installation. Print the interpreter used to run scripts:

python -c "import sys; print(sys.executable)"

Then configure BornAgain in a new build directory with that interpreter:

cmake .. -DPython3_EXECUTABLE=/path/to/python

Tests fail

First rerun the failed tests without parallel execution:

ctest -j1 --rerun-failed --output-on-failure

List the current test names and rerun one failed test verbosely:

ctest -N
ctest -V -R 'TestNamePattern'

If Python tests load another BornAgain installation, start a clean shell and remove the old installation from PYTHONPATH. When reporting a failure, attach Testing/Temporary/LastTest.log from the build directory.