How To Install pcc on CentOS 7

In this tutorial we learn how to install pcc on CentOS 7. pcc is The Portable C Compiler

Introduction

In this tutorial we learn how to install pcc on CentOS 7.

What is pcc

The compiler is based on the original Portable C Compiler by Stephen C. Johnson, written in the late 70’s. Even though much of the compiler has been rewritten, some of the basics still remain. PCC debuted in Unix Version 7 and replaced the DMR compiler (Dennis Ritchie’s original C compiler) in both System V and the BSD 4.x releases. Some history about pcc is in the A History of UNIX before Berkeley Evolution of C. About 50% of the front-end code and 80% of the back-end code has been rewritten. Most stuff is written by Anders Magnusson, with the exception of the data-flow analysis part and the SSA conversion code which is written by Peter A. Jonsson, and the Mips port that were written as part of a project by undergraduate students at Luleå University of Technology (LTU).

We can use yum or dnf to install pcc on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install pcc.

Install pcc on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install pcc using yum by running the following command:

sudo yum -y install pcc

Install pcc on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install pcc

How To Uninstall pcc on CentOS 7

To uninstall only the pcc package we can use the following command:

sudo dnf remove pcc

References

Summary

In this tutorial we learn how to install pcc on CentOS 7 using yum and dnf.