Installation

Acquiring KSL

KSL can be obtained by cloning the repository from the GitHub site:

git clone git@github.com:shift-dynamics/ksl.git

Required tools

Optional dependencies

Linux

On most Linux distributions the above packages can be installed using the distribution’s package manager.

Arch Linux:

pacman -S meson ninja check
# optional: Eigen and the documentation tools
pacman -S eigen doxygen python-sphinx python-breathe python-sphinxcontrib-bibtex

Ubuntu / Debian-based Linux Distributions:

apt-get install meson ninja-build check
# optional: Eigen and the documentation tools
apt-get install libeigen3-dev doxygen
pip install sphinx breathe sphinxcontrib-bibtex

Macintosh

On a Macintosh, the dependencies can be installed using the brew package manager:

brew install meson ninja check

Windows

KSL has not been tested on Windows machines.

Building KSL

To build the KSL library, from within the top directory of the repository, issue the following commands:

meson setup build
meson compile -C build

To build in release mode (disables asserts and debug output)

meson setup build --buildtype=release -Db_ndebug=true

Build options

Options are passed to meson setup or changed later with meson configure build -D<option>=<value>:

option

default

purpose

tests

auto

build the test suite (needs check)

docs

auto

add the doxygen and docs documentation targets

bench

disabled

build the comparison with Eigen described in Performance compared to Eigen

The quaternion products use SSE2 and SSE3 processor instructions on x86-64 processors, which handle two double precision numbers at once. To use the plain C versions instead, for example to compare results, define KSL_NO_SIMD:

meson setup build -Dc_args=-DKSL_NO_SIMD

Functions are compiled for the processor family that the compiler targets by default. To let the compiler use every instruction available on the build machine, add -Dc_args=-march=native. The resulting program may not run on older processors.

Using KSL from another project

See Getting Started for adding KSL to a meson project or linking it directly.

Running Tests

After building as described above, then issue the command:

meson test -C build

Building documentation

The documentation is built with doxygen, sphinx, breathe and sphinxcontrib-bibtex. Doxygen extracts the API as XML, and sphinx renders it with breathe:

meson compile -C build docs

The HTML pages are written to build/doc/html. The site is published to GitHub Pages from master by the CI workflow.