cactusdynamics / cactus-rt

A C++ framework for programming real-time applications
Mozilla Public License 2.0
94 stars 20 forks source link

cactus-rt: a Linux real-time app framework

Relevant blog posts: Part 1 | Part 2 | Part 3 | Part 4

cactus_rt library

This is a library that refactors a lot of the boilerplate code needed for writing a real-time Linux application. Some key features are:

Examples

Installation instructions

Dependencies

cactus_rt the library is dependent on:

For Debian/Ubuntu:

$ sudo apt install build-essential cmake protobuf-compiler libprotobuf-dev libgtest-dev libbenchmark-dev

For building documentations, we need: doxygen.

Build

To build in debug mode:

$ make debug

To run an example:

$ sudo build/debug/examples/simple_example/rt_simple_example

To turn OFF building the examples:

$ make debug ENABLE_EXAMPLES=OFF

To turn on clang-tidy:

$ make debug ENABLE_CLANG_TIDY=ON

For compiling in release mode:

$ make release

All flags remain valid for both make debug and make release. Consult the Makefile for details on how it works as it is just a convenience wrapper on cmake. The example binaries will be located in the folder build/release instead of build/debug.

For testing like CI, you need docker installed and then you can use:

$ scripts/test-in-docker

Include from another project

To build into other projects, simply use FetchContent in your CMakeLists.txt file:

include(FetchContent)
FetchContent_Declare(
  cactus_rt
  GIT_REPOSITORY https://github.com/cactusdynamics/cactus-rt.git
  GIT_TAG        ...
)
FetchContent_MakeAvailable(cactus_rt)

# ...

target_link_libraries(myapp PRIVATE cactus_rt)

Note that if you compile your app in debug mode, cactus-rt will be compiled in debug mode due to how FetchContent works. To get cactus-rt in release mode, compile your app in release mode.

LICENSE

Open source projects and some commercial projects can use MPL 2.0.

If you need commercial, closed-sourced modifications, please obtain a license from Cactus Dynamics.

This library embeds work from Perfetto, which is licensed under Apache License, version 2.