Giter Club home page Giter Club logo

signaloid-demo-general-c-submodules's Introduction

[Add to signaloid.io] [Add to signaloid.io]

C Project With Submodules Example

This is a minimal example to demonstrate how to use other repositories in a C project in 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. The repository also contains a submodule in the src/submodule-dir-example folder. The submodule is a different repository that implements functions that are used in the main C source file (src/main.c).

Getting Started

  1. Fork this repository.
  2. Edit README.md to adapt the “Add to signaloid.io” button's URL.
  3. Edit the code and configure the build.

Repository Structure

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.

Here is the structure of this repository:

.
├── LICENSE
├── README.md
└── src
    ├── config.mk
    ├── main.c
    └── submodule-dir-example
        ├── [submodule files]
        ├── [more submodule files]

Configuring the Build (config.mk)

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.

In this repository, the file src/config.mk contains

SOURCES = main.c submodule-dir-example/src/batt.c submodule-dir-example/src/estimation.c
CFLAGS = -Isubmodule-dir-example/src

This tells the Signaloid Cloud Developer Platform to build the files main.c, submodule-dir-example/src/batt.c, and submodule-dir-example/src/estimation.c using the compiler flag -Isubmodule-dir-example/src (i.e., adding the submodule's src directory in the includes path).

Libraries

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 in math.h);
  • libUncertain: a library that exposes functionalities of uncertainty-tracking computer architectures (with function prototypes and other definitions in uncertain.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.

🍰 Accessing Your GitHub Repository from the Signaloid Cloud Developer Platform

There are two ways to access a GitHub repository from the Signaloid Cloud Developer Platform.

Option 1: Using the “Add to signaloid.io” Button

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.

Option 2: Manually Adding Repositories to the Signaloid Cloud Developer Platform

A second option is to manually add a repository to the Signaloid Cloud Developer Platform. To do so, follow these steps:

  1. 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.
  2. 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).
  3. Give the Signaloid Cloud Developer Platform permission to access your repositories, using the blue GitHub "Login" button.
  4. Click on the green button (Connect to Repositories). All your repositories will appear in a list. Add the relevant repository.
  5. Your repository should now appear in the UI.

signaloid-demo-general-c-submodules's People

Contributors

angelospl avatar komagr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.