All Projects → johnmcfarlane → Cnl

johnmcfarlane / Cnl

Licence: bsl-1.0
A Compositional Numeric Library for C++

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Cnl

Spirit
Atomistic Spin Simulation Framework
Stars: ✭ 67 (-83.12%)
Mutual labels:  cmake, simulation
Fairroot
C++ simulation, reconstruction and analysis framework for particle physics experiments
Stars: ✭ 41 (-89.67%)
Mutual labels:  cmake, simulation
Openloco
An open source re-implementation of Chris Sawyer's Locomotion
Stars: ✭ 504 (+26.95%)
Mutual labels:  cmake, simulation
esm
Lightweight communicating state machine framework for embedded systems
Stars: ✭ 21 (-94.71%)
Mutual labels:  cmake, embedded
Polyfem
A polyvalent C++ FEM library
Stars: ✭ 147 (-62.97%)
Mutual labels:  cmake, simulation
Openrct2
An open source re-implementation of RollerCoaster Tycoon 2 🎢
Stars: ✭ 10,115 (+2447.86%)
Mutual labels:  cmake, simulation
Ros Academy For Beginners
中国大学MOOC《机器人操作系统入门》代码示例 ROS tutorial
Stars: ✭ 861 (+116.88%)
Mutual labels:  cmake, simulation
Flutter embedded
Embedded Flutter
Stars: ✭ 123 (-69.02%)
Mutual labels:  cmake, embedded
Sparkle
🎇 A modern particle engine running on GPU, using c++14 and OpenGL 4.4.
Stars: ✭ 162 (-59.19%)
Mutual labels:  cmake, simulation
Stuntrally
The main repository containing Stunt Rally sources and game data. A 3D racing game based on VDrift and OGRE with track editor.
Stars: ✭ 314 (-20.91%)
Mutual labels:  cmake, simulation
Hexapod
Blazing fast hexapod robot simulator for the web.
Stars: ✭ 370 (-6.8%)
Mutual labels:  simulation
Protolude
A sensible starting Prelude template.
Stars: ✭ 372 (-6.3%)
Mutual labels:  safe
Nnom
A higher-level Neural Network library for microcontrollers.
Stars: ✭ 382 (-3.78%)
Mutual labels:  embedded
Mumble
Mumble is an open-source, low-latency, high quality voice chat software.
Stars: ✭ 4,418 (+1012.85%)
Mutual labels:  cmake
Ark
ARK is a lightweight, agility, elastic, distributed plugin framework written in C++,make it easier and faster to create your own application service.
Stars: ✭ 370 (-6.8%)
Mutual labels:  cmake
Ecosim
An interactive ecosystem and evolution simulator written in C and OpenGL, for GNU/Linux.
Stars: ✭ 382 (-3.78%)
Mutual labels:  simulation
Cget
C++ package retrieval
Stars: ✭ 370 (-6.8%)
Mutual labels:  cmake
Sdsandbox
This provides a sandbox simulator for training a self-driving car. This uses Unity for simulation and Python with Keras and Tensorflow for training. Recently updated to work on Python 3.4+ and Keras 2+
Stars: ✭ 369 (-7.05%)
Mutual labels:  simulation
Cmake Templates
Some CMake Templates (examples). Qt, Boost, OpenCV, C++11, etc 一些栗子
Stars: ✭ 368 (-7.3%)
Mutual labels:  cmake
Opensim Core
SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
Stars: ✭ 392 (-1.26%)
Mutual labels:  simulation

Compositional Numeric Library

Test Join the chat at https://gitter.im/cppcnl/community Download

The Compositional Numeric Library (CNL) is a C++ library of fixed-precision numeric classes which enhance integers to deliver safer, simpler, cheaper arithmetic types. Documentation can be found here.

Requirements

The latest version of CNL requires a C++20-compatible tool chain. (Version 1.x supports C++11.) CNL is tested on the following systems:

Linux

Tested:

  • GCC 5 - 10 / Clang 5 - 11
  • CMake 3.5.1

OS X

Tested:

Windows

Tested:

  • Visual Studio 2019 Version 16.7
  • CMake 3.8.0

Instructions

Download

The library is hosted on GitHub:

git clone https://github.com/johnmcfarlane/cnl.git
cd cnl

Build

The CNL library is comprised of headers found in the src directory. CMake scripts are provided.

To build and install CNL on your system:

mkdir build && cd build
cmake ..
cmake --build . --target install

Test

The test suite uses CMake and depends on Google Test and Google Benchmark. Optional integration tests use Boost.Multiprecision and Boost.SIMD.

  1. Conan can be used to pull in essential dependencies:

    conan profile new --detect --force default
    conan profile update settings.compiler.libcxx=libstdc++11 default
    conan install --build=missing ..
    
  2. Configure the project for development

    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_cnl_INCLUDE:FILEPATH="$(pwd)"/conan_paths.cmake ..
    
  3. Build tests:

    cmake --build . --target test-all
    
  4. Run tests:

    ctest -R test-unit
    
  5. Run benchmarks:

    ctest -R test-benchmark
    

Additional build system generation options:

  1. To describe CNL build options:

    cmake -LH ..

  2. Then to apply an option, e.g. to disabled exceptions:

    cmake -DCNL_EXCEPTIONS=OFF ..

Integration

The API is exposed through headers in the include directory. Add this to your system header list and include, e.g.:

// to use a specific type:
#include <cnl/scaled_integer.h>

// or to include all CNL types:
#include <cnl/all.h>

Example Projects

Examples of projects using CNL:

  • CDSP - Compositional DSP Library for C++;
  • BrewBlox firmware - firmware for a brewery controller
  • cnl_example - minimal CMake-based project which uses CNL as a dependency.

Further Reading

Contact Information

All feedback greatly appreciated.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].