Debian8.5安装编译GCC6.1.0笔记

来源:互联网 发布:网络运营商 编辑:程序博客网 时间:2024/05/29 13:05

首先.debian 默认的软件安装源比较旧,

先添加国内比较新:

##163源
deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

##中科大源
deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
deb http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free

中科大还有个软件源配置生成器,比较有意思https://lug.ustc.edu.cn/repogen/。

以上出自 “Guanglin的51CTO博客” 博客,
http://guanglin.blog.51cto.com/3038587/1689670

----------------------------华丽分割------------------------------------

安装依赖库;

apt install build-essential  libgmp-dev libmpfr-dev libmpc-dev


先从GNU官方下载最新版的源码:

可以从SVN,GIT或是HTTP FTP MIRRORS,(具体参考 http://gcc.gnu.org/)

我是直接从ftp mirrors下载

ftp://gd.tuwien.ac.at/gnu/gcc/releases/gcc-6.1.0/gcc-6.1.0.tar.gz

进入root终端.

建立新目录 /root/Dev_GCC

下载源码到该目录,

tar -xf gcc-6.1.0.tar.gz

进入gcc-6.1.0

./configure --disable-multilib #因为我安装的是debian amd64,且只需要编译64位程序

自动生成 makefile文件

直接 makefile 

然后经过漫长的等待后

make install

重新起动..


0 0