How To Install ustl on CentOS 7

In this tutorial we learn how to install ustl on CentOS 7. ustl is A size-optimized STL implementation

Introduction

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

What is ustl

The C++ standard template library (STL) is a collection of common containers and algorithms in template form. Unfortunately its standard incarnation shipped with gcc is implemented without much concern for code size. Not only is the library itself large, the current version being over a megabyte in size, but with all the code you instantiate by using a vector for each of your containers, it is easy to become fearful and opt for using static arrays instead or, worse yet, abandon C++ altogether for C. This is especially painful to former DOS assembly programmers like myself, who fret endlessly when the size of the executable crosses the magic 64k boundary, forgetting that nobody cares about memory anymore. Of course, these days everyone has gigabytes of RAM and has no compunction about loading up OpenOffice, whose source tree is over a gigabyte in size. Why then bother with saving a kilobyte of code here and there? I can’t really say. Maybe it’s that warm fuzzy knowledge that you are making maximum possible use of your computer’s resources. Maybe it’s that thrill you get after expressing your program’s functionality in the fewest possible instructions and the minimum imaginable overhead. Or maybe it really is of no importance and any code bloat will be easily overcome by faster processors in some near future. I just know what I like, and it’s the sight of clean, concise, and fast code. Therefore this library.

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

Install ustl on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install ustl

Install ustl 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 ustl using dnf by running the following command:

sudo dnf -y install ustl

How To Uninstall ustl on CentOS 7

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

sudo dnf remove ustl

References

Summary

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