在centos 64下面安装gcc 4.1.2
2014-01-27 14:58
330 查看
因为编译的机器装了centos 6.5,上面的gcc比较新是4.7,而外面运行的机器试centos5.6,所以编译的程序放到上面跑了之后就会出现 /lib64/libc.so.6: version `GLIBC_2.8' not found等错误(就是libc的版本太低,不支持2.8,我们可以用命令 strings /lib64/libc.so.6 | grep GLIBC_来看库支持的版本)。 所以打算在编译的机器上重新装一个4.1.2的gcc。
安装的基本步骤没什么好说的,就是下载源码 ——》configure ——》 make ——》make install。但是过程却没这么顺利,中间出现了很多问题。
1)configure 没有错误,但make的时候出现 错误
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
a. 到网上搜索了一下,大部分的解决方案都是说
configure文件中texinfo对该版本不支持,可以在解压gcc4.1.2文件夹中的configure文件里找到
以下语句
# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
| egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
fi
;;
其中4\.[2-9]|[5-9]表示的是支持4.2-4.9之间的几个版本,所以需要自己添加4\.[1-9][0-9]*,以支持4.1版本。即把'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])'编辑成'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])'后保存,编译通过。
但尝试之后失败
b. 输入命令 makeinfo --version 提示说是没有命令,那么应该是没有这个库,所以下载安装这个库 texinfo 4.7。但在make的时候说是 undefined references to `tputs',然后又查了一下要 先装 ncurses-5.6,于是又下载了安装,这次make
texinfo的时候果然OK了。
c. 继续回来安装 gcc,上次的错误这次终于没有了,但又出现一个新才错误 gnu/stubs-32.h: No such file or directory。继续google,重新configure,并增加选项:
./configure --enable-languages=c,c++ --disable-multilib
make j 8
make install
这次成功了。
--enable-languages=c,c++, 表示只要c,c++的gcc,不然什么语言都支持,编译会很耗时
如果不添加--disable-multilib, 那么会出现stub-32.h找不到的错误
而 -j 8使用8个线程来并行编译
安装的基本步骤没什么好说的,就是下载源码 ——》configure ——》 make ——》make install。但是过程却没这么顺利,中间出现了很多问题。
1)configure 没有错误,但make的时候出现 错误
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
a. 到网上搜索了一下,大部分的解决方案都是说
configure文件中texinfo对该版本不支持,可以在解压gcc4.1.2文件夹中的configure文件里找到
以下语句
# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
| egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
fi
;;
其中4\.[2-9]|[5-9]表示的是支持4.2-4.9之间的几个版本,所以需要自己添加4\.[1-9][0-9]*,以支持4.1版本。即把'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])'编辑成'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])'后保存,编译通过。
但尝试之后失败
b. 输入命令 makeinfo --version 提示说是没有命令,那么应该是没有这个库,所以下载安装这个库 texinfo 4.7。但在make的时候说是 undefined references to `tputs',然后又查了一下要 先装 ncurses-5.6,于是又下载了安装,这次make
texinfo的时候果然OK了。
c. 继续回来安装 gcc,上次的错误这次终于没有了,但又出现一个新才错误 gnu/stubs-32.h: No such file or directory。继续google,重新configure,并增加选项:
./configure --enable-languages=c,c++ --disable-multilib
make j 8
make install
这次成功了。
--enable-languages=c,c++, 表示只要c,c++的gcc,不然什么语言都支持,编译会很耗时
如果不添加--disable-multilib, 那么会出现stub-32.h找不到的错误
而 -j 8使用8个线程来并行编译
相关文章推荐
- 在centos 64下面安装gcc 4.1.2
- 在centos 6.5下面安装gcc 4.1.2
- CentOS 5.8_64 环境下面安装Pip 报ValueError: check_hostname requires server_hostname 解决办法
- CentOS 6.4 x86_64 安装GCC 4.7.3
- CentOS 6.4 x86_64 安装GCC 4.7.3
- CentOS-6.3-x86_64-minimal安装gcc
- C + CentOS 64 Bit+gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-46), dirname
- 远程连接CentOS 6.5 x86_64服务器, 在个人用户名下安装gcc-4.7.3
- RHEL5.4 x86_64 GCC 4.1.2 升级到4.7.0版过程(含安装MPFR、GMP、MPC过程)
- CentOS5.2下安装GCC4.1.2
- CentOS5.2下安装GCC4.1.2
- Hadoop学习笔记-010-CentOS_6.5_64_HA高可用-Hadoop2.6+Zookeeper3.4.5安装Hbase1.0.0
- centos nginx安装问题/gcc编译问题
- 在centos上安装gcc 4.8
- VMware安装centos_7_64
- centos6.5下面的qt安装于都家教网,于都人自己的家教网站<a garget="_blank" href="www.yudujiajiao.com">www.yudujiao.com</a>
- linux(CentOS 5.4 x86_64) 安装 RVM 前期准备 (需要,必要的安装包)
- 使用PXE+DHCP+Apache+Kickstart批量安装CentOS5.4 x86_64
- CentOS6.9_X86_64 Oracle 11g r2 DataGuard安装配置
- 【CentOS 6.5】安装gcc-4.8.2和Qt5.2