Install the third party software

To build BornAgain, several open-source software packages must be installed.

  • compiler with C++-14 support (e.g. GCC versions >= 4.9)
  • cmake >= 2.8.12
  • boost library >=1.48
  • GNU scientific library >= 1.15
  • fftw3 library >= 3.3.1
  • libtiff >= 4.0.2 [or cmake -DBORNAGAIN_TIFF_SUPPORT=OFF]
  • python3, python3-devel, python3-numpy-devel, python3-matplotlib
  • Qt5 >= 5.4

All required packages can be easily installed on most Linux distributions using the system's package manager. Below we give a few examples for several selected operating systems. Please 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.


Ubuntu, Debian

# Installing required packages
$ sudo apt-get install build-essential git cmake libgsl0-dev libboost-all-dev \
libfftw3-dev  python3 python3-dev python3-numpy-devel python3-matplotlib libtiff5-dev

# Installing Qt5
$ sudo apt-get install qt5-default libqt5designercomponents5 qttools5-dev qtscript5-dev libqt5svg5-dev


# Installing required packages
$ sudo zypper install gcc-c++ git-core cmake gsl-devel boost-devel fftw3-devel \
python3-devel python3-numpy-devel python3-matplotlib libtiff-devel

# Installing Qt5
$ sudo zypper install libqt5-qtbase-devel libqt5-qttools-devel  libqt5-qtscript-devel libqt5-qtsvg-devel


Centos 7, RedHat 7

CentOS-7, RHE7 ship with gcc-4.8.5 (which doesn't have full C++-11 support), we require GCC>=4.9.0. Installation instruction below also explains how to bring newer compiler on your system.

# install extra packages
sudo rpm -Uvh

# install BornAgain dependencies
sudo yum -y install make cmake3 gcc-c++ 
sudo yum -y install fftw-devel boost-devel gsl-devel libtiff-devel eigen3-devel 
sudo yum -y install python3-devel numpy 
sudo yum -y install qt5-qtbase-devel qt5-qttools-devel qt5-qtsvg-devel

# Install 'devtoolset' with additional development tools
# See for more details

sudo yum install centos-release-scl  # if you are on CentOS
# or
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms # if you are on RHEL

# Install newer compiler
sudo yum install devtoolset-4-gcc-c++

# Enable newer compiler (you will have to run this command for every new terminal)
scl enable devtoolset-4 bash

# Make sure, that gcc gives you version 5.0 or higher
g++ --version


In the following (cmake <BornAgainSource>; make; make install) you will have to use 'cmake3' command, instead of 'cmake'.

Mac OS X

MacOS X comes with no package manager, but fortunately there are several free well settled package managers which simplifies significantly the installation of third-party open-source software. Below we provide recepies for MacPorts and Homebrew package managers. If you don't have your own preferencies, give a try to Homebrew.


Install Homebrew as explained here and then install all packages BornAgain depends on by running in terminal following command

$ brew install git cmake fftw gsl python homebrew/science/matplotlib numpy \
boost qt5 libtiff

Add qt5 to the path

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


Install MacPorts by downloading the dmg and running the system's installer. Install BornAgain dependencies by running in terminal following command

$ sudo port install git cmake fftw-3 gsl py3-matplotlib py3-numpy \
tiff boost qt5-mac
Homebrew installs all packages in /usr/local, while MacPorts prefers /opt/local directory. Depending on your package manager selection, corresponding path has to be specified explicitely during BornAgain CMake configuration as explained in Build and Install the framework section.


In the next section we explain the alternative way of Qt5 installation using a binary installer from developers site.