最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux超詳細gcc升級全過程

 更新時間:2021年11月29日 08:50:33   作者:IT邦德  
大家好,本篇文章主要介紹了Linux超詳細gcc升級全過程,感興趣的同學趕快來看一看吧,對你有幫助的話記得收藏,方便下次瀏覽

前言

c c++ 等等 需要這個編譯器gcc,最近有DBA的朋友咨詢RHEL7.6操作系統(tǒng)安裝Mysql數(shù)據(jù)庫時需要 高版本的GCC,研究了下發(fā)現(xiàn)坑不少,總結(jié)本文分享給大家

1.當前gcc版本

[root@rhel76 ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --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++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 

從以上可以看出當前版本為4.8.5,本次我們升級到10.1.0

2.安裝gcc

--下載地址:
https://mirrors.aliyun.com/gnu/gcc/gcc-10.1.0/

[root@rhel76 ~]# tar -vxf gcc-10.1.0.tar.gz
[root@rhel76 gcc-10.1.0]# mkdir build
[root@rhel76 gcc-10.1.0]# cd build/
[root@rhel76 build]# ../configure --prefix=/usr/local/gcc-10.1.0/ --enable-checking=release --enable-languages=c,c++ --disable-multilib


checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libhsail-rt support... yes
checking for libphobos support... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
https://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

從日志總可以看出有如下報錯,故下面每個都安裝
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.

3.gmp安裝

[root@jeames007 ~]# tar -vxf gmp-5.0.1.tar.bz2
[root@jeames007 ~]# cd gmp-5.0.1/
[root@jeames007 gmp-5.0.1]# ./configure --prefix=/usr/local/gmp-5.0.1
[root@jeames007 gmp-5.0.1]# make
[root@jeames007 gmp-5.0.1]# make install
make[4]: Leaving directory `/root/gmp-5.0.1'
make[3]: Leaving directory `/root/gmp-5.0.1'
make[2]: Leaving directory `/root/gmp-5.0.1'
make[1]: Leaving directory `/root/gmp-5.0.1'

4.MPFR編譯

[root@jeames007 ~]# tar -vxf mpfr-3.1.5.tar.xz

[root@jeames007 ~]# cd mpfr-3.1.5/
[root@jeames007 ~]#./configure --prefix=/usr/local/mpfr-3.1.5 --with-gmp=/usr/local/gmp-5.0.1
[root@jeames007 mpfr-3.1.5]# make
[root@jeames007 mpfr-3.1.5]# make install

5.MPC編譯

[root@jeames007 ~]# tar -vxf mpc-1.0.1.tar.gz
[root@jeames007 ~]# cd mpc-1.0.1
[root@jeames007 ~]# ./configure --prefix=/usr/local/mpc-1.0.1 --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.5
[root@jeames007 mpc-1.0.1]# make
[root@jeames007 mpc-1.0.1]# make install

6.GCC 配置

[root@rhel76 ~]# cd gcc-10.1.0
[root@rhel76 gcc-10.1.0]# cd build/
../configure --prefix=/usr/local/gcc-10.1.0/ --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.5 --with-mpc=/usr/local/mpc-1.0.1


checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libhsail-rt support... yes
checking for libphobos support... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... buggy but acceptable
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... yes
checking for isl 0.15 or later... no
required isl version is 0.15 or later
*** This configuration is not supported in the following subdirectories:
     gnattools gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libobjc target-liboffloadmic
    (Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... no
/root/gcc-10.1.0/missing: line 81: makeinfo: command not found
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for otool... no
checking for readelf... readelf
checking for cc... cc
checking for c++... c++
checking for gcc... gcc
checking for gfortran... gfortran
checking for gccgo... no
checking for gdc... no
checking for ar... no
checking for ar... ar
checking for as... no
checking for as... as
checking for dlltool... no
checking for dlltool... no
checking for ld... no
checking for ld... ld
checking for lipo... no
checking for lipo... no
checking for nm... no
checking for nm... nm
checking for objcopy... no
checking for objcopy... objcopy
checking for objdump... no
checking for objdump... objdump
checking for otool... no
checking for otool... no
checking for ranlib... no
checking for ranlib... ranlib
checking for readelf... no
checking for readelf... readelf
checking for strip... no
checking for strip... strip
checking for windres... no
checking for windres... no
checking for windmc... no
checking for windmc... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gfortran... host tool
checking where to find the target gccgo... host tool
checking where to find the target gdc... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objcopy... host tool
checking where to find the target objdump... host tool
checking where to find the target otool... host tool
checking where to find the target ranlib... host tool
checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile

[root@jeames007 ~]# make -j4
make 時間很長,很長,耐心等待,本人編譯了1個小時。所以有條件的話,在編譯時,可以使用make -j8

[root@jeames007 build]# make install

此時GCC版本還未更新下,需要以下的操作

7.GCC版本更新

mv /usr/bin/gcc /usr/bin/gcc485
mv /usr/bin/g++ /usr/bin/g++485
mv /usr/bin/c++ /usr/bin/c++485
mv /usr/bin/cc /usr/bin/cc485


ln -s /usr/local/gcc-10.1.0/bin/gcc /usr/bin/gcc
ln -s /usr/local/gcc-10.1.0/bin/g++ /usr/bin/g++
ln -s /usr/local/gcc-10.1.0/bin/c++ /usr/bin/c++
ln -s /usr/local/gcc-10.1.0/bin/gcc /usr/bin/cc


mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bak
ln -s /usr/local/gcc-10.1.0/lib64/libstdc++.so.6.0.28 /usr/lib64/libstdc++.so.6


腳本執(zhí)行成功之后就可以查看當前使用的gcc版本了  查看的命令:gcc -v

[root@jeames007 ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-10.1.0/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-10.1.0/ --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.5 --with-mpc=/usr/local/mpc-1.0.1
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC)

在這里插入圖片描述

到此這篇關(guān)于Linux超詳細gcc升級全過程的文章就介紹到這了,更多相關(guān)Linux gcc升級內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • CentOS 7使用samba共享文件夾的完整步驟

    CentOS 7使用samba共享文件夾的完整步驟

    這篇文章主要給大家介紹了關(guān)于CentOS 7使用samba共享文件夾的完整步驟,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面來一起學習學習吧
    2019-07-07
  • centos7.6批量增加修改刪除虛擬網(wǎng)卡操作介紹

    centos7.6批量增加修改刪除虛擬網(wǎng)卡操作介紹

    大家好,本篇文章主要講的是centos7.6批量增加修改刪除虛擬網(wǎng)卡操作介紹,感興趣的同學趕快來看一看吧,對你有幫助的話記得收藏一下
    2021-12-12
  • Linux運維基礎(chǔ)系統(tǒng)磁盤管理教程

    Linux運維基礎(chǔ)系統(tǒng)磁盤管理教程

    這篇文章主要介紹了Linux運維基礎(chǔ)系統(tǒng)磁盤管理教程,附含詳細的源碼示例,有需要的朋友可以借鑒參考下,希望可以有所幫助,祝大家同學習共進步
    2021-09-09
  • Linux服務器安裝pytorch和scanpy流程

    Linux服務器安裝pytorch和scanpy流程

    文章詳細記錄了作者在Linux上安裝PyTorch和Scanpy的艱難過程,包括環(huán)境創(chuàng)建、包安裝、依賴關(guān)系處理以及遇到的沖突和解決方法,最終,作者成功在服務器上安裝了兼容的PyTorch和Scanpy版本
    2025-02-02
  • CentOS桌面環(huán)境中網(wǎng)卡啟動失敗的解決方法

    CentOS桌面環(huán)境中網(wǎng)卡啟動失敗的解決方法

    這篇文章主要為大家詳細介紹了CentOS桌面環(huán)境中網(wǎng)卡啟動失敗的解決方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-11-11
  • Linux統(tǒng)計一個文件中特定字符個數(shù)的方法

    Linux統(tǒng)計一個文件中特定字符個數(shù)的方法

    今天小編就為大家分享一篇關(guān)于Linux統(tǒng)計一個文件中特定字符個數(shù)的方法,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2019-03-03
  • 在Linux系統(tǒng)下如何編譯并執(zhí)行C++程序

    在Linux系統(tǒng)下如何編譯并執(zhí)行C++程序

    這篇文章主要介紹了在Linux系統(tǒng)下如何編譯并執(zhí)行C++程序問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-01-01
  • linux tomcat配置https的方法

    linux tomcat配置https的方法

    這篇文章主要介紹了linux tomcat配置https的方法,需要的朋友可以參考下
    2017-08-08
  • CentOS Linux服務器安全設(shè)置

    CentOS Linux服務器安全設(shè)置

    這篇文章主要介紹了阿里云linux服務器安全設(shè)置,無論是配置任何服務器,我們都必須把不用的服務關(guān)閉、把系統(tǒng)權(quán)限設(shè)置到最小話,這樣才能保證服務器最大的安全,下面是CentOS服務器安全設(shè)置,供大家參考,需要的朋友可以參考下
    2016-10-10
  • Windows 10 下安裝 Apache 2.4.41的教程

    Windows 10 下安裝 Apache 2.4.41的教程

    這篇文章主要介紹了Windows 10 下安裝 Apache 2.4.41的教程,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-01-01

最新評論

赞皇县| 攀枝花市| 高陵县| 荥经县| 米易县| 富民县| 清涧县| 通许县| 永春县| 泰来县| 托里县| 荆门市| 孟连| 昭通市| 遂平县| 定襄县| 南木林县| 荔浦县| 土默特左旗| 江油市| 乐清市| 全州县| 恭城| 镇江市| 惠水县| 河西区| 蒙城县| 轮台县| 吴江市| 奉化市| 寿阳县| 定陶县| 大邑县| 水城县| 项城市| 云和县| 兴和县| 霸州市| 印江| 青河县| 巨野县|