Skip to content

demianmnave/CML

Repository files navigation

msvc-latest msvc-clangcl-latest msvc-17-10

Configurable Math Library

For CML version 1, please see https://github.com/demianmnave/CML1.

License

The Configurable Math Library (CML) is released under the Boost Software License, Version 1.0..

Using the CML

As it is header-only, it is simple enough to copy the cml header directory into your project and setup your build to reference it. Users of CMake 3.15+ can also leverage cmake --install ... and find_package(CML CONFIG) to integrate CML into a CMake project.

Compiler requirements

The CML requires a compiler with C++17 support.

Building and Running Tests

With plain CMake

To run the test suite from a command prompt using a Makefile-like generator, start in your build directory and execute:

cmake -S \<path to cml-root\> -G{generator name} -DBUILD_TESTING=On -DCMAKE_BUILD_TYPE=Release

Then, to build the tests (again from your build directory):

cmake --build . --config Release

You can run the full test suite from your build directory by executing:

ctest -C Release

If you have multiple CPUs (e.g. 4 in this case), you can speed things up a bit using, for example:

cmake --build . --config Release -- -j4
ctest -C Release -j4

With CMake presets

See CMakePresets.json for the default base presets, as well as the predefined configure and build presets. Note that all of the predefined configure presets generate a build system under <cml-root>/.build/<preset-name>.

To see the available configure presets, execute:

cmake --list-presets

To see the available build presets, execute:

cmake --build --list-presets

To use one of the predefined configure presets, for example cml-dev-msvc17-clangcl-mt-s to use the Visual Studio 2022 IDE with ClangCL:

cmake --preset=cml-dev-msvc17-clangcl-mt-s