湖南营销型网站建设 A磐石网络,做网站后要回源码有何用,建立网站的技术路径,科技公司网站模板背景
CentOS 7默认自带GCC版本4.8#xff0c;而目前工作中开发环境需要用到GCC8和GCC12#xff0c;这里记录一下如何升级GCC版本#xff0c;以及如何多版本并存。参考#xff1a; CentOS升级gcc-知乎 Redhat7上安装Red Hat Developer Toolset并自由切换gcc和g的版本
Cent…背景
CentOS 7默认自带GCC版本4.8而目前工作中开发环境需要用到GCC8和GCC12这里记录一下如何升级GCC版本以及如何多版本并存。参考 CentOS升级gcc-知乎 Redhat7上安装Red Hat Developer Toolset并自由切换gcc和g的版本
CentOS 7升级gcc
devtoolset对应gcc的版本
devtoolset-7对应gcc7.x.x版本
devtoolset-8对应gcc8.x.x版本
devtoolset-9对应gcc9.x.x版本
devtoolset-10对应gcc10.x.x版本
devtoolset-11对应gcc11.x.x版本可通过centos-release-scl源安装devtoolset包
yum install centos-release-scl
yum install devtoolset-8激活gcc版本使其生效
scl enable devtoolset-8 bash
# 或者下面这句
# source /opt/rh/devtoolset-8/enable执行后只在当前终端生效要永久生效可以将激活语句加入到~/.bashrc中。
此时通过gcc --version命令可以看到版本信息。 遗憾的是上述方式无法安装gcc12devtoolset目前只提供到gcc11。于是自己找了个软件源https://copr.fedorainfracloud.org/coprs/mlampe/devtoolset-12/新建一个源文件
vim /etc/yum.repos.d devtoolset-12.repo在文件中写入以下内容
[copr:copr.fedorainfracloud.org:mlampe:devtoolset-12]
nameCopr repo for devtoolset-12 owned by mlampe
baseurlhttps://download.copr.fedorainfracloud.org/results/mlampe/devtoolset-12/epel-7-$basearch/
typerpm-md
skip_if_unavailableTrue
gpgcheck1
gpgkeyhttps://download.copr.fedorainfracloud.org/results/mlampe/devtoolset-12/pubkey.gpg
repo_gpgcheck0
enabled1
enabled_metadata1