devtoolset(gcc,g++编译环境集)

devtoolset

Developer Toolset is designed for developers working on CentOS or Red Hat Enterprise Linux platform.
It provides current versions of the GNU Compiler Collection, GNU Debugger, and other development, debugging, and performance monitoring tools.

devtoolset版本:devtoolset-1.1 devtoolset-2 devtoolset-3 devtoolset-4,以上版本分别对应gcc的版本为4.7、4.8、4.9、5.2

centos7

目前已经没有LTS, 很多源不可用. 阿里云的源还可以

yum install centos-release-scl

修改源为阿里云

 cat /etc/yum.repos.d/CentOS-SCLo-scl.repo
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information

[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

centos

yum install devtoolset-8

#使新的工具集生效
scl enable devtoolset-8 bash

[root@mulangcloud mulang-cloud-vddk]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@mulangcloud mulang-cloud-vddk]#  scl enable devtoolset-8 bash
[root@mulangcloud mulang-cloud-vddk]# gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

官方devtoolset-8安装教程

官方devtoolset-8

还支持docker

$ docker pull registry.access.redhat.com/rhscl/devtoolset-8-perftools-rhel7
$ docker pull registry.access.redhat.com/rhscl/devtoolset-8-toolchain-rhel7
$ docker pull centos/devtoolset-8-perftools-centos7
$ docker pull centos/devtoolset-8-toolchain-centos7

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.