Install the third party software
To build BornAgain, several open-source software packages must be installed.
- compiler with C++-11 support (clang versions >= 3.6, 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]
- python-2.7, python-devel, python-numpy-devel, python-matplotlib
- Qt5 >= 5.4
- libyaml-cpp >= 0.5
- eigen3 >= 2.91.0
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.
# Installing required packages $ sudo apt-get install build-essential git cmake libgsl0-dev libboost-all-dev \ libfftw3-dev python-dev python-numpy python-matplotlib libtiff5-dev libeigen3-dev \ libyaml-cpp-dev python-yaml # Installing Qt5 $ sudo apt-get install qt5-default libqt5designercomponents5 qttools5-dev qtscript5-dev libqt5svg5-dev # If you want to compile BornAgain to use with Python3 $ sudo apt-get install python3 python3-dev python3-numpy-devel python3-matplotlib python3-yaml
# Installing required packages $ sudo zypper install gcc-c++ git-core cmake gsl-devel boost-devel fftw3-devel \ python-devel python-numpy-devel python-matplotlib python-matplotlib-tk libtiff-devel \ eigen3-devel libyaml-cpp_0.5 yaml-cpp-devel python-PyYAML # Installing Qt5 $ sudo zypper install libqt5-qtbase-devel libqt5-qttools-devel libqt5-qtscript-devel libqt5-qtsvg-devel
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 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 eigen3-devel sudo yum -y install python-devel numpy sudo yum -y install qt5-qtbase-devel qt5-qttools-devel qt5-qtsvg-devel sudo yum -y install yaml-cpp-devel python-yaml # Install 'devtoolset' with additional development tools # See https://www.softwarecollections.org/en/scls/rhscl/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 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'.
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 eigen libyaml yaml-cpp eigen $ sudo pip install pyyaml
Add qt5 to the path
$ export PATH=/usr/local/opt/qt5/bin/:$PATH
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 py27-matplotlib py27-numpy \ tiff boost qt5-mac eigen3 libyaml py-yaml yaml-cpp
In the next section we explain the alternative way of Qt5 installation using a binary installer from developers site.