gcc4.8.5升级到gcc4.9.2
第1步:获取repo
[root@localhost SPECS]# wget --no-check-certificate https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/devtoolset-3.repo
--2021-12-07 20:53:26-- https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo
Resolving copr.fedoraproject.org (copr.fedoraproject.org)... 13.212.21.54, 13.233.183.170, 13.250.126.156, ...
Connecting to copr.fedoraproject.org (copr.fedoraproject.org)|13.212.21.54|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://copr.fedorainfracloud.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo [following]
--2021-12-07 20:53:27-- https://copr.fedorainfracloud.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo
Resolving copr.fedorainfracloud.org (copr.fedorainfracloud.org)... 3.225.109.36, 2600:1f18:8ee:ae00:9d1f:4737:93ce:6db
Connecting to copr.fedorainfracloud.org (copr.fedorainfracloud.org)|3.225.109.36|:443... connected.
WARNING: cannot verify copr.fedorainfracloud.org's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
Issued certificate has expired.
HTTP request sent, awaiting response... 200 OK
Length: 376 [text/plain]
Saving to: ‘/etc/yum.repos.d/devtoolset-3.repo’
100%[=============================================>] 376 --.-K/s in 0s
2021-12-07 20:53:28 (49.6 MB/s) - ‘/etc/yum.repos.d/devtoolset-3.repo’ saved [376/376]
第2步:安装devtoolset-3-gcc
[root@localhost SPECS]# yum -y install devtoolset-3-gcc
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.compevo.com
* centos-sclo-rh: mirrors.163.com
* centos-sclo-sclo: mirrors.163.com
* elrepo: mirror.rackspace.com
* extras: repos.lax.quadranet.com
* updates: linux.mirrors.es.net
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-3-gcc.x86_64 0:4.9.2-6.el6 will be installed
--> Processing Dependency: devtoolset-3-binutils >= 2.22.52.0.1 for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Processing Dependency: devtoolset-3-runtime for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Processing Dependency: libmpfr.so.1()(64bit) for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Running transaction check
---> Package devtoolset-3-binutils.x86_64 0:2.24-18.el6 will be installed
---> Package devtoolset-3-gcc.x86_64 0:4.9.2-6.el6 will be installed
--> Processing Dependency: libgmp.so.3()(64bit) for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Processing Dependency: libmpfr.so.1()(64bit) for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
---> Package devtoolset-3-runtime.x86_64 0:3.1-12.el6 will be installed
--> Finished Dependency Resolution
Error: Package: devtoolset-3-gcc-4.9.2-6.el6.x86_64 (copr:copr.fedorainfracloud.org:rhscl:devtoolset-3)
Requires: libmpfr.so.1()(64bit)
Error: Package: devtoolset-3-gcc-4.9.2-6.el6.x86_64 (copr:copr.fedorainfracloud.org:rhscl:devtoolset-3)
Requires: libgmp.so.3()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
若第2步报错,缺少两个安装包,执行第3步:
安装依赖包libmpfr.so.1和libgmp.so.3,下载链接如下:
mpfr:
链接:https://pan.baidu.com/s/1_adAchU_VGmEbSGRoMnhGg
提取码:1234
gmp:
链接:https://pan.baidu.com/s/1nA-LAjArEAGhWSFHTBj0og
提取码:1234
第4步,安装缺省包:
下载后,使用命令安装即可:
yum install compat-libmpfr-2.4.1-1.sl7.x86_64.rpm
yum install compat-libgmp-4.3.1-1.sl7.x86_64.rpm
第5步,再次安装devtoolset-3-gcc
[root@localhost w0412]# yum install devtoolset-3-gcc
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* centos-sclo-rh: mirrors.163.com
* centos-sclo-sclo: mirrors.163.com
* elrepo: mirror.rackspace.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-3-gcc.x86_64 0:4.9.2-6.el6 will be installed
--> Processing Dependency: devtoolset-3-binutils >= 2.22.52.0.1 for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Processing Dependency: devtoolset-3-runtime for package: devtoolset-3-gcc-4.9.2-6.el6.x86_64
--> Running transaction check
---> Package devtoolset-3-binutils.x86_64 0:2.24-18.el6 will be installed
---> Package devtoolset-3-runtime.x86_64 0:3.1-12.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
devtoolset-3-gcc
x86_64 4.9.2-6.el6 copr:copr.fedorainfracloud.org:rhscl:devtoolset-3 24 M
Installing for dependencies:
devtoolset-3-binutils
x86_64 2.24-18.el6 copr:copr.fedorainfracloud.org:rhscl:devtoolset-3 5.1 M
devtoolset-3-runtime
x86_64 3.1-12.el6 copr:copr.fedorainfracloud.org:rhscl:devtoolset-3 1.1 M
Transaction Summary
=======================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 30 M
Installed size: 69 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/copr:copr.fedorainfracloud.org:rhscl:devtoolset-3/packages/devtoolset-3-binutils-2.24-18.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 094d442c: NOKEY
Public key for devtoolset-3-binutils-2.24-18.el6.x86_64.rpm is not installed
(1/3): devtoolset-3-binutils-2.24-18.el6.x86_64.rpm | 5.1 MB 00:00:06
(2/3): devtoolset-3-runtime-3.1-12.el6.x86_64.rpm | 1.1 MB 00:00:01
(3/3): devtoolset-3-gcc-4.9.2-6.el6.x86_64.rpm | 24 MB 00:00:13
---------------------------------------------------------------------------------------
Total 2.2 MB/s | 30 MB 00:13
Retrieving key from https://download.copr.fedorainfracloud.org/results/rhscl/devtoolset-3/pubkey.gpg
Importing GPG key 0x094D442C:
Userid : "rhscl_devtoolset-3 (None) <rhscl#devtoolset-3@copr.fedorahosted.org>"
Fingerprint: 143e 840e c0d0 ad21 e646 cdd8 fbce 6502 094d 442c
From : https://download.copr.fedorainfracloud.org/results/rhscl/devtoolset-3/pubkey.gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : devtoolset-3-runtime-3.1-12.el6.x86_64 1/3
Installing : devtoolset-3-binutils-2.24-18.el6.x86_64 2/3
Installing : devtoolset-3-gcc-4.9.2-6.el6.x86_64 3/3
Verifying : devtoolset-3-binutils-2.24-18.el6.x86_64 1/3
Verifying : devtoolset-3-runtime-3.1-12.el6.x86_64 2/3
Verifying : devtoolset-3-gcc-4.9.2-6.el6.x86_64 3/3
Installed:
devtoolset-3-gcc.x86_64 0:4.9.2-6.el6
Dependency Installed:
devtoolset-3-binutils.x86_64 0:2.24-18.el6 devtoolset-3-runtime.x86_64 0:3.1-12.el6
Complete!
第6步,安装devtoolset-3-gcc-c++
[root@localhost w0412]# yum install devtoolset-3-gcc-c++
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* centos-sclo-rh: mirrors.163.com
* centos-sclo-sclo: mirrors.163.com
* elrepo: mirror.rackspace.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-3-gcc-c++.x86_64 0:4.9.2-6.el6 will be installed
--> Processing Dependency: devtoolset-3-libstdc++-devel = 4.9.2-6.el6 for package: devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64
--> Running transaction check
---> Package devtoolset-3-libstdc++-devel.x86_64 0:4.9.2-6.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
devtoolset-3-gcc-c++
x86_64 4.9.2-6.el6 copr:copr.fedorainfracloud.org:rhscl:devtoolset-3 8.4 M
Installing for dependencies:
devtoolset-3-libstdc++-devel
x86_64 4.9.2-6.el6 copr:copr.fedorainfracloud.org:rhscl:devtoolset-3 2.0 M
Transaction Summary
=======================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 10 M
Installed size: 32 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): devtoolset-3-libstdc++-devel-4.9.2-6.el6.x86_64.rpm | 2.0 MB 00:00:18
(2/2): devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64.rpm | 8.4 MB 00:00:19
---------------------------------------------------------------------------------------
Total 534 kB/s | 10 MB 00:19
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : devtoolset-3-libstdc++-devel-4.9.2-6.el6.x86_64 1/2
Installing : devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64 2/2
Verifying : devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64 1/2
Verifying : devtoolset-3-libstdc++-devel-4.9.2-6.el6.x86_64 2/2
Installed:
devtoolset-3-gcc-c++.x86_64 0:4.9.2-6.el6
Dependency Installed:
devtoolset-3-libstdc++-devel.x86_64 0:4.9.2-6.el6
Complete!
第7步,安装devtoolset-3-binutils
[root@localhost w0412]# yum install devtoolset-3-binutils
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* centos-sclo-rh: mirrors.163.com
* centos-sclo-sclo: mirrors.163.com
* elrepo: mirror.rackspace.com
* extras: mirrors.163.com
第8步,设置当前gcc版本:
scl enable devtoolset-3 bash
或
source /opt/rh/devtoolset-3/enable
第9步,查看gcc版本
[root@localhost w0412]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC)
至此,升级gcc完成。
相关文章:

