【Linux】-NO.86.Linux.6.C.1.001-【CentOS 7 Install GCC】-
1.0.0 Summary
Tittle:【Linux】-NO.86.Linux.6.C.1.001-【CentOS 7 Install GCC】-
Style:Java
Series:Log4j
Since:2017-04-24
End:2017-05-07
Total Hours:30+
Degree Of Diffculty:5
Degree Of Mastery:5
Practical Level:5
Desired Goal:5
Archieve Goal:3
Gerneral Evaluation:3
Writer:kingdelee
Related Links:
http://www.cnblogs.com/kingdelee/
http://blog.csdn.net/hanzheng260561728/article/details/75125891
http://www.linuxidc.com/Linux/2017-12/149506.htm
https://www.cnblogs.com/davygeek/p/8018628.html
http://www.linuxidc.com/Linux/2017-12/149506.htm
http://www.codeweblog.com/%E7%AC%94%E8%AE%B0-centos%E4%B8%8A%E6%BA%90%E7%A0%81%E5%AE%89%E8%A3%85gcc-4-8-2/
1.Question
tar (child): lbzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
2.Dispose
yum -y install bzip2
If have no web:
tar zxvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
#为编译做准备,创建libbz2.so动态链接库(这一步很重要,安装python的时候如果没有这一步,python安装不上bz2模块):
make -f Makefile-libbz2_so
make && make install
3. GCC安装报错,需要以下几个组件
https://gcc.gnu.org/gcc-7/
http://mirrors.concertpass.com/gcc/releases/gcc-7.3.0/
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.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
ftp://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.
3.1 安装 GMP
https://gmplib.org/
https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz
因为上面是lz的,所以还要下载安装lz解压工具 http://ftp.yzu.edu.tw/nongnu/lzip/lzip-1.19.tar.gz 然后安装(下同) ./configure make make install
安装gmp:
./configure 报 m4未安装:
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons). 解决 安装m4:
http://ftp.gnu.org/gnu/m4/
http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz 对m4
./configure
make
make install 对 gmp:
./configure
终于成功,继续 make;
make install
3.2 安装 MPFR
http://www.mpfr.org/mpfr-current/#download
http://www.mpfr.org/mpfr-current/mpfr-4.0.0.tar.gz
安装(cmm下同: ./configure;make;make install)
3.3 安装 MPC
http://ftp.gnu.org/gnu/mpc/
http://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
cmm
3.3 安装 isl
checking for isl 0.15 or later... no
required isl version is 0.15 or later
The following languages will be built: c,c++,fortran,lto,objc
*** This configuration is not supported in the following subdirectories:
gnattools gotools target-libada target-libhsail-rt target-libgo target-libffi target-liboffloadmic
(Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.
ftp://gcc.gnu.org/pub/gcc/infrastructure/
ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
tar -xjf isl-0.18.tar.bz2
CMM
4.重回安装 GCC
在/home/lee/download/gcc-7.3.0新建一个build,在此目录下执行:
../configure --prefix=/usr/local/gcc-7.3.0 --enable-checking=release --enable-languages=c,c++,go --disable-multilib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
make 4j
make install
期间耗时1个多小时+
5.配置
vim /etc/profile
source /etc/profile
6.
配置libstdc++.so.6
在 build
文件夹里找到 libstdc++.so.*
:
find . -name "libstdc++.so.*" | xargs ls -al
复制到 /usr/lib64
目录下:
sudo cp libstdc++.so.6.0.20 /usr/lib64
sudo ldconfig
[root@hadoop1 bin]# find / -name gcc
/home/lee/download/gcc-7.3.0/gcc
/home/lee/download/gcc-7.3.0/build/gcc
/usr/bin/gcc
/usr/lib/gcc
/usr/libexec/gcc
/usr/local/gcc-7.3.0/libexec/gcc
/usr/local/gcc-7.3.0/lib/gcc
/usr/local/gcc-7.3.0/bin/gcc
/usr/bin
mv gcc gcc.bak
mv g++ g++.bak
ln -s /usr/local/gcc-7.3.0/bin/gcc gcc
ln -s /usr/local/gcc-7.3.0/bin/g++ g++
gcc --version
g++ -version
【Linux】-NO.86.Linux.6.C.1.001-【CentOS 7 Install GCC】-的更多相关文章
- 【Tomcat】Tomcat Connector的三种运行模式【bio、nio、apr】
Tomcat Connector(Tomcat连接器)有bio.nio.apr三种运行模式 bio bio(blocking I/O,阻塞式I/O操作),表示Tomcat使用的是传统的Java I/O ...
- 【转】windows和linux中搭建python集成开发环境IDE
本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...
- 【转发】RedHat Enterprise Linux 6.4 使用 Centos 6 的yum源问题
作为一名新手,学习Linux已经一个月了,其间遇到了不少问题,而今天笔者遇到的问题是 #yum install pam-devel #This system is not registered to ...
- 【Linux】-NO.8.Linux.4.Command.1.001-【Common Command】-
1.0.0 Summary Tittle:[Linux]-NO.8.Linux.4.Command.1.001-[Common Command]- Style:Linux Series:Command ...
- 【Linux】-NO.9.Linux.5.Nexus.1.001-【CentOS 7 Install Nexus 3.3】-
1.0.0 Summary Tittle:[Linux]-NO.9.Linux.5.Nexus.1.001-[CentOS 7 Install Nexus 3.3]- Style:Linux Seri ...
- 【Linux】-NO.5.Linux.1.CentOS.1.001-【CentOS7 Foundation Configuration】-
1.0.0 Summary Tittle:[Linux]-NO.5.Linux.1.CentOS.1.001-[CentOS7 Foundation Configuration]- Style:Lin ...
- 【Linux】-NO.6.Linux.2.JDK.1.001-【CentOS 7 Install JDK 8u121】-
1.0.0 Summary Tittle:[Linux]-NO.6.Linux.2.JDK.1.001-[CentOS 7 Install JDK 8u121]- Style:Linux Series ...
- 【Linux】-NO.7.Linux.3.Maven.1.001-【CentOS 7 Install Maven 3.5】-
1.0.0 Summary Tittle:[Linux]-NO.7.Linux.3.Maven.1.001-[CentOS 7 Install Maven 3.5]- Style:Linux Seri ...
- 【原创】linux命令-Axel命令 - linux多线程下载 - 费元星 - 未来星开发团队
[费元星版权Q:9715234] Axel 是 Linux 下一个不错的HTTP/FTP高速下载工具.支持多线程下载.断点续[费元星版权Q:9715234]传,且可以从多个地址或者从一个地址的多个连接 ...
随机推荐
- 【iCore4 双核心板_FPGA】实验十八:Niosii——基于内部RAM建立第一个软核
实验指导书及源代码下载地址: 链接:https://pan.baidu.com/s/1mjpwGJI 密码:6u8v iCore4链接:
- 【iCore4 双核心板_ARM】例程二十五:LWIP_DNS实验——域名解析
实验现象: 核心代码: int main(void) { system_clock.initialize(); led.initialize(); adc.initialize(); delay.in ...
- am335x ubi Read-only mode
是因为kernel里面有一个错误,要注释一下就好.
- IDEA设置换行符为Unix编码格式,设置编码统一为UTF-8,自动生成serialVersionUID
设置换行符为Unix编码格式 设置编码统一为UTF-8 自动生成serialVersionUID.勾选"Serializable class without serialVersionUID ...
- 【ML入门系列】(二)分类与回归
前言 在机器学习中,“分类”和“回归”这两个词经常听说,但很多时候我们却混为一谈.本文主要从应用场景.训练算法等几个方面来叙述两者的区别. 本质区别 分类和回归的区别在于输出变量的类型.分类的输出是离 ...
- 在Ubuntu主机下实现与Windows虚拟机共享文件夹
一.概述 由于要实现Ubuntu主机中的一些文件与Windows虚拟机共享,因此要创建一个共享文件夹映射到虚拟机中. 网上许多都是Windows主机+Linux虚拟机的配置,在此分享主机是Linux的 ...
- Google API Design Guide (谷歌API设计指南)中文版
面向资源的设计 这份设计指南的目标是帮助开发人员设计简单.一致.易用的网络API.同时,它也有助于收敛基于socket的API和(注:原文是with,这里翻译为“和”)基于HTTP的REST API. ...
- ABBYY PDF Transformer+支持的格式
ABBYY PDF Transformer+是一个新的,全面的巧妙解决PDF文档的工具,它将泰比的光学字符识别(OCR)技术和Adobe®PDF技术完美结合,以确保实现便捷地处理任何类型的PDF文件, ...
- .net读取Excel转datatable、.net读取的Excel存在合并单元格并且转成datatable
项目中经常会遇到Excel导入数据,Excel的模板会可能是存在合并单元格的,模板如下图所示 读取时需要填充合并单元格的值,转成datatable单元格值时,填充合并单元格的值,如下图所示: 合并单元 ...
- Spring data Jpa,Mybatis,读写锁,@Lock 使用
Spring data jpa 支持注解式的读写锁(悲观锁),实际上这个东西硬编码也简单,但是基于Jpa 命名方式定义的Sql,只能用注解添加支持读写锁了, 不了解读写锁的可以点这里 mysql读写锁 ...