centos7 安装 gcc-6.2.0
来源:互联网 发布:双11淘宝活动方案 编辑:程序博客网 时间:2024/06/07 12:18
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
- centos7 安装 gcc-6.2.0
- Centos7 编译安装GCC 6.2.0
- CentOS7 安装 gcc-4.9.0
- Centos7 安装Gcc
- centos7编译安装gcc
- CentOS7 安装GCC 4.9.3
- centos7 linux下安装gcc
- Centos修炼----->Centos7之Gcc安装
- centos7.2编译安装gcc-4.9.2
- Centos7 安装sklearn gcc: error: ‘-Qunused-arguments’
- (三)CentOS7使用yum安装gcc
- CentOS7.1安装 GCC (GNU 编译器集)
- vmware下CentOS7.0 安装 GCC (GNU 编译器集) 及VMware Tools
- centos7安装arm-linux-gcc-4.4.3交叉编译器
- centos7安装python3.6.2
- CentOS7.0安装
- centos7.0安装教程
- centos7 安装 opencv3.0
- 图像二值化常用方法介绍
- CentOS7关闭防火墙
- Linux 下网络性能测试工具 iperf 的安装和使用
- 【JZOJ5082】【GDSOI2017第三轮模拟】Informatics Training
- Linux指令学习
- centos7 安装 gcc-6.2.0
- 图案输出(二)----输出平行四边形图案:(难度系数:小于半颗星)
- Spring入门之IOC
- A. Mike and palindrome
- 链表的总结(链表排序、翻转、删除节点)
- ajax跨域的问题
- (dfs)Anagrams by Stack
- 微信开发十 帐号管理
- 使用python-pymprog模块解决线性规划的问题