gcc4.8.5升级到gcc4.9.2
第1步:获取repo [rootlocalhost SPECS]# wget --no-check-certificate https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/devtoolset-3.repo --2021-12-07 20:53:26-- https://copr.fedo…...

Golang 中的 archive/zip 包详解(三):常用函数
Golang 中的 archive/zip 包用于处理 ZIP 格式的压缩文件,提供了一系列用于创建、读取和解压缩 ZIP 格式文件的函数和类型,使用起来非常方便,本文讲解下常用函数。 zip.OpenReader 定义如下: func OpenReader(name string) (*R…...

微服务架构七种模式
微服务架构七种模式 目录概述需求: 设计思路实现思路分析 参考资料和推荐阅读 Survive by day and develop by night. talk for import biz , show your perfect code,full busy,skip hardness,make a better result,wait for change,challenge Survive.…...

关于CICD流水线的前端项目运行错误,npm项目环境配置时出现报错:Not Found - GET https://registry.npm...
关于CICD流水线的前端项目运行错误,npm项目环境配置时出现报错:Not Found - GET https://registry.npm… 原因应该是某些jar包缓存中没有需要改变镜像将包拉下来 npm config set registry http://registry.npm.taobao.org npm install npm run build...

element-plus的周选择器 一周从周一开始
1、代码 1)、template中 <el-date-picker v-model"value1" type"week" format"[Week] ww" placeholder"巡访周" change"change"value-format"YYYY-MM-DD" /> 2)、方法中 import…...

