Coder Social home page Coder Social logo

c_bagel's Introduction

c_bagel

Bagel (Biologically inspired Graph-Based Language) is a cross-platform graph-based dataflow language developed at the Robotics Innovation Center of the German Research Center for Artificial Intelligence (DFKI-RIC) and the University of Bremen. It runs on (Ubuntu) Linux, Mac and Windows.

This library provides a C implementation to load, save, modify, and execute Bagel graphs.

General {#general}

The main user documentation of Bagel can be found at: https://github.com/dfki-ric/bagel_wiki/wiki

The API documentation of c_bagel can be build in the doc sub-folder with the make command. The documentation is build into the doc/build folder.

Test

To compile the test folder the test package is required:

Ubuntu:

sudo apt-get install test

Mac OSX:

sudo port install test

Windows (msys2)

pacman -S mingw-w64-x86_64-test

Then run cmake with -DUNIT_TESTS=ON:

cd build; rm -rf *; cmake_release -DUNIT_TESTS=ON

The tests can be executed in build/tests with: ./test_c_bagel

Notes About the c_bagel Implementation

Division by Zero and Other Floating Point Errors

Some nodes may perform operations that can fail for certain inputs. Examples include div, mod, acos, and pow. We do nothing to prevent these failures. This means that if the implementation does not follow the IEEE 754_ standard recommendation of using NaN and/or Inf these operations will result in undefined behavior. However, all x86, x64 and RISC systems we are aware of do follow the IEEE 754 standard. In any case, the results of a behavior graph should always be checked before further processing.

.. _IEEE 754: http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=57469

License

c_bagel is distributed under the 3-clause BSD license. 0;95;0c

c_bagel's People

Contributors

malter avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

junyang0412

c_bagel's Issues

c_bagel fails to build on GCC 8

When building Magic Bagel on a recent GCC release (8.3 on a Debian 10 system), I encountered an error when autoproj tries to build c_bagel. The error message looks like this:

[..]/bob-magic-dev/bagel/c_bagel/src/bg.c: In function ‘load_extern_nodes’:
[..]/bob-magic-dev/bagel/c_bagel/src/bg.c:184:5: error: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation]
     strncpy(loadfile+l, ".so", 3);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

As far as I understand, this is the case because GCC 8 introduced some new warnings, including stringop-truncation. As c_bagel uses -Werror this leads to a build failure. The root cause is the following code which the compiler (mis)interprets as the truncation of a trailing nul in a string.

#else
    strncpy(loadfile+l, ".so", 3);
    loadfile[l+3] = '\0';
#endif

There are a few ways to fix this. The easiest would be to disable the offending warning either globally or locally as it causes a false-positive . Alternatively one could directly include the trailing nul in the call to strncpy:

#else
    strncpy(loadfile+l, ".so\0", 4);
#endif

This will prevent the warning and, as far as I can tell, should behave equivalent to the current implementation.

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.