<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>安装gcc 6.3 &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/%e5%ae%89%e8%a3%85gcc-6-3/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Mon, 27 Apr 2020 17:07:27 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] 在Ubuntu 14.04中安装gcc 6</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8ubuntu-14-04%e4%b8%ad%e5%ae%89%e8%a3%85gcc-6/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8ubuntu-14-04%e4%b8%ad%e5%ae%89%e8%a3%85gcc-6/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Fri, 14 Jul 2017 17:18:06 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[ELL]]></category>
		<category><![CDATA[Ubuntu 14.04]]></category>
		<category><![CDATA[安装gcc 6.3]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=9496</guid>

					<description><![CDATA[<p>
成功编译<a href="https://github.com/Microsoft/ELL" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122);">ELL</span></a>对gcc版本有要求，这而这一点在ELL的文档中并没有写。<br />
gcc版本太低了是不行的，那么什么算版本低？反正我的gcc 4.8.4是不work的&#8212;&#8212;使用低版本的gcc，你也可以照着文档完成很多步骤，但是到最后某一步，一定会遇到由于gcc版本低导致的问题，并且还没有直观的错误提示，查找问题源头可能会浪费你很多时间。<br />
<span id="more-9496"></span><br />
我在ELL的issue列表中看到有人说用gcc 6.3是OK的。但是，在Ubuntu 14.04上通过编译源码安装gcc 6并不那么容易。通过Google，我找到了如下<a href="http://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122);">这个</span></a>很棒的答案，只需要在命令行粘贴如下命令再回车，就安装上了gcc 6，实在太爽：</p>
<pre class="bash" style="padding: 6px; border-style: solid; border-color: rgb(153, 153, 153); background: rgb(244, 244, 255); color: rgb(15, 15, 15); font-size: 15px;">
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> build-essential software-properties-common <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> add-apt-repository ppa:ubuntu-toolchain-r<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(122, 8, 116); font-weight: bold;">test</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-snapshot <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-<span style="color: rgb(0, 0, 0);">6</span> g++-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> update-alternatives <span style="color: rgb(102, 0, 51);">--install</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>gcc-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(0, 0, 0);">60</span> <span style="color: rgb(102, 0, 51);">--slave</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>g++-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-<span style="color: rgb(0, 0, 0);">4.8</span> g++-<span style="color: rgb(0, 0, 0);">4.8</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&#38;&#38;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> update-alternatives <span style="color: rgb(102, 0, 51);">--install</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>gcc-<span style="color: rgb(0, 0, 0);">4.8</span> <span style="color: rgb(0, 0, 0);">60</span> <span style="color: rgb(102, 0, 51);">--slave</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>g++-<span style="color: rgb(0, 0, 0);">4.8</span>;</pre>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8ubuntu-14-04%e4%b8%ad%e5%ae%89%e8%a3%85gcc-6/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
成功编译<a href="https://github.com/Microsoft/ELL" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122);">ELL</span></a>对gcc版本有要求，这而这一点在ELL的文档中并没有写。<br />
gcc版本太低了是不行的，那么什么算版本低？反正我的gcc 4.8.4是不work的&mdash;&mdash;使用低版本的gcc，你也可以照着文档完成很多步骤，但是到最后某一步，一定会遇到由于gcc版本低导致的问题，并且还没有直观的错误提示，查找问题源头可能会浪费你很多时间。<br />
<span id="more-9496"></span><br />
我在ELL的issue列表中看到有人说用gcc 6.3是OK的。但是，在Ubuntu 14.04上通过编译源码安装gcc 6并不那么容易。通过Google，我找到了如下<a href="http://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122);">这个</span></a>很棒的答案，只需要在命令行粘贴如下命令再回车，就安装上了gcc 6，实在太爽：</p>
<pre class="bash" style="padding: 6px; border-style: solid; border-color: rgb(153, 153, 153); background: rgb(244, 244, 255); color: rgb(15, 15, 15); font-size: 15px;">
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> build-essential software-properties-common <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> add-apt-repository ppa:ubuntu-toolchain-r<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(122, 8, 116); font-weight: bold;">test</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-snapshot <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get update</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-<span style="color: rgb(0, 0, 0);">6</span> g++-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> update-alternatives <span style="color: rgb(102, 0, 51);">--install</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>gcc-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(0, 0, 0);">60</span> <span style="color: rgb(102, 0, 51);">--slave</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>g++-<span style="color: rgb(0, 0, 0);">6</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get install</span> gcc-<span style="color: rgb(0, 0, 0);">4.8</span> g++-<span style="color: rgb(0, 0, 0);">4.8</span> <span style="color: rgb(102, 0, 51);">-y</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">&amp;&amp;</span> \
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> update-alternatives <span style="color: rgb(102, 0, 51);">--install</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>gcc-<span style="color: rgb(0, 0, 0);">4.8</span> <span style="color: rgb(0, 0, 0);">60</span> <span style="color: rgb(102, 0, 51);">--slave</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span><span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">g++</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>usr<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>bin<span style="color: rgb(0, 0, 0); font-weight: bold;">/</span>g++-<span style="color: rgb(0, 0, 0);">4.8</span>;</pre>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
安装完成后，使用如下命令选择gcc版本：</p>
<pre class="bash" style="padding: 6px; border-style: solid; border-color: rgb(153, 153, 153); background: rgb(244, 244, 255); color: rgb(15, 15, 15); font-size: 15px;">
<span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> update-alternatives <span style="color: rgb(102, 0, 51);">--config</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">gcc</span></pre>
<p>会打印出如下提示：</p>
<blockquote>
<div>
		There are 2 choices for the alternative gcc (providing /usr/bin/gcc).</div>
<div>
		&nbsp;</div>
<div>
		&nbsp; Selection &nbsp; &nbsp;Path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Priority &nbsp; Status</div>
<div>
		------------------------------------------------------------</div>
<div>
		* 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/bin/gcc-6 &nbsp; &nbsp; 60 &nbsp; &nbsp; &nbsp; &nbsp;auto mode</div>
<div>
		&nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/bin/gcc-4.8 &nbsp; 60 &nbsp; &nbsp; &nbsp; &nbsp;manual mode</div>
<div>
		&nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/bin/gcc-6 &nbsp; &nbsp; 60 &nbsp; &nbsp; &nbsp; &nbsp;manual mode</div>
</blockquote>
<p>直接回车就是使用默认的gcc 6.3。<br />
此时，再用 gcc -v 命令检查一下版本，我的输出如下：</p>
<blockquote>
<div>
		Using built-in specs.</div>
<div>
		COLLECT_GCC=gcc</div>
<div>
		COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper</div>
<div>
		Target: x86_64-linux-gnu</div>
<div>
		Configured with: ...(内容很长，省略)</div>
<div>
		Thread model: posix</div>
<div>
		gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~14.04)</div>
</blockquote>
<div>
	这就OK了。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8ubuntu-14-04%e4%b8%ad%e5%ae%89%e8%a3%85gcc-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