Android 9.0 pms获取应用列表时过滤掉某些app功能实现
1.前言 在9.0的系统rom定制化开发中,对系统定制的功能也是很多的,在一次产品开发中,要求在第三方app获取应用列表的时候,需要过滤掉某些app,就是不显示在app应用列表中,这就需要在pms查询app列表时过滤掉这些app就可以了,接下来就实现这些功能 2.pms获取应用列表时过滤掉…...

HTML <thead> 标签
实例 带有 thead、tbody 以及 tfoot 元素的 HTML 表格: <table border="1"><thead><tr><th>Month</th><th>Savings</th></tr></thead><tfoot><tr><td>Sum</td><td>$180<…...

谷歌发布Gemini以5倍速击败GPT-4
在Covid疫情爆发之前,谷歌发布了MEENA模型,短时间内成为世界上最好的大型语言模型。谷歌发布的博客和论文非常可爱,因为它特别与OpenAI进行了比较。 相比于现有的最先进生成模型OpenAI GPT-2,MEENA的模型容量增加了1.7倍…...

力扣92. 局部反转链表
92. 反转链表 II 给你单链表的头指针 head 和两个整数 left 和 right ,其中 left < right 。请你反转从位置 left 到位置 right 的链表节点,返回 反转后的链表 。 示例 1: 输入:head [1,2,3,4,5], left 2, right 4 输出&am…...

