.. _installation:

.. index:: Installation

Installation
************

Installation via ``pip`` or ``conda``
=====================================

Stable versions of :program:`dynasor` are provided via `PyPI <https://pypi.org/project/dynasor/>`_ and as part of `conda-forge <https://anaconda.org/conda-forge/dynasor/>`_.
This implies that :program:`dynasor` can be installed using ``pip``::

    pip install dynasor

or using ``conda``::

    conda install -c conda-forge dynasor


Installing the development version
==================================
.. index:: Git repository

If you want to use the most recent (development) version you can install directly from the git repository::

    pip install --user git+https://gitlab.com/materials-modeling/dynasor.git


Requirements
============

:program:`dynasor` requires :program:`Python` 3.9+ and depends on the following libraries:

* `ASE <https://docs.ase-lib.org>`_ (trajectory reading)
* `MDAnalysis <https://www.mdanalysis.org/>`_ (trajectory reading)
* `NumPy <https://numpy.org/>`_ (numerical linear algebra)
* `Numba <https://numba.pydata.org/>`_ (computational efficiency)
* `SciPy <https://docs.scipy.org/doc/scipy/>`_ (convenience functions for correlations)
* `pandas <https://pandas.pydata.org/>`_ (data handling)


Numba and Intel SVML
====================
:program:`dynasor` employs :program:`numba` for the efficient calculation of correlation functions.
Some Numba versions can use Intel's Short Vector Math Library (SVML) to accelerate mathematical operations.
Support depends on the installed Numba and llvmlite versions, so consult the current `Numba performance tips <https://numba.readthedocs.io/en/stable/user/performance-tips.html#intel-svml>`_ before installing additional runtime libraries.

Run ``numba -s`` to check whether SVML is available in the active environment.
When enabled, the output includes::

    __SVML Information__
    SVML State, config.USING_SVML                 : True
    SVML Library Loaded                           : True
    llvmlite Using SVML Patched LLVM              : True
    SVML Operational                              : True

If SVML support is expected but any of these values are ``False``, verify that ``intel-cmplr-lib-rt`` is installed in the active environment and that Numba can locate the SVML shared libraries when Python starts.
Consult the current `Numba performance tips
<https://numba.readthedocs.io/en/stable/user/performance-tips.html#intel-svml>`_
for installation and troubleshooting instructions.
