This is a minimal example to get you started with setting up C repositories in GitHub that you can then run on the Signaloid Cloud Developer Platform. The repository contains a C source file in the src
folder which gets compiled and executed by the Signaloid Cloud Developer Platform.
- Fork this repository.
- Edit
README.md
to adapt the βAdd to signaloid.ioβ button's URL. - Edit the code and configure the build.
The Signaloid Cloud Developer Platform expects any GitHub repository you wish to run to have a src
folder containing your source code. By default, the Signaloid Cloud Developer Platform will compile all C and C++ source files (extensions *.c
, *.cc
, *.cpp
, *.c++
, *.cp
, and *.cxx
) in the src
folder and will link them into a single binary and run that on your choice of uncertainty-tracking processor.
You can modify the default build behavior described above by providing a file named config.mk
.
For C repositories, there are two relevant variables in config.mk
:
SOURCES
, a list of C source files to compile;CFLAGS
, the options that are passed to the C compiler.
If the SOURCES
variable is not set, the Signaloid Cloud Developer Platform compiles all the C and C++ files in the src
folder.
The following example shows a src/
folder for a repository, containing one C source file (main.c
) and a config.mk
to modify the build parameters.
src/
βββ config.mk
βββ main.c
In this repository, the file src/config.mk
contains
SOURCES = main.c
CFLAGS = -DDEBUG
This tells the Signaloid Cloud Developer Platform to build the main.c
file using the compiler flag -DDEBUG
(i.e., defining the symbol DEBUG
).
Place your header files in the src
folder. This folder is part of the build include path.
During the build process, the Signaloid Cloud Developer Platform links the compiled object files against the following libraries:
libc
: the C standard library;libm
: the C math library (with function prototypes and other definitions inmath.h
);libUncertain
: a library that exposes functionalities of uncertainty-tracking computer architectures (with function prototypes and other definitions inuncertain.h
).
libUncertain
allows applications to access and inject uncertainty information into the underlying microarchitectures. You can find out more about libUncertain
in the libUncertain documentation.
There are two ways to access a GitHub repository from the Signaloid Cloud Developer Platform.
This first option makes it easiest for you (and other GitHub users) to run your repository on the Signaloid Cloud Developer Platform. Edit the snippet at the top of this README.md
to include the URL of your Git repository.
The text you need to change is (replacing the text <your repository URL here>
):
[<img src="https://assets.signaloid.io/add-to-signaloid-cloud-logo-dark-v6.svg#gh-dark-mode-only" alt="[Add to signaloid.io]" height="30">](https://signaloid.io/repositories?connect=<your repository URL here>#gh-dark-mode-only)
[<img src="https://assets.signaloid.io/add-to-signaloid-cloud-logo-light-v6.svg#gh-light-mode-only" alt="[Add to signaloid.io]" height="30">](https://signaloid.io/repositories?connect=<your repository URL here>#gh-light-mode-only)
Next, go to the repository's Github page and click on the βAdd to signaloid.ioβ button.
A second option is to manually add a repository to the Signaloid Cloud Developer Platform. To do so, follow these steps:
- Log in to the Signaloid Cloud Developer Platform at https://signaloid.io/. If you do not already have an account, you can create one for free in just three clicks.
- Click on the
Repositories
tab in the menu on the left side of the screen (you might need to go through the menu icon on mobile screens). - Give the Signaloid Cloud Developer Platform permission to access your repositories, using the blue GitHub "Login" button.
- Click on the green button (Connect to Repositories). All your repositories will appear in a list. Add the relevant repository.
- Your repository should now appear in the UI.