The BigDFT-suite Package
========================

BigDFT is a suite containing many different programs, all of which are
maintained on our
`gitlab page <http://https://gitlab.com/l_sim/bigdft-suite/>`_
Instead of building the code with one single configure line, the code is
built as a suite of different packages.

.. figure:: /static/buildprocedure.png
   :scale: 50 %
   :alt: buildprocedure.png
   :align: left

In this scheme we might see how the BigDFT code itself is separated. The figure
describes the interdependencies among these packages. Let us describe each of
the packages which are depicted here. we have here separated the packages into
*upstream* contributions and *native* contributions.

We start by describing the packages that are part of the internal development
efforts.

Native packages
---------------

-  :ref:`futile <futile:futile_index>`:  a library
   handling most common FORTRAN low-level operations like memory
   management, profiling routines, I/O operations. It also supports yaml
   output and parsing for fortran programs. It further provides wrappers
   routines to MPI and linear algebra operations. This library is
   extensively used in BigDFT packages;
-  ``atlab``: A library which is associated to the description of the
   operation on atomic structures. It contains the handling of the structural
   information and manipulations of it. It should be agnostic of the
   DFT formalism of the code employing it.
-  ``CheSS``: A module for performing Fermi Operator Expansions via
   Chebyshev Polynomials, released as a separate project on
   `Launchpad <https://launchpad.net/chess>`_
-  ``psolver``: a flexible real-space Poisson Solver based on
   Interpolating Scaling Functions. It constitutes a fundamental
   building block of BigDFT code, and it can also be used separately and
   linked to other codes. It also internally uses the ``futile`` library
   for the I/O.
-  ``libABINIT``: this is a subsection of files coming from
   `ABINIT <http://www.abinit.org>`_ software package, to which
   BigDFT has been coupled since the early days. It handles different
   parts like symmetries, ewald corrections, PAW routines, density and
   potential mixing routines and some MD minimizers. Also some XC
   functionals, initially natively implemented in the ``ABINIT`` code,
   are also coded in this library. This library uses the ``futile``
   code through the (experimental) PAW section.
-  `BigDFT <https://www.bigdft.org>`_: the core routines for computing
   electronic structure;
-  ``spred``: a library for structure prediction tools that is compiled
   on top of BigDFT routines.

Upstream packages
-----------------

-  ``libyaml``: this library is used to parse the
   `yaml markup language <http://yaml.org/>`_ that is used in BigDFT input
   files;
-  ``PyYaml``: this is a `Python module <https://pyyaml.org/>`_ which makes it
   possible to convert yaml into python objects. This part is mainly
   used for postprocessing purposes as BigDFT logfile also comes in yaml
   format;
-  ``libXC``:
   this `library <http://www.tddft.org/programs/octopus/wiki/index.php/Libxc>`_
   handles most of the XC functionals that can be invoked from
   BigDFT runs;
-  ``GaIn``: this library handles analytic integrals of common operators
   between Gaussian Functions. It does not perform low-level operations
   and can be linked separately;

Optional packages
-----------------

Sometimes on large supercomputers it can be difficult to manage and install
supplementary packages. For this reason, we offer a number of optional packages
that can be activated by the installer. The full set of options can be found
in the `modulesets` directory. This directory regroups the information about
the packages which can (or have to) be installed before the native bigdft suite
packages. Here a non exhaustive list:

- ``ase``: a python package for running DFT calculations with different codes.
- ``biopython``: a python package for bioinformatics.
- ``dill``: a python package for serializing complex objects.
- ``fftw``: fast fourier transform.
- ``netlib``: linearl algebra operations (better to use system's libraries)
- ``openmm``: for classical molecular dynamics simulations.
- ``openbabel``: for chemical informatics.
- ``rdkit``: another python code for chemical informatics.
- ``sirius``: a DSL for electronic structure calculations.
- ``spglib``: a library for handling crystal symmetries.
- ``wannier90``: for computing maximally localized Wannier functions.

Build System
------------

In the older versions of the code, all these different packages were compiled
with the same configuration instructions. With the present version, each of
the code sections described above can be considered as a separate
package, which improves modularity between code
sections and reduces side-effects. In addition, each package can now be
compiled with different installation instructions.

We are using a build suite tool based on the
`Jhbuild <https://wiki.gnome.org/action/show/Projects/Jhbuild?action=show&redirect=Jhbuild>`_ project
which is regularly employed by developers of ``gnome`` project. We have
re-adapted/added some of the functionality of the ``jhbuild`` package to
meet the needs of our package.
