Installation

PyPI

This package is available as “adrt” on PyPI. You can install it using pip:

$ python -m pip install adrt

or on Windows:

PS> py -m pip install adrt

For more details on pip, consult its user guide. Before installing it is best to ensure your package manager is up to date (upgrade pip).

Conda-Forge

This package can also be installed into a Conda environment from the conda-forge channel:

$ conda install -c conda-forge adrt

For more information, consult the project documentation. The packages distributed by conda-forge for Linux and macOS have OpenMP multithreading support enabled (see further discussion below).

Source

The package can also be built from source code, which is available from our GitHub repository. This makes it possible to customize the compiler flags used when building the native extensions. In particular, OpenMP support can be enabled as discussed below.

The code requires C++17 support to build and makes use of a few compiler built-in functions for performance. We require recent GCC, Clang, or MSVC.

To install the package from source with default compiler flags, navigate to the directory containing your copy of the source code and run (note the trailing .):

$ python -m pip install .

Running Tests

Once you have an installed version of the package, the test suite can help confirm whether the routines are operating correctly. We use pytest as a test runner. Once the package is installed, navigate to the root directory of the repository and run:

$ python -m pip install -r tests/requirements.txt
$ python -m pytest

However, if you are trying to modify the package or make a contribution see the information under Development.

OpenMP Support

Several routines in this package support parallelization with OpenMP. Using these features requires both compiler support and an OpenMP runtime library. Most compilers already support OpenMP and most Linux platforms will likely have an OpenMP runtime installed.

To enable OpenMP you must pass the necessary flags to your C++ compiler via the CFLAGS environment variable. For GCC the correct flag is -fopenmp. In this case, run pip as:

$ CFLAGS="-O3 -fopenmp" python -m pip install .

This will install an OpenMP-enabled copy of the package. Other compilers will require different flags to be passed through CFLAGS and LDFLAGS.

After building, you can verify that your installed copy supports OpenMP with adrt.core.threading_enabled().