Install Valgrind

This post is intended to demonstrate how to install Valgrind in a Centos/Red Hat and Debian/Ubuntu environment. Valgrind is a programming tool for memory debugging, memory leak detection, and profiling. 

The yum Method

It is the quickest and simpler way. Valgrind is part of the base/7/x86_64 repository, which comes by default. The command below should work:

The apt-get Method

The apt-get can be used fur Debian/Ubuntu version of Linux. It is a single command line as well:

The Compiling Method

Compiling requires a few more steps, but it has the same effect as the ones mentioned above. The compiling method provided below is for Centos/Red Hat and Debian/Ubuntu version.

Pre-Requisites

Valgrind requires the libraries below to be compiled:

To install the libraries on a Red Hat/Centos environment:

To install the libraries on a Debian/Ubuntu environment:

Compiling

Valgrind can be downloaded here. In this example, version 3.15.0 will be used.

Validation

Execute the command line below to check if the installation process completed successfully:

Leave a Reply