Pimping Centos 7 Part 2: Devtoolset-7 C/C++

Centos 7 comes with gcc 4.8.5 which is quite dated. Software Collections have a build for Devtoolset-6 with gcc 6.3.1. Devtoolset-7 with gcc 7.1.1 is in the making. So why don’t we snatch it right from the build server? Be sure to check if newer builds are available by sneaking down the URL http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc and adjusting the URLs accordingly

yum install http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.1.1/2.1.el7/x86_64/devtoolset-7-gcc-7.1.1-2.1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.1.1/2.1.el7/x86_64/devtoolset-7-gcc-c++-7.1.1-2.1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.1.1/2.1.el7/x86_64/devtoolset-7-libstdc++-devel-7.1.1-2.1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-binutils/2.28/7.el7/x86_64/devtoolset-7-binutils-2.28-7.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7/7.0/5.el7/x86_64/devtoolset-7-runtime-7.0-5.el7.x86_64.rpm

As always with Software Collections, you have to enable it explicitly to use it:  scl enable devtoolset-7 "gcc -v". I’ve created a one-line shell script named build.sh

scl enable devtoolset-7 ./update.sh

which simply calls another script named update.sh with Devtoolset-7 enabled to do all the work (don’t forget to chmod +x both). Next time we put this to use.

Update 2017-10-11: The C++ toolset arrived at the Software Collections Server. No need anymore to grab it directly.

Update 2017-10-29: New version 7.2 is on the build server:

yum update http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.2.1/1.el7/x86_64/devtoolset-7-gcc-7.2.1-1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.2.1/1.el7/x86_64/devtoolset-7-gcc-c++-7.2.1-1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-gcc/7.2.1/1.el7/x86_64/devtoolset-7-libstdc++-devel-7.2.1-1.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7-binutils/2.28/9.el6/x86_64/devtoolset-7-binutils-2.28-9.el6.x86_64.rpm http://cbs.centos.org/kojifiles/packages/devtoolset-7/7.0/8.el7/x86_64/devtoolset-7-runtime-7.0-8.el7.x86_64.rpm[/pre]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s