码迷,mamicode.com
首页 > 其他好文 > 详细

如何设置gcc5.0与gcc4.9的优先级

时间:2017-12-09 19:43:38      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:using   bin   step   alter   /usr   tco   nat   issue   5.0   

环境准备:Ubuntu16,matlab2017(目前只支持gcc4.9)

You could set priority to use [g++/gcc-4.9] before [g++/gcc-5] .

Follow these steps:

--> Make sure gcc-4.9 and g++-4.9 are installed.
~$ sudo apt-get install gcc-4.9 g++-4.9

--> Set "priority=100" for gcc-4.9 and "priority=50" for gcc-5.
~$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100
~$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.0 50

--> Set "priority=100" for g++-4.9 and "priority=50" for g++-5.
~$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100
~$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5.0 50

--> Verify the priority settings using:
~$ update-alternatives --query gcc

Name: gcc
Link: /usr/bin/gcc
Status: auto
Best: /usr/bin/gcc-4.9
Value: /usr/bin/gcc-4.9

Alternative: /usr/bin/gcc-4.9
Priority: 100

Alternative: /usr/bin/gcc-5
Priority: 50

~$ update-alternatives --query g++

Name: g++
Link: /usr/bin/g++
Status: auto
Best: /usr/bin/g++-4.9
Value: /usr/bin/g++-4.9

Alternative: /usr/bin/g++-4.9
Priority: 100

Alternative: /usr/bin/g++-5
Priority: 50
参考https://github.com/vlfeat/matconvnet/issues/967

如何设置gcc5.0与gcc4.9的优先级

标签:using   bin   step   alter   /usr   tco   nat   issue   5.0   

原文地址:http://www.cnblogs.com/xlqtlhx/p/8012249.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!