How To Install libglm-dev on Ubuntu 18.04

In this tutorial we learn how to install libglm-dev on Ubuntu 18.04. libglm-dev is C++ library for OpenGL GLSL type-based mathematics

Introduction

In this tutorial we learn how to install libglm-dev on Ubuntu 18.04.

What is libglm-dev

libglm-dev is:

OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification.

GLM provides classes and functions designed and implemented with the same naming conventions and functionalities as GLSL, so that when a programmer knows GLSL, he knows GLM as well, which makes it really easy to use.

This project isn’t limited to GLSL features. An extension system, based on the GLSL extension conventions, provides extended capabilities: matrix transformations, quaternions, half-based types, random numbers, et cetera.

This library works perfectly together with OpenGL but it also ensures interoperability with other third party libraries and SDKs. It is a good candidate for software rendering (such as raytracing, rasterisation), image processing, physic simulations and any context that requires a simple and convenient mathematics library.

There are three methods to install libglm-dev on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libglm-dev Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libglm-dev using apt-get by running the following command:

sudo apt-get -y install libglm-dev

Install libglm-dev Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libglm-dev using apt by running the following command:

sudo apt -y install libglm-dev

Install libglm-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libglm-dev using aptitude by running the following command:

sudo aptitude -y install libglm-dev

How To Uninstall libglm-dev on Ubuntu 18.04

To uninstall only the libglm-dev package we can use the following command:

sudo apt-get remove libglm-dev

Uninstall libglm-dev And Its Dependencies

To uninstall libglm-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libglm-dev

Remove libglm-dev Configurations and Data

To remove libglm-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libglm-dev

Remove libglm-dev configuration, data, and all of its dependencies

We can use the following command to remove libglm-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libglm-dev

References

Summary

In this tutorial we learn how to install libglm-dev package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.