1.1. Download and installation on Linux (Fedora and Ubuntu)

1.1.1. Disclaimer

HORTON has been tested on Fedora and Ubuntu Linux. If you are running another Linux distribution, some of the instructions below may not work.

1.1.2. Download the code

The latest stable source code release of HORTON can be downloaded here:

Choose a suitable directory, e.g. ~/build, download and unpack the archive

mkdir -p ~/build
cd ~/build
curl -kLO https://github.com/theochem/horton/releases/download/2.1.0b1/horton-2.1.0b1.tar.gz
tar -xvzf horton-2.1.0b1.tar.gz
cd horton-2.1.0b1

1.1.3. Dependencies for building, installing and testing HORTON

In order to compile and test HORTON, you need to install relatively recent versions of the following programs/libraries:

1.1.3.1. Installing dependencies with a package manager

With popular Linux distributions, most of these dependencies can be installed with a package manager:

  • Ubuntu Linux 16.04:

    sudo apt-get install gcc g++ gfortran python-dev python-nose libatlas-base-dev \
                python-scipy cython python-h5py python-sympy \
                python-matplotlib libxc-dev curl python-pip
    

    Note that Ubuntu 16.04 does not have up-to-date packages for all dependencies. LibInt2 must be compiled manually as explained in Installing dependencies manually. (The beta version of LibInt2 that comes with Ubuntu 16.04 is compiled with a too low LIBINT2_MAX_AM_ERI value.)

  • Ubuntu Linux 15.04 and 14.04:

    sudo apt-get install gcc g++ gfortran python-dev python-nose libatlas-base-dev \
                python-scipy cython python-h5py python-sympy \
                python-matplotlib libxc-dev curl python-pip
    pip install --user --upgrade numpy
    

    Note that Ubuntu 15.04 and 14.04 do not have up-to-date packages for all dependencies. Hence, some are installed with PIP. LibInt2 must be compiled manually as explained in Installing dependencies manually.

  • Fedora Linux 24:

    sudo dnf install gcc gcc-c++ gcc-gfortran redhat-rpm-config python-devel \
                python-nose atlas-devel python2-numpy \
                python2-scipy Cython python2-h5py sympy \
                python2-matplotlib libxc-devel libint2-devel \
                curl python-pip
    
  • Fedora Linux 22 and 23:

    sudo dnf install gcc gcc-c++ gcc-gfortran redhat-rpm-config python-devel \
                python-nose atlas-devel numpy scipy Cython \
                h5py sympy python-matplotlib libxc-devel \
                libint2-devel curl python-pip
    

1.1.3.2. Installing dependencies manually

If the package manager of your Linux distribution does not have the desired packages (or the right versions), you have to install them manually, e.g. download and execute an installer, or download and unpack a binary package. On HPC environments a compilation from scratch is recommended.

BLAS

In principle, any BLAS implementation may be used. In case of a custom build, some environment variables must be set prior to building HORTON, as discussed in Compilation and installation.

LibXC

The directory tools/qa of the HORTON source tree contains scripts to download and build LibXC, which will work on most systems:

./tools/qa/install_libxc-2.2.2.sh

This results in a LibXC library suitable for compiling HORTON. If this fails, consult your local Linux guru to build LibXC. For more info about LibXC, check the website: http://www.tddft.org/programs/octopus/wiki/index.php/Libxc

LibInt2

The directory tools/qa of the HORTON source tree contains scripts to download and build LibInt2, which will work on most systems:

./tools/qa/install_libint-2.0.3.sh

The compilation of LibInt2 takes a few minutes and results in a library suitable for compiling HORTON. If this fails, consult your local Linux guru to build LibInt2. For more info about LibInt2, check the website: https://github.com/evaleev/libint

Python dependencies

In some cases, PIP, the Python package manager, may be a good choice to install the most recent versions of the Python packages in the list of dependencies. Examples are given above for Ubuntu and Fedora.

