Skip to content

lf-lang/reactor-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ceab594 · Jul 13, 2022
Jul 13, 2022
Jun 20, 2022
Oct 21, 2021
May 9, 2022
May 9, 2022
May 1, 2022
May 8, 2022
May 27, 2022
Dec 20, 2021
Oct 14, 2021
Feb 26, 2022
Jul 5, 2022

Repository files navigation

CI API docs

Reactor-C: A reactor runtime implementation in C

Documentation

To generate and view documentation, follow the following steps:

  • Install python3, pip3 and doxygen
  • Install the required Python modules:
    • pip3 install sphinx
    • pip3 install sphinx_sitemap
    • pip3 install sphinx-rtd-theme
    • pip3 install breathe
    • pip3 install exhale
  • Check out this repo and build the docs:
    • git clone git@github.com:lf-lang/reactor-c.git
    • cd reactor-c/doc-sphinx
    • make html
  • Point your browser to the generated HTML page:
    • firefox _build/html/index.html

Testing

The Github Actions tests for this repo will automatically run all the C Lingua Franca tests with each of the available schedulers. The version of the lingua-franca repo that is used to do this is specified by the lingua-franca-ref.txt file in this directory.

To create a new test, write a C program with a file name ending in "test.c" in a subdirectory of the test directory. That file should contain a main and should return 0 if the test succeeds.

  • Tests in the general subdirectory will always be run.
  • Tests in the single-threaded and multithreaded subdirectories will be run depending on parameters passed to cmake.

To run tests for the single-threaded runtime, execute the following. Note that -U is required to undefine a name that may be cached from a previous run.

  • cd build
  • cmake .. -UNUMBER_OF_WORKERS
  • cmake --build .
  • make test

To run tests for the multithreaded runtime, provide a nonzero number of workers when invoking cmake. For example:

  • cmake .. -DNUMBER_OF_WORKERS=2

To define/undefine other preprocessor definitions such as LOG_LEVEL, pass them as arguments to cmake in the same way as with NUMBER_OF_WORKERS, using the same -D/-U prefixes.