九、适配器模式
一、什么是适配器模式 适配器模式(Adapter)的定义如下:将一个类的接口转换成客户希望的另外一个接口,使得原本由于接口不兼容而不能一起工作的那些类能一起工作。 适配器模式(Adapter)包含以下主要角色&…...

使用spring自带的发布订阅来实现发布订阅
背景 公司的项目以前代码里面有存在使用spring自带发布订阅的代码,因此稍微学习一下如何使用,并了解一下这种实现方式的优缺点。 优点 实现方便,代码方面基本只需要定义消息体和消费者,适用于小型应用程序。不依赖外部中间件&a…...

Walmart电商促销活动即将开始,如何做促销活动?需要注意什么?
近日,沃尔玛官宣Baby Days优惠活动将于9月1日正式开始!卖家可以把握机会,通过设置促销定价,以最优惠的婴儿相关产品价格吸引消费者,包括汽车座椅、婴儿车、尿布袋、家具、床上用品、消耗品、婴儿服装、孕妇装等。注意本…...

Matlab(画图进阶)
目录 大纲 1.特殊的Plots 1.1 loglog(双对数刻度图) 1.3 plotyy(创建具有两个y轴的图形) 1.4yyaxis(创建具有两个y轴的图) 1.5 bar 3D条形图(bar3) 1.6 pie(饼图) 3D饼图 1.7 polar 2.Stairs And Ste阶梯图 3.Boxplot 箱型图和Error Bar误差条形图 3.1 boxplot 3.2 …...

人生的回忆
回忆是人类宝贵的精神财富,它们像一串串珍珠,串联起我们生活中的每一个片段。 回忆是时间的见证者,它们承载着我们成长、经历、悲欢离合的点点滴滴。 回忆让我们重温过去的欢笑与眼泪,感受那些已经逝去的时光。它们就像一本翻开的…...

Spring之依赖注入源码解析
Spring之依赖注入源码解析 Spring依赖注入的方式 手动注入 在XML中定义Bean时,即为手动注入,因为是程序员手动给某个属性指定了值。 通过set方式进行注入 <bean name"userService" class"com.luban.service.UserService">…...

5G NR:RACH流程-- Msg1之生成PRACH Preamble
随机接入流程中的Msg1,即在PRACH信道上发送random access preamble。涉及到两个问题: 一个是如何产生preamble?一个是如何选择正确的PRACH时频资源发送所选的preamble? 一、PRACH Preamble是什么 PRACH Preamble从数学上来讲是一个长度为…...

高基数类别特征预处理:平均数编码 | 京东云技术团队
一 前言 对于一个类别特征,如果这个特征的取值非常多,则称它为高基数(high-cardinality)类别特征。在深度学习场景中,对于类别特征我们一般采用Embedding的方式,通过预训练或直接训练的方式将类别特征值编…...

高效利用隧道代理实现无阻塞数据采集
在当今信息时代,大量的有价值数据分散于各个网站和平台。然而,许多网站对爬虫程序进行限制或封禁,使得传统方式下的数据采集变得困难重重。本文将向您介绍如何通过使用隧道代理来解决这一问题,并帮助您成为一名高效、顺畅的数据采…...

