gcc编译安装过程

1.先安装三个库 gmp mprc mpc 这三个库的源码要到官网去下载

1)安装gmp:首先建立源码同级目录 gmp-build,输入命令,第一次编译不通过,发现缺少一个叫m4的东西 于是就用apt-get下载了一个,继续编译,没有报错。make的时候出现大量信息并且生成一些文件在当前文件夹下,之后用make check检查一下,最后用make install安装

2)安装mpfr:

首先建立源码文件夹同级目录mpfr-build

然后进入该目录输入../mpfr-2.4.2/configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2

然后make

make check

make install

3)安装mpc

类似与上面 不过要把依赖关系包含进去具体命令如下

../mpc-0.8.1/configure --prefix=/usr/local/mpc-0.8.1 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2

然后同样是make

make check

make install

2.编译gcc

1)建立一个objdir来存放目标文件 然后进入该文件夹输入

/home/wulei/sourcecode/gcc-4.6.2/configure --prefix=/usr/local/gcc-4.6.2 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c --with-gmp=/usr/local/gmp-4.3.2/ --with-mpfr=/usr/local/mpfr-2.4.2/ --with-mpc=/usr/local/mpc-0.8.1/

最终用:../gcc-4.6.2/configure --prefix=/usr/gcc-4.6.9 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c --with-gmp=/usr/gmp-4.3.2 --with-mpfr=/usr/mpfr-2.4.2 --with-mpc=/usr/mpc-0.8.1
2)make

make check

make install

出现问题make的时候提示如下:

Checking for suffix of object files... configure: error: in `/home/wulei/sourcecode/gcc-4.6.2/i686-pc-linux-gnu/libgcc':

configure: error: cannot compute suffix of object files: cannot compile

See `config.log' for more details.

make[2]: *** [configure-stage1-target-libgcc] 错误 1

make[2]:正在离开目录 `/home/wulei/sourcecode/gcc-4.6.2'

make[1]: *** [stage1-bubble] 错误 2

make[1]:正在离开目录 `/home/wulei/sourcecode/gcc-4.6.2'

make: *** [all] 错误 2

于是 进入/home/wulei/sourcecode/gcc-4.6.2/i686-pc-linux-gnu/libgcc查看这个路径下的config.log

发现如下的错误提示:

/home/wulei/sourcecode/gcc-4.6.2/host-i686-pc-linux-gnu/gcc/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared ob    ject file: No such file or directory

上网查找这个问题

原因是因为linux在make的时候没有自动寻找新加入的库所以要用命令加入

LD_LIBRARY_PATH=/usr/local/mpc-0.8.1/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/gmp-4.3.2/lib

echo $LD_LIBRARY_PATH

export $LD_LIBRARY_PATH

lp

然而又遇到一个fatal error不知如何处理 正在处理中

追加处理:

问题终于全部搞清 根本原因是multiarchitecture的原因

只要再修改LIBRARY_PATH就可以了

exportLIBRARY_PATH=/usr/lib/x86_64-linux-gnu

suse linux编译安装GCC报错的更多相关文章

  1. linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql.

    linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql. 2013-03-04 1 ...

  2. Ubuntu操作系统编译安装zabbix报错汇总

    Ubuntu操作系统编译安装zabbix报错汇总 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.报错提示:"configure: error: MySQL libra ...

  3. Linux下安装redis报错信息

    redis在Linux安装报错 标签: redislinuxcentos 2017-02-24 13:46 384人阅读 评论(0) 收藏 举报  分类: Linux安装工具(2)  版权声明:本文为 ...

  4. 编译安装nginx报错 checking for C compiler ... not found

    编译安装在执行./configure步骤报错,是因为缺少环境变量 checking for C compiler - not found ./configure: error: C compiler ...

  5. Linux编译安装GCC

    1. 下载gcc安装包 网址:http://ftp.gnu.org/gnu/gcc/ ,下载对应的安装包,我选择gcc-5.5.0.tar.gz 2. 下载依赖库 一个是mpc,一个是gmp,一个是m ...

  6. Linux下安装vim-plug报错:Failed to connect to raw.githubusercontent.com port 443: Connection refused

    安装vim-plug时,输入以下命令: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.c ...

  7. suse linux 编译安装Apache时报“APR NOT FOUND”的解决方法

    今日编译apache时出错: #./configure --prefix……检查编辑环境时出现: checking for APR... noconfigure: error: APR not fou ...

  8. CentOS 5 64bit 编译安装MySQL报错

    报错情况:   在执行./configure时出现configure: error: No curses/termcap library found 解决方法: ./configure时加上参数--w ...

  9. 编译安装openssl报错:POD document had syntax errors at /usr/bin/pod2man line 69. make: *** [install_docs]

    错误如下: cms.pod around line 457: Expected text after =item, not a number cms.pod around line 461: Expe ...

随机推荐

  1. java web hello world

    首先在eclipse 里面创建一个java 动态项目, 记住路径,这里是直接通过根目录直接访问的webContent目录下面 的文件, 创建好后 ,在本地配置Tomcat服务器, 将server加入到 ...

  2. 一个简单的web服务器例子

    一个简单的web容器小例子,功能十分简单,只能访问静态资源,对于新手来说还是有一定的意义.主要分三个类 1.server类:主要功能开启socketServer,阻塞server,接收socket访问 ...

  3. 5 DML语言

    body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...

  4. Windows phone常用控件之Button

    Button类:表示一个响应 ButtonBase.Click 事件的 Windows 按钮控件. 继承层次结构: 命名空间:    System.Windows.Controls ClickMode ...

  5. Android 中LinearLayout控件属性

    id             为控件指定相应的ID        text           指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符        g ...

  6. swift从0加到1000(不包括1000)的五种写法

    用了while, do...while, for in, for in ... { temp += i i++ } println(temp) do { temp2 += j j++ } ) prin ...

  7. C# 数据结构 线性表(顺序表 链表 IList 数组)

    线性表 线性表是最简单.最基本.最常用的数据结构.数据元素 1 对 1的关系,这种关系是位置关系. 特点 (1)第一个元素和最后一个元素前后是没有数据元素,线性表中剩下的元素是近邻的,前后都有元素. ...

  8. 用typedef给结构体一个别名

    转:typedef 一.用typedef给结构体一个别名 typedef struct tagMyStruct { int iNum; long lLength; } MyStruct; 这语句实际上 ...

  9. WebApi(一)-实现跨域返回格式支持json

    1.创建webapi

  10. windows相关小知识

    获得本机MAC1 快捷键win+R打开运行窗口, 输入cmd回车进入控制台2 输入ipconfig -all  找到本地连接中的物理地址 根据IP获得MAC方法:1 进入cmd控制台,执行:ping ...