Kylin Server V10下编译安装RabbitMQ

一、升级GCC

1.升级系统GCC版本

(1)下载gcc版本

[root@localhost src]# wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz

(2)解压软件包

[root@localhost src]# tar -zxvf gcc-13.2.0.tar.gz

(3)查看解压出来的文件

[root@localhost src]# cd gcc-13.2.0/

[root@localhost gcc-13.2.0]# ls

(4)下载依赖的软件包

[root@localhost gcc-13.2.0]# cd contrib/

[root@localhost contrib]# ls

[root@localhost gcc-13.2.0]# ./contrib/download_prerequisites

(5)创建编译目录

[root@localhost gcc-13.2.0]#mkdir gcc-build-13.2.0

(6)配置

[root@localhost gcc-build-13.2.0]# ../gcc-13.2.0/configure --prefix=/usr/local/gcc --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --with-multilib-list=lp64

(7)编译

[root@localhost gcc-build-13.2.0]# make -j $(nproc)

(8)安装

[root@localhost gcc-build-13.2.0]# make install

(9)查看系统当前的gcc版本

[root@localhost ~]# gcc –v

使用内建 specs。

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/7.3.0/lto-wrapper

目标:aarch64-linux-gnu

配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --with-multilib-list=lp64

线程模型:posix

gcc 版本 7.3.0 (GCC)

(10)设置环境变量

[root@localhost ~]# touch /etc/profile.d/gcc.sh

[root@localhost ~]# echo -e '\nexport PATH=/usr/local/gcc/bin:$PATH\n' >> /etc/profile.d/gcc.sh

(11)刷新环境变量

[root@localhost ~]# source /etc/profile.d/gcc.sh

(12)设置头文件

[root@localhost ~]# ln -sv /usr/local/gcc/include/c++/13.2.0 /usr/include/c++/13.2.0

(13)设置库文件

[root@localhost ~]# touch /etc/ld.so.conf.d/gcc.conf

[root@localhost ~]# echo -e "/usr/local/gcc/lib64" >> /etc/ld.so.conf.d/gcc.conf

(14)查看gcc版本

root@Kylin:~# gcc -v

使用内建 specs。

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/aarch64-linux-gnu/13.2.0/lto-wrapper

目标:aarch64-linux-gnu

配置为:../gcc-13.2.0/configure --prefix=/usr/local/gcc --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --with-multilib-list=lp64

线程模型:posix

Supported LTO compression algorithms: zlib

gcc 版本 13.2.0 (GCC)

(15)查看g++版本

root@Kylin:~# g++ -v

  • 37
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mindfulness code

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值