3. Runtime Dependencies#

The followings are dependencies used during the runtime of detkit. Note that, among these dependencies, OpenMP is required, while the rest of the dependencies are optional.

3.1. OpenMP (Required)#

detkit requires OpenMP, which is typically included with most C++ compilers.

For Linux users:#

By installing a C++ compiler such as GCC, Clang, or Intel, you also obtain OpenMP as well. You may alternatively install libgomp (see below) without the need to install a full compiler.

For macOS users:#

It’s crucial to note that OpenMP is not part of the default Apple Xcode’s LLVM compiler. Even if you have Apple Xcode LLVM compiler readily installed on macOS, you will still need to install OpenMP separately via libomp Homebrew package (see below) or as part of the open source LLVM compiler, via llvm Homebrew package.

For Windows users:#

OpenMP support depends on the compiler you choose; Microsoft Visual C++ supports OpenMP, but you may need to enable it explicitly.

Below are the specific installation for each operating system:

sudo apt install libgomp1 -y
sudo yum install libgomp -y
sudo dnf install libgomp -y
sudo brew install libomp

Note

In macOS, for libomp versions 15 and above, Homebrew installs OpenMP as keg-only. To utilize the OpenMP installation, you should establish the following symbolic links:

libomp_dir=$(brew --prefix libomp)
ln -sf ${libomp_dir}/include/omp-tools.h  /usr/local/include/omp-tools.h
ln -sf ${libomp_dir}/include/omp.h        /usr/local/include/omp.h
ln -sf ${libomp_dir}/include/ompt.h       /usr/local/include/ompt.h
ln -sf ${libomp_dir}/lib/libomp.a         /usr/local/lib/libomp.a
ln -sf ${libomp_dir}/lib/libomp.dylib     /usr/local/lib/libomp.dylib

3.2. Perf Tool (Optional)#

detkit can count the FLOPs of the computations, if the argument flops=True is used in the functions (see API Reference). To this end, the Linux Performance Counter tool, known as perf should be installed.

sudo apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`
sudo yum group install perf
sudo dnf group install perf

Attention

The perf tool is not available in macOS and Windows.

Grant permissions to the user to be able to run the perf tool:

sudo sh -c 'echo -1 >/proc/sys/kernel/perf_event_paranoid'

Test if the perf tool works by

perf stat -e instructions:u dd if=/dev/zero of=/dev/null count=100000

Alternatively, you may also test perf tool with detkit by

>>> import detkit
>>> detkit..get_instructions_per_task()

If the installed perf tool is configured properly, the output of either of the above commands should not be empty.