yum 安装
通过以下命令安装 gcc,该命令下安装的版本为 4.8.5,版本较低:
1
| yum -y install gcc gcc-c++ kernel-devel
|
升级
安装 centos-release-scl
1
| yum install -y centos-release-scl
|
以下为 8 版本的安装,如果安装 7 版本将数字改为 7 即可:
1
| yum install -y devtoolset-8-gcc*
|
1
| scl enable devtoolset-8 bash
|
查看版本
执行命令:
1 2 3
| gcc -v 如果显示如下说明安装成功: gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
|
设置开机启动
可以通过两种方式设置开机启动。
配置自启动文件
- 安装的 devtoolset 在 /opt/rh 目录下,编辑文件:
1
| vi /etc/profile.d/gcc.sh
|
- 填写以下内容后保存:
1
| source /opt/rh/devtoolset-8/enable
|
- 执行命令:
1 2
| chmod +x /etc/profile.d/gcc.sh source /etc/profile.d/gcc.sh
|
问题及解决方案
1 2 3 4 5
| [root@SqaServer fio-fio-3.32]# fio fio-test.ini > fio-test.txt fio: engine libaio not loadable fio: failed to load engine
[root@SqaServer fio-fio-3.32]# yum install -y libaio-devel
|
环境插件安装
https://blog.csdn.net/m0_47696151/article/details/123519481