Install third-party software

Required software:

  • Compiler with full C++-17 support
    • gcc >= 8
    • clang >= 7
  • cmake >= 3.14
  • gsl >= 1.15 (GNU scientific library)
  • fftw3 >= 3.3.1
  • libtiff >= 4.0.2
  • libcerf >= 2.0 (complex error function, maintained by us)
  • python3 >= 3.8
  • python3-dev python3-pip python3-numpy python3-matplotlib
  • python3-lmfit (optional, for some fit scripts)
  • boost >= 1.65 (see note below)
  • Qt6 (required modules are listed below)

From libboost, we need the library components iostreams and program_options. Internally, the CMake command to find boost::iostreams may add a dependence on boost::regex. Furthermore, we need a number of header-only components, including algorithm/string, bimap, geometry, numeric/interval, polymorphic_cast.

Recommended software:

  • For generating a man page:
    • perl
  • For Matplotlib usetex mode:
    • texlive-latex-extra (and dependencies)
    • dvipng
    • cm-super-minimal

All these can be easily installed on most Linux distributions using the system’s package manager. Below are a few examples for several selected operating systems. Note that other distributions (Fedora, Mint, etc) may have different commands for invoking the package manager and slightly different names of packages (like boost instead of libboost etc). Besides that, the installation should be very similar.

Debian / Ubuntu / …

Install required packages:

$ sudo apt-get install build-essential git cmake \
  libgsl-dev libfftw3-dev libtiff5-dev \
  python3 python3-dev python3-numpy python3-matplotlib python3-lmfit \
  libboost-dev libboost-iostreams-dev \
  libboost-program-options-dev libboost-regex-dev \
  qt6-default libqt6designercomponents5 qttools5-dev \
  libqt6svg5-dev libqt6opengl5-dev

OpenSuse

Install required packages:

$ sudo zypper install gcc-c++ git-core cmake gsl-devel \
  libboost_*-devel fftw3-devel python3-devel python3-numpy-devel \
  python3-matplotlib python3-lmfit libtiff-devel \
  libqt6-qtbase-devel libqt6-qttools-devel libqt6-qtsvg-devel

MacOS

MacOS comes with no package manager, but fortunately there are several free and well maintained package managers that significantly simplify the installation of third-party open-source software. Here, we provide recepies for Homebrew and MacPorts.

Homebrew

Note: Homebrew installs all packages in

/usr/local
, while MacPorts prefers the
/opt/local
folder. Depending on your package manager selection, the corresponding path has to be specified explicitly during the BornAgain CMake configuration as explained in the build instructions.

Install Homebrew as explained here and then install all BornAgain dependencies by running the following commands:

brew install git cmake fftw gsl python boost libtiff qt6
pip3 install matplotlib numpy

Finally, add Qt to your path environment variable:

export PATH=/usr/local/opt/qt6/bin/:$PATH

Macports

Install Macports by downloading and running the installer from here. Then install all BornAgain dependencies by running the following command:

sudo port install git cmake fftw-3 gsl py3-matplotlib py3-numpy\
 py3-lmfit tiff boost qt6-mac

Minimal Qt installation via command line

The Qt framework with arbitrary components can be installed via command line. To perform a minimal installation, first download a Qt installer for the platform from the official website.

Remember to set up a Qt account beforehand; this is required for any installation.

Define the following variables:

  • Path to the downloaded Qt installer
    qt_installer='/path/to/Qt-installer'
    
  • Root path for Qt installation
    qt_root='/Qt/installation/path'
    
  • Qt credentials
    qt_email='myemail@some.org'
    qt_passw='myPassWord'
    

For a minimal Qt installation (only the components for gcc 64bit), use

$qt_installer --root "$qt_root" --email "$qt_email" --pw "$qt_passw" \
  --auto-answer telemetry-question=No,AssociateCommonFiletypes=No --accept-licenses \
  --no-default-installations install qt.qt6.623.gcc_64

where qt.qt6.623.gcc_64 is the name of the component to install.

Note that during the installation some questions must be answered (e.g. with Accept or Yes).

For searching Qt components (e.g. search for Qt6 components qt.qt6), use

$qt_installer --email "$qt_email" --pw "$qt_passw" search qt.qt6

After the installation, under the Qt root directory one finds the detailed installation log, InstallationLog.txt, and Qt maintenance tool, MaintenanceTool.

Qt maintenance tool can be used to remove or update components; e.g. for removing Qt Creator, use

$qt_root/MaintenanceTool remove qt.tools.qtcreator

For further information, see the official guide to the Qt-installer command-line interface: