Gcc

Sunmy Lv5

yum 安装

通过以下命令安装 gcc,该命令下安装的版本为 4.8.5,版本较低:

1
yum -y install gcc gcc-c++ kernel-devel

升级

安装 centos-release-scl

1
yum install -y centos-release-scl

安装 devtoolset

以下为 8 版本的安装,如果安装 7 版本将数字改为 7 即可:

1
yum install -y devtoolset-8-gcc*

激活 devtoolset

1
scl enable devtoolset-8 bash

查看版本

执行命令:

1
2
3
gcc -v
如果显示如下说明安装成功:
gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)

设置开机启动

可以通过两种方式设置开机启动。

配置自启动文件

  1. 安装的 devtoolset 在 /opt/rh 目录下,编辑文件:
1
vi /etc/profile.d/gcc.sh
  1. 填写以下内容后保存:
1
source /opt/rh/devtoolset-8/enable
  1. 执行命令:
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

  • 标题: Gcc
  • 作者: Sunmy
  • 创建于 : 2023-06-30 16:56:57
  • 更新于 : 2025-06-29 21:05:24
  • 链接: https://ldspdvsun.github.io/cmchvp8g8003mh0gbd3mz1rbx/
  • 版权声明: 版权所有 © Sunmy,禁止转载。
评论