tanmaytirpankar / CIRE

Library and tool for statically estimating worst case first order error

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CIRE: C++ Incremental rigorous error-analyser

CIRE is similar to SATIRE but in C++. This project was meant to provide an error analysis tool and library for C/C++ programs. Ideally it should have all the capabilities of Satire and more.

Dependencies

CIRE requires the following softwares installed on your system. The tool will not build unless these are installed.

If you want to use the LLVM frontend

  • LLVM > 16 This version is necessary since the frontend uses the new pass manager by default.

IBEX installation

Linux and MacOS

Use wget command below or download ibex-lib-ibex-2.8.9.tar.gz (the tar file) from here then run the successive commands.

wget https://github.com/ibex-team/ibex-lib/archive/refs/tags/ibex-2.8.9.tar.gz
tar xvfz ibex-2.8.9.tgz
cd ibex-2.8.9
sudo ./waf configure [--enable-shared]
sudo ./waf install

To Uninstall

sudo ./waf uninstall
sudo ./waf distclean

Building

The CMakeLists.txt file is configured to build the library and the executable in the build directory. Make sure the shared library files are in your PATH. If not, set the LD_LIBRARY_PATH environment variable to where your shared library files are located. Then run the following

mkdir build-debug
cd build-debug
cmake ..
make

Building the LLVM frontend

To build the LLVM frontend, you need to have LLVM installed on your system. Pass -DENABLE_LLVM_FRONTEND=ON and set LT_LLVM_INSTALL_DIR to the directory where LLVM is installed.

cmake 
  -DENABLE_LLVM_FRONTEND=ON
  -DLT_LLVM_INSTALL_DIR=<path to LLVM install directory> 
  ..

Targets

CIRE

Uses the SATIRE DSL frontend.

make CIRE

Usage

The executable is located in the build-debug directory. Run the following to see CIRE run on an example file

LD_LIBRARY_PATH=/usr/local/lib
./build-debug/CIRE ./benchmarks/addition/addition.txt

LLVM Frontend

There are two ways to utilize the LLVM Frontend. As an LLVM pass or as a standalone tool. Make sure you run -O1 or higher to generate LLVM IR to simplify the function removing all memory operations.

clang -S -emit-llvm -O1 <path/to/c/file>

As an LLVM pass

<path/to/opt> -load-pass-plugin=<path/to/libCIRE_LLVM.so> -passes="cire" --function=<function_name> --input=<path/to/.txt/file> --disable-output <path/to/llvm/ir/file>

As a standalone tool

./build-debug/CIRE_LLVM <path/to/llvm/ir/file> --function=<function_name> --input=<path/to/.txt/file>

About

Library and tool for statically estimating worst case first order error


Languages

Language:C++ 59.6%Language:LLVM 24.5%Language:Python 7.6%Language:Yacc 4.8%Language:CMake 2.7%Language:Lex 0.9%Language:C 0.1%