Quickstart

January 19, 2024 ยท View on GitHub

This guide will demonstrate how to quickly get FortranAS up and running.

Prerequisites

This project includes docker context to build and run FortranAS. In order to build FortranAS you must have GNU Make and Docker installed. Installation of theses tools for your system is out of scope for this guide although it is recommended you follow the official Docker Installation ๐Ÿ”— guide to install docker on your system.

You can also build and run FortranAS locally via maven. For local builds you need JDK 19+ and Maven installed. Local builds are out of scope for this guide.

  • Install GraphViz (for DOT conversion)
  • Install unifdef command line tool
  • Install python3
  • Install meld for clone pair diffing

โ„น๏ธINFO: FortranAS can only be built on Linux with Docker and GNU Make installed.
For local builds JDK 19 or better is required.

Building FortranAS

  1. Clone the FortranAS repository:
git clone --recursive --jobs=$(nproc) https://github.com/akoerner/FortranAS.git

โš ๏ธ WARNING: FortranAS requires the Antlr4 ๐Ÿ”— and grammars-v4 ๐Ÿ”— submodules. If submodules are not initialized and updated then the build of FortranAS will fail.

  1. Build FortranAS:
cd FortranAS
make build

Running The FortranAS Demo With Docker

After building FortranAS the provided demo make target can be run with:

make run_demo

The demo will parse all FORTRAN source code in fortran_code_samples directory with all output being placed in ./output. The demo will also generate code pairs using the code_clone_analysis/generate_clone_pairs.py python script.