Gcc compiler

From Klaus' wiki
Revision as of 11:07, 28 January 2020 by Klaus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The default gcc compiler collection that comes with Centos 7 is a version 4.8.5 from 2015. It is OK for the most of our educational work. But in order to be able to use the latest version of especially C++ language it could be handy to upgrade the GCC Compiler Collection.

Execute this:

[~] $  sudo yum install centos-release-scl

This opens for a repository that contains a newer version of the development tools.

Next execute:

[~] $ sudo yum install devtoolset-7

Now in order to use the new toolchain you must run a small utility program, that sets up the environment. Try execute

[~] $ scl enable devtoolset-7 bash

This will start a new bash shell with the new toolchain enabled.

In order to start Eclipse using the toolchain execute this:

[~] $ scl enable devtoolset-7 /opt/eclipses/eclipse-cdt/eclipse

provided that you have installed your version of Eclipse in the above shown path - if not customise to your needs.

Finally, if you want to permanently use the new toolchain you can edit the icon in the start menu.