Introduction¶
MCKL is a header-only library. All headers files are under the mckl
directory. To include all functionalities,
#include <mckl/mckl.hpp>
There are a few other headers that include a subset of functionalities of MCKL, each documented in a subsequent chapter in this manual.
Optional Runtime Library¶
In addition to the header-only library, one can optionally build and use a runtime library. To build the library, one need a recent version of the NASM assembler and the CMake program. The library is only supported on x86-64 CPUs and 64-bit Unix and compatible systems. To build and install the library,
cd /path/to/mckl/source
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/prefix/to/install/directory
make lib
make install
To use and link to the library in a user program, say prog.cpp,
c++ -DMCKL_USE_ASM_LIB=1 -o prog prog.cpp -lmckl
The runtime library provides optimized implementation of selected vectorized random number generators (See Vectorized Random Number Generating and Counter-Based Random Number Generators). Performance of the header-only implementation might vary considerably depending on the compiler.
Further, one can set the configuration macro MCKL_USE_ASM_VMF to use an
assembly implementation of selected vectorized math functions when Intel MKL
is unavailable (see Vectorized Functions). This feature is highly
experimental. These functions are fast, but have slightly lower accuracy for
some values of input than the standard library or Intel MKL in high accuracy
mode.