Android mysql安装 主从复制 mAPI ios file Draggabilly vue下载 spark算法 abaqus是什么软件 idea整理代码格式 python中的zip python中len函数 python类与对象 python时间戳 python设置环境变量 javapackage java的基本数据类型 java地址 java编程语言 java多线程教程 java入门基础 枪神传说辅助 神龙激活 剑三醉猿 pr黑场过渡 存储过程写法 机械键盘个别键位失灵 js字符串比较 quickchm kz文件 租房管理软件 php定时任务 lol特效盒子 python游戏编程 服务器软件 鲁迅体 工行天天益 直播源 电视应用安装器
当前位置: 首页 > 学习教程  > 

centos7 安装 gcc-6.2.0

2020/10/16 17:45:45 文章标签: centos7安装gcc

1. 下载 gcc-6.2.0 源码包,可以直接从 GCC 的FTP 上下载,随后解压 并从 contrib/download_prerequisites 文件内查看需要的依赖包 [rootnode1 software]# tar -zvxf gcc-6.2.0.tar.gz [rootnode1 software]# cd gcc-6.2.0/ [rootnode1 contrib]# vim …

1. 下载 gcc-6.2.0 源码包,可以直接从 GCC 的FTP 上下载,随后解压

    并从 contrib/download_prerequisites 文件内查看需要的依赖包

[root@node1 software]# tar -zvxf gcc-6.2.0.tar.gz

[root@node1 software]# cd gcc-6.2.0/

[root@node1 contrib]# vim contrib/download_prerequisites


下载依赖包

[root@node1 software]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2 

[root@node1 software]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2

[root@node1 software]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz


2. 安装 gmp

[root@node1 software]# bzip2 -d gmp-4.3.2.tar.bz2

[root@node1 software]# tar xvf gmp-4.3.2.tar

[root@node1 software]# cd gmp-4.3.2/

[root@node1 gmp-4.3.2]# ./configure --prefix=/opt/gcc-6.2.0

[root@node1 gmp-4.3.2]# make -j  //没问题

[root@node1 gmp-4.3.2]# make check //出错 参考http://www.linuxdiyf.com/linux/26770.html


......
/bin/sh: line 4: 182326 Segmentation fault      (core dumped) ${dir}$tst
FAIL: t-scan
......
====================================
1 of 58 tests failed
Please report to gmp-bugs@gmplib.org
====================================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2/tests/mpz'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2/tests/mpz'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2'
make: *** [check] Error 2
}
[root@node1 gmp-4.3.2]# vim config.log


[root@node1 gmp-4.3.2]# make install //好像说make check 出问题也没问题,只要make没错就可以,所以直接install
{
make  install-data-hook
make[4]: Entering directory `/home/huangx/hx/software/gmp-4.3.2'
make[4]: Warning: File `Makefile' has modification time 24640 s in the future


+-------------------------------------------------------------+
| CAUTION:                                                    |
|                                                             |
| If you have not already run "make check", then we strongly  |
| recommend you do so.                                        |
|                                                             |
| GMP has been carefully tested by its authors, but compilers |
| are all too often released with serious bugs.  GMP tends to |
| explore interesting corners in compilers and has hit bugs   |
| on quite a few occasions.                                   |
|                                                             |
+-------------------------------------------------------------+


make[4]: warning:  Clock skew detected.  Your build may be incomplete.
make[4]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2'
make[3]: warning:  Clock skew detected.  Your build may be incomplete.
make[3]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2'
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2'
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory `/home/huangx/hx/software/gmp-4.3.2'
make: warning:  Clock skew detected.  Your build may be incomplete.


3. 安装 mpfr

[root@node1 gmp-4.3.2]# cd ..

[root@node1 software]# bzip2 -d mpfr-2.4.2.tar.bz2

[root@node1 software]# tar xvf mpfr-2.4.2.tar

[root@node1 software]# cd mpfr-2.4.2/

[root@node1 mpfr-2.4.2]# ./configure --prefix=/opt/gcc-6.2.0

[root@node1 mpfr-2.4.2]# ./configure --prefix=/opt/gcc-6.2.0 --with-gmp=/opt/gcc-6.2.0

[root@node1 mpfr-2.4.2]# make

[root@node1 mpfr-2.4.2]# make install


4. 安装 mpc

[root@node1 mpfr-2.4.2]# cd ..

[root@node1 software]# tar xvf mpc-0.8.1.tar.gz

[root@node1 software]# cd mpc-0.8.1/

[root@node1 mpc-0.8.1]# ./configure --prefix=/opt/gcc-6.2.0 --with-gmp=/opt/gcc-6.2.0 --with-mpfr=/opt/gcc-6.2.0

[root@node1 mpc-0.8.1]# make -j

[root@node1 mpc-0.8.1]# make install


5. 安装 gcc

[root@node1 mpc-0.8.1]# cd ..

[root@node1 software]# cd gcc-6.2.0/

[root@node1 gcc-6.2.0]# mkdir build

[root@node1 gcc-6.2.0]# cd build/

[root@node1 build]# ../configure --prefix=/opt/gcc-6.2.0 --with-gmp=/opt/gcc-6.2.0 --with-mpfr=/opt/gcc-6.2.0 --with-mpc=/opt/gcc-6.2.0 -enable-checking=release -enable-languages=c,c++ -disable-multilib

[root@node1 build]# make

[root@node1 build]# make install


6. 设置环境变量

[root@node1 software]# export PATH=/opt/gcc-6.2.0/bin:$PATH

[root@node1 software]# export LD_LIBRARY_PATH=/opt/gcc-6.2.0/lib:$LD_LIBRARY_PATH


7. 查看gcc版本

[root@node1 ~]# gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/opt/gcc-6.2.0/libexec/gcc/x86_64-pc-linux-gnu/6.2.0/lto-wrapper

Target: x86_64-pc-linux-gnu

Configured with: ../configure --prefix=/opt/gcc-6.2.0 --with-gmp=/opt/gcc-6.2.0 --with-mpfr=/opt/gcc-6.2.0 --with-mpc=/opt/gcc-6.2.0 -enable-checking=release -enable-languages=c,c++ -disable-multilib

Thread model: posix

gcc version 6.2.0 (GCC)



参考 http://blog.csdn.net/stormbjm/article/details/9107831


本文链接: http://www.dtmao.cc/news_show_300096.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?