Install modern compilers in CentOS / RHEL

Very often we need a more modern compiler than is included in base CentOS, particularly for HPC systems. It does require admin (sudo) privileges to install the programs, but they can be loaded by any user thereafter. DevToolset comes from RHEL and works on RHEL and CentOS.

Install

The devtoolset install is shown for gfortran:

yum install centos-release-scl

yum install devtoolset-8-gcc devtoolset-8-gcc-gfortran

Availability

Load

add to ~/.bashrc

scl enable devtoolset-8 bash

verify Gfortran 8 is active by:

gfortran --version