manavpatnaik / frama-c-problems

A repository dedicated for problems related to verification of programs using the tool frama-c.
3 stars 0 forks source link

Inclusion of readme.md #1

Closed cyberwizard1001 closed 4 years ago

cyberwizard1001 commented 4 years ago

Installing frama-c

NOTE: This is a living document ie is being actively modified. Keep checking every now and then for updates!

Frama-C is a suite of tools dedicated to the analysis of the source code of software written in C. This is available as part of the OCaml suite.

For more details:

https://frama-c.com/ https://opam.ocaml.org/

This tool has been written primarily with Linux in mind and can thus be installed in three ways - as a package in a Linux distro or using WSL2 (Windows Subsystem for Linux 2 - a way to run Linux apps - although not very well at the present moment - on Windows) or using cygwin (a framework that enables the usage of serveral GNU tools on Windows). There also exists a beta version of the OCaml Package Manager for Windows.

Requirements

Method 1 - Native Linux install / VM

NOTE: Some Ubuntu / Debian distros like Pop!OS and Kali Linux don't have all the packages necessary - stock Ubuntu is preferred for a relatively hassle free installation.

Method 1

image

image

image

image

> While depext works as expected in Ubuntu, it might complain saying it doesn't know how to install packages on an Arch 
> based system. The solution is to copy the package names and install them manually. If yay is installed, run
> ``` yay -S package1 package2 package3 ... ``` 
>  as some packages are not available in the official repos and can only be found in AUR (Arch User Repository).

image

Congrats!

You've successfully installed frama-c.

Usage instructions:

To use frama-c, you need a .c file that has the requisite frama-c code added to it. To test, you can download one of the files listed in this repo.

Step 1: Navigating to the folder in question

Method 1:
Method 2:

Step 2: Opening frama-c

Option 1: CLI
Option 2: Graphical

Possible solutions: : run opam init and eval $(opam env) again : run why3 config --full-config again

: As a last resort, alt-ergo-2.3.3 can be replaced with alt-ergo-2.3.1, the officially supported version (but not default install, which is alt-ergo-2.3.3) opam install alt-ergo-2.3.1 : This has to be followed by eval $(opam env) and why3 config --full-config

manavpatnaik commented 4 years ago

Great job dude!