范丁丁
安装GCC 最快方法
2017-9-15 11:56
阅读:14965
标签:GMP, gcc

先下载最新版的GCC


http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz



解压:

tar --xz  -xvf gcc-7.2.0.tar.xz


cd gcc-7.2.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.


而按照这些软件包,费事,配置还麻烦;其实GCC已经替我们想好了,只是大家不知道,

直接运行:

./contrib/download_prerequisites

所有相关的软件就按照好了!!!

然后就可以方便的编译了。




nohup ./configure --disable-multilib --prefix=$PWD/../gcc 1>log 2>err &


nohup make -j 3 1>m.log 2>m.err &


make install


然后大功告成!!












转载本文请联系原作者获取授权,同时请注明本文来自范丁丁科学网博客。

链接地址:https://wap.sciencenet.cn/blog-717048-1076085.html?mobile=1

收藏

分享到:

当前推荐数:0
推荐到博客首页
网友评论2 条评论
确定删除指定的回复吗?
确定删除本博文吗?