Install third-party software

Required software:

  • Compiler with C++-14 support (e.g. gcc>= 4.9 or clang>=3.4)
  • cmake (>= 3.1)
  • boost library (>= 1.48)
  • fftw3 library (>= 3.3.1)
  • gsl (GNU scientific library, >= 1.15)
  • libtiff library (>=4.0.2)
  • python3, python3-devel, python3-numpy, python3-matplotlib
  • Qt5 (>=5.4; required modules are listed below)

All required packages can be easily installed on most Linux distributions using the system’s package manager. Below are 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.

  • Install required packages:
    $ sudo apt-get install build-essential git cmake libgsl-dev libboost-all-dev \
      libfftw3-dev python3 python3-dev python3-numpy python3-matplotlib libtiff5-dev
  • Install Qt5:
    $ sudo apt-get install qt5-default libqt5designercomponents5 qttools5-dev \
      libqt5svg5-dev

  • Install required packages:
    $ sudo zypper install gcc-c++ git-core cmake gsl-devel libboost_*-devel fftw3-devel \
      python3-devel python3-numpy-devel python3-matplotlib libtiff-devel
  • Install Qt5
    $ sudo zypper install libqt5-qtbase-devel libqt5-qttools-devel libqt5-qtsvg-devel

CentOS 7 and Redhat 7 ship with gcc-4.8.5, which does not fully support C++ 14. This instruction thus also explains how to get a newer compiler on your system.

  • Install extra packages:
    $ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • Install BornAgain dependencies:
    $ sudo yum -y install make cmake3 gcc-c++
    $ sudo yum -y install fftw-devel boost-devel gsl-devel libtiff-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 Devtoolset-4 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 the new 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

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.

Important 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 Build and install BornAgain.

Homebrew

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

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

Finally, add Qt to your path environment variable:

$ export PATH=/usr/local/opt/qt5/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 \
  tiff boost qt5-mac