Coder Social home page Coder Social logo

igen's Introduction

A Compiler for Sound Floating-Point

A source-to-source compiler that translates a numerical C program performing floating-point computations to an equivalent sound numerical C program using interval arithmetic. By sound we mean that the resulting intervals are guaranteed to contain the result of the original program if it were performed using real arithmetic.

Dependencies

Compiling Clang

We provide a source code of Clang 11.0.1 with slight modifications to support custom language extensions. For the original code see: https://github.com/llvm/llvm-project.git.

To build clang run the following commands:

  • cd <igen_path>/third-party/llvm-project-11.0.1
  • python3 build.py

The compilation may take a while.

Compiling IGen

To build IGen run the following:

  • cd scripts
  • python3 build_igen.py

Note: Check the appendix below for common errors when building IGen.

Using IGen

The script <igen_path>/bin/igen.py can be used to compile stand-alone files. For example:

  • cd <igen_path>/bin
  • python igen.py test.c

This will compile test.c and generate igen_test.c

Appendix

Installing dependencies in Ubuntu 20.04

  • CMake: sudo apt install cmake
  • MPFR: sudo apt install libmpfr-dev
  • Python: sudo apt install python3.8
  • CR-LIBM:
    • Download from https://github.com/taschini/crlibm
    • .\prepare
    • In case of error aclocal: not found do:
      • sudo apt-get install autotools-dev
      • sudo apt-get install automake
    • sudo make install

Errors when compiling IGen

For Linux (tested on Ubuntu 20.04):

  1. /usr/bin/ld: cannon find -lz
    • Solution: sudo apt-get install zlib1g-dev
  2. /usr/bin/ld: cannon find -ltinfo
    • Solution: sudo apt-get install libtinfo-dev

igen's People

Contributors

karlosss avatar joaoriverd 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.