图论岛屿问题DFS+BFS
leetcode 200 岛屿问题 class Solution {//定义对应的方向boolean [][] visited;int dir[][]{{0,1},{1,0},{-1,0},{0,-1}};public int numIslands(char[][] grid) {//对应的二维数组int count0;visitednew boolean[grid.length][grid[0].length];for (int i 0; i < grid.l…...

Cypress web自动化windows环境npm安装Cypress
前言 web技术已经进化了,web的测试技术最终还是跟上了脚步,新一代的web自动化技术出现了? Cypress可以对在浏览器中运行的任何东西进行快速、简单和可靠的测试。 官方地址https://www.cypress.io/,详细的文档介绍https://docs.cypress.io/g…...

CentOS7.9设置ntp时间同步
文章目录 应用场景基础知识操作步骤 应用场景 我们公司是做智慧交通的,主要卖交通相关的硬件和软件。硬件包括信号机、雷达、雷视、边缘盒子等,软件包括信控平台、管控平台等信号机设备、雷达设备、边缘计算单元等,还有一些第三方的卡口设备…...

36、springboot --- 对 tomcat服务器 和 undertow服务器 配置访客日志
springboot 配置访客日志 ★ 配置访客日志: 访客日志: Web服务器可以将所有访问用户的记录都以日志的形式记录下来,主要就是记录来自哪个IP的用户、在哪个时间点、访问了哪个资源。 Web服务器可将所有访问记录以日志形式记录下来ÿ…...

MySQL表的增删改查
文章目录 MySQL表的增删改查1. Create1.1 单行数据插入1.2 多行数据插入1.3 插入否则更新1.4 替换 2. Retrieve2.1 SELECT 列2.1.1 全列查询2.1.2 指定列查询2.1.3 查询字段为表达式2.1.4 为查询结果指定别名2.1.5 结果去重 2.2 WHERE 条件2.2.1 英语不及格的同学及英语成绩(&l…...

yolov3
yolov1 传统的算法 最主要的是先猜很多候选框,然后使用特征工程来提取特征(特征向量),最后使用传统的机器学习工具进行训练。然而复杂的过程可能会导致引入大量的噪声,丢失很多信息。 从传统的可以总结出目标检测可以分为两个阶…...

基于低代码/无代码工具构建 BI 应用程序
一、前言 随着数字化推进,越来越多的企业开始重视数据分析,希望通过BI(商业智能)技术提高业务决策的效率和准确性。 传统的BI解决方案往往需要大量的定制开发和数据准备,不仅周期长、成本高,还需要专业的数…...

Servlet与过滤器
目录 Servlet 过滤器 Servlet Servlet做了什么 本身不做任何业务处理,只是接收请求并决定调用哪个JavaBean去处理请求,确定用哪个页面来显示处理返回的数据 Servlet是什么 ServerApplet,是一种服务器端的Java应用程序 只有当一个服务器端的程序使用了Servlet…...

微信小程序开发实战记录
近期公司需要开发一个小程序项目,时间非常紧急,在开发过程中遇到几个困扰的问题及解决方案,记录如下:小程序框架选择 基础框架:小程序原生框架 sassui: 采用 vant weapp图表:采用 ec-echarts …...

防破解暗桩思路:检查菜单是否被非法修改过源码
本篇文章属于《518抽奖软件开发日志》系列文章的一部分。 我在开发《518抽奖软件》(www.518cj.net)的时候,为了防止被破解,需用添加一些暗桩,在合适的时机检查软件是否被非法修改过,如果被非法修改就做出提…...

IDEA使用Docker插件
修改Docker配置 1.执行命令vim /usr/lib/systemd/system/docker.service,在ExecStart配置的后面追加 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock ExecStart/usr/bin/dockerd -H fd:// --containerd/run/containerd/containerd.sock -H tcp://0.0.0.0:…...

[前端] vue使用Mousetrap.js实现快捷键
Mousetrap.js介绍 Mousetrap.js 是一个处理键盘快捷键的 JavaScript 库,它允许您定义复杂的键盘快捷键并在浏览器中使用。 官方地址 代码仓库 安装库 在命令行中运行以下命令安装 mousetrap 模块: npm install mousetrap再次运行命令行,安…...