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.
CIRE requires the following softwares installed on your system. The tool will not build unless these are installed.
- ibex-lib > 2.8.9 Install Notes
- python2.x > 2.7 (Ibex scripts are currently not compatible with python3)
- g++
- gcc
- bison
- flex
- cmake
- LLVM > 16 This version is necessary since the frontend uses the new pass manager by default.
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
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
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>
..
Uses the SATIRE DSL frontend.
make CIRE
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
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>
<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>
./build-debug/CIRE_LLVM <path/to/llvm/ir/file> --function=<function_name> --input=<path/to/.txt/file>