By default, GCC available in the system is 4.8. In case, your requirement is an updated version you can set it in your home bashrc as per the version you need.
We have devtoolset istalled on Cluster. Installed versions – devtoolset-7 to devtoolset-11
Let’s see how to set gcc version 7 in below example –
To activate gcc 7 you need to source devtoolset-7 with below command -
source /opt/rh/devtoolset-7/enable
Now you can check the version -
gcc -v
To make the above version persistent for your account, you can add the above line in your bashrc –
vim ~/.bashrc
#Add this line is in the end and save
source /opt/rh/devtoolset-7/enable
Now source your bashrc file
source ~/.bashrc
In a similar way, you can set gcc-9 and other available versions.