This repository holds the code, specific to each compiler, that is necessary to:
- Test the compilers ability to correctly parse the input source code
- Test the compilers ability to correctly generate a source file with an identical structure to the one input by the user
CACTI (Compiler Analysis, Comparison & Testing Infrastructure) is a project being developed by four software-engineering students, for the Capstone Project curricular unit.
As the name suggests, CACTI wishes to study and compare the capabilities of different compilers, by collecting/creating several input C and C++ files that represent various functionalities of each language, and by defining and implementing tests for each transpiliation task (parsing, code generation, querying and transformation).
- Fábio Morais (202008052) - Faculty of Engineering, University of Porto, Portugal
- Francisco Prada (202004646) - Faculty of Engineering, University of Porto, Portugal
- Guilherme Sequeira (202004648) - Faculty of Engineering, University of Porto, Portugal
- Pedro Ramalho (202004715) - Faculty of Engineering, University of Porto, Portugal
- João Bispo - Faculty of Engineering, University of Porto, Portugal
- Luís Sousa - Faculty of Engineering, University of Porto, Portugal
In order to launch CACTI, you may run the following command:
$ python3 cacti.py -S <source_path> -T <transpiler_name>
CACTI offers a sample of mandatory arguments (like the ones above, -S
and -T
), as well as some additional flags, in order to customize the output. Below is an explanation of the current implemented arguments and flags:
-S <source_path>
- specify the path to the source files which are to be tested-T <transpiler>
- the name of the transpiler which is to be tested--vi
,--vc
- enable verbose idempotency & correctness, respectively--std <CXX>
- specify the C/C++ standard to be used--opt <O>
- specify the optimization flag that is to be used by Clang'semit_llvm
flag (e.g,O0
)--it <N>
- specify the maximum number of idempotency tries--of <path>
- specify the directory where the output should be generated in. Current working directory by default.
In order to run our project some dependencies are required:
- Python 3.10.6 or above
- The Progressbar2 pip package
- The colorama pip package
- The transpilers that you wish to test (e.g. clava)
Additionally, if you wish to convert the generated LaTeX report to a pdf some additional LaTeX packages may be needed to be installed in your system, such as texlive-core, pdflatex, texlive-bibtex-extra in apt.
- cppreference - Most of the source files in this repository were adapted from the example code available here.
- ChatGPT - Some source files may include code generated by chatGPT.
Exceptionally, other sources are documented on the corresponding file.