1.1.4. Compilation and installation

1.1.4.1. Build and install

The regular build and install is done as follows:

./setup.py install --user

The setup.py script makes a reasonable attempt at configuring the compiler and linker settings for the LibXC, LibInt2 and BLAS libraries. However, this does not work in all environments. In case of a failure, or if a configuration other than the default is desired, read the following section.

1.1.4.2. Overriding default compiler/linker settings for LibXC, LibInt2 and BLAS

The manual configuration of the compiler and linker settings is described here: Controlling dynamic/static linking against LibXC, LibInt2 and BLAS. You should read this section if the default build and install has failed or if you would like to specify which libraries to use.

1.1.4.3. Runtime configuration

You need to set the following variable in ~/.bashrc to use HORTON:

export PATH=${HOME}/.local/bin:${PATH}

# If you used special link options for LibXC, LibInt2 or BLAS, something along
# the following lines may also be needed:
# export LD_LIBRARY_PATH=some_dir/with/shared_objects/${LD_LIBRARY_PATH}

If you run HORTON on a headless node, i.e. without an X server, you need to configure Matplotlib to use a backend that does not require a graphical user interface. (See http://matplotlib.org/faq/usage_faq.html#what-is-a-backend for more details on the Matplotlib backends.) This can be done by adding the following line to your matplotlibrc file:

backend: agg

This file is located in either ${HOME}/.matplotlib or ${HOME}/.config/matplotlib.

1.1.5. Reference atoms

Several parts of HORTON make use of reference atomic computations. When compiling a stable release from a .tar.gz file these reference atoms are already included in the release. When building a development version of HORTON, please refer to Additional steps required to build the development version of HORTON on how to build these reference atoms.

1.1.6. Running the tests

To test if HORTON was installed properly and if it can be accessed from any directory, you should change to a directory outside of the source tree and call nosetests as follows:

(cd ~; nosetests -v horton)

1.1.7. Building the documentation

1.1.7.1. Dependencies

If you are interested in generating the documentation from source, the following packages are also needed:

1.1.7.2. Installing the dependencies with a package manager and PIP

  • Ubuntu Linux 16.04:

    sudo apt-get install python-sphinx python-sphinx-rtd-theme doxygen \
              python-docutils
    
  • Ubuntu Linux 15.04 and 14.04:

    sudo apt-get install doxygen python-docutils
    pip install --user --upgrade sphinx sphinx_rtd_theme breathe
    
  • Fedora Linux 24:

    sudo dnf install python2-sphinx python2-sphinx_rtd_theme doxygen \
              python2-breathe python-docutils
    
  • Fedora Linux 22 and 23:

    sudo dnf install doxygen python-docutils
    pip install --user --upgrade sphinx sphinx_rtd_theme breathe
    

You must also manually build LibXC as explained in Installing dependencies manually, to generate the list of DFT functionals in the documentation.

1.1.7.3. Actual build

The documentation is compiled and viewed as follows:

(cd doc; make html; firefox _build/html/index.html)

1.1.8. Development tools

If you want to contribute to the development of HORTON, you’ll need to install at least the following dependencies:

For the python development tools, we generally recommend installing the latest versions with pip.

  • Ubuntu Linux 16.04:

    sudo apt-get install cppcheck git
    pip install --user --upgrade pylint pycodestyle pydocstyle coverage GitPython
    
  • Ubuntu Linux 15.04 and 14.04:

    sudo apt-get install cppcheck git
    pip install --user --upgrade pylint pycodestyle pydocstyle coverage GitPython
    
  • Fedora Linux 24:

    sudo dnf install cppcheck git
    pip install --user --upgrade pylint pycodestyle pydocstyle coverage GitPython
    
  • Fedora Linux 22 and 23:

    sudo dnf install cppcheck git
    pip install --user --upgrade pylint pycodestyle pydocstyle coverage GitPython