Getting started

Maul Anim is a C library. It builds with CMake, installs as a CMake package and a pkg-config module, and needs nothing but a C compiler and the C standard library.

Requirements

The public headers are plain C17 and C++17, so programs that include them need neither a C23 compiler nor C at all.

Build and install

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build
cmake --install build --prefix /path/to/prefix

Then, from CMake:

find_package(maul-anim REQUIRED CONFIG)
target_link_libraries(game PRIVATE maul-anim::maul-anim)

or through pkg-config, pkg-config --cflags --libs maul-anim. A project can also add the source tree with add_subdirectory; tests and benchmarks are then off by default. test/consumer/ is a complete program that uses only the installed package.

Build options

Option Default Effect
MAUL_ANIM_BUILD_SHARED OFF A shared library instead of a static one.
MAUL_ANIM_OFFLINE ON The offline side: builders, compression, the JSON forms, training, the glTF and FBX importers. A game that ships prebuilt files turns it off.
MAUL_ANIM_SIMD auto auto builds x86-64 for AVX2 and FMA and arm64 for NEON; scalar builds portable code that runs on any CPU. Both give the same results.

The CPU check

An AVX2 build stops on its first vector instruction on a CPU without AVX2 and FMA (before about 2013). A program checks once, before any other call, that the CPU runs the build:

const char* backend = NULL;
bool runs = maniCheckCpu(&backend);   // before any other call
// !runs: this CPU cannot run the build's backend (backend names it,
// "avx2" say): refuse to start, or load a build made with
// -DMAUL_ANIM_SIMD=scalar, which runs on any CPU with the same results.

Configure prints the backend, and the installed package names it (maul-anim_SIMD_BACKEND in CMake, the description in pkg-config), so a package meant for older machines is built with -DMAUL_ANIM_SIMD=scalar.

The model

Where to go next