How To Install ocaml-cil on Fedora 36

In this tutorial we learn how to install ocaml-cil in Fedora 36. ocaml-cil is CIL - Infrastructure for C Program Analysis and Transformation

Introduction

In this tutorial we learn how to install ocaml-cil on Fedora 36.

What is ocaml-cil

CIL (C Intermediate Language) is a high-level representation along with a set of tools that permit easy analysis and source-to-source transformation of C programs. CIL is both lower-level than abstract-syntax trees, by clarifying ambiguous constructs and removing redundant ones, and also higher-level than typical intermediate languages designed for compilation, by maintaining types and a close relationship with the source program. The main advantage of CIL is that it compiles all valid C programs into a few core constructs with a very clean semantics. Also CIL has a syntax-directed type system that makes it easy to analyze and manipulate C programs. Furthermore, the CIL front-end is able to process not only ANSI-C programs but also those using Microsoft C or GNU C extensions. If you do not use CIL and want instead to use just a C parser and analyze programs expressed as abstract-syntax trees then your analysis will have to handle a lot of ugly corners of the language (let alone the fact that parsing C itself is not a trivial task). In essence, CIL is a highly-structured, “clean” subset of C. CIL features a reduced number of syntactic and conceptual forms. For example, all looping constructs are reduced to a single form, all function bodies are given explicit return statements, syntactic sugar like “->” is eliminated and function arguments with array types become pointers.

We can use yum or dnf to install ocaml-cil on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install ocaml-cil.

Install ocaml-cil on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install ocaml-cil using dnf by running the following command:

sudo dnf -y install ocaml-cil

Install ocaml-cil on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install ocaml-cil using yum by running the following command:

sudo yum -y install ocaml-cil

How To Uninstall ocaml-cil on Fedora 36

To uninstall only the ocaml-cil package we can use the following command:

sudo dnf remove ocaml-cil

ocaml-cil Package Contents on Fedora 36

/usr/lib64/ocaml/cil
/usr/lib64/ocaml/cil/META
/usr/lib64/ocaml/cil/alpha.cmi
/usr/lib64/ocaml/cil/availexps.cmi
/usr/lib64/ocaml/cil/availexpslv.cmi
/usr/lib64/ocaml/cil/bitmap.cmi
/usr/lib64/ocaml/cil/cabs.cmi
/usr/lib64/ocaml/cil/cabs2cil.cmi
/usr/lib64/ocaml/cil/cabshelper.cmi
/usr/lib64/ocaml/cil/cabsvisit.cmi
/usr/lib64/ocaml/cil/callgraph.cmi
/usr/lib64/ocaml/cil/canonicalize.cmi
/usr/lib64/ocaml/cil/cfg.cmi
/usr/lib64/ocaml/cil/check.cmi
/usr/lib64/ocaml/cil/cil.cma
/usr/lib64/ocaml/cil/cil.cmi
/usr/lib64/ocaml/cil/cilint.cmi
/usr/lib64/ocaml/cil/cillower.cmi
/usr/lib64/ocaml/cil/ciloptions.cmi
/usr/lib64/ocaml/cil/ciltools.cmi
/usr/lib64/ocaml/cil/cilutil.cmi
/usr/lib64/ocaml/cil/cilversion.cmi
/usr/lib64/ocaml/cil/clexer.cmi
/usr/lib64/ocaml/cil/clist.cmi
/usr/lib64/ocaml/cil/cparser.cmi
/usr/lib64/ocaml/cil/cprint.cmi
/usr/lib64/ocaml/cil/dataflow.cmi
/usr/lib64/ocaml/cil/dataslicing.cmi
/usr/lib64/ocaml/cil/deadcodeelim.cmi
/usr/lib64/ocaml/cil/dominators.cmi
/usr/lib64/ocaml/cil/epicenter.cmi
/usr/lib64/ocaml/cil/errormsg.cmi
/usr/lib64/ocaml/cil/escape.cmi
/usr/lib64/ocaml/cil/expcompare.cmi
/usr/lib64/ocaml/cil/feature_config.cmi
/usr/lib64/ocaml/cil/formatcil.cmi
/usr/lib64/ocaml/cil/formatlex.cmi
/usr/lib64/ocaml/cil/formatparse.cmi
/usr/lib64/ocaml/cil/frontc.cmi
/usr/lib64/ocaml/cil/growArray.cmi
/usr/lib64/ocaml/cil/heap.cmi
/usr/lib64/ocaml/cil/heapify.cmi
/usr/lib64/ocaml/cil/inthash.cmi
/usr/lib64/ocaml/cil/lexerhack.cmi
/usr/lib64/ocaml/cil/liveness.cmi
/usr/lib64/ocaml/cil/llvm.cmi
/usr/lib64/ocaml/cil/llvmgen.cmi
/usr/lib64/ocaml/cil/llvmssa.cmi
/usr/lib64/ocaml/cil/llvmutils.cmi
/usr/lib64/ocaml/cil/logcalls.cmi
/usr/lib64/ocaml/cil/logwrites.cmi
/usr/lib64/ocaml/cil/longarray.cmi
/usr/lib64/ocaml/cil/machdep.cmi
/usr/lib64/ocaml/cil/machdepenv.cmi
/usr/lib64/ocaml/cil/mergecil.cmi
/usr/lib64/ocaml/cil/olf.cmi
/usr/lib64/ocaml/cil/oneret.cmi
/usr/lib64/ocaml/cil/partial.cmi
/usr/lib64/ocaml/cil/patch.cmi
/usr/lib64/ocaml/cil/predabst.cmi
/usr/lib64/ocaml/cil/pretty.cmi
/usr/lib64/ocaml/cil/ptranal.cmi
/usr/lib64/ocaml/cil/reachingdefs.cmi
/usr/lib64/ocaml/cil/rmtmps.cmi
/usr/lib64/ocaml/cil/setp.cmi
/usr/lib64/ocaml/cil/sfi.cmi
/usr/lib64/ocaml/cil/simplemem.cmi
/usr/lib64/ocaml/cil/simplify.cmi
/usr/lib64/ocaml/cil/ssa.cmi
/usr/lib64/ocaml/cil/stats.cmi
/usr/lib64/ocaml/cil/trace.cmi
/usr/lib64/ocaml/cil/uref.cmi
/usr/lib64/ocaml/cil/usedef.cmi
/usr/lib64/ocaml/cil/util.cmi
/usr/lib64/ocaml/cil/whitetrack.cmi
/usr/share/doc/ocaml-cil
/usr/share/doc/ocaml-cil/LICENSE
/usr/share/doc/ocaml-cil/README.md

References

Summary

In this tutorial we learn how to install ocaml-cil on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).