如何设置gcc5.0与gcc4.9的优先级
Posted PirateLHX
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何设置gcc5.0与gcc4.9的优先级相关的知识,希望对你有一定的参考价值。
环境准备: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的优先级的主要内容,如果未能解决你的问题,请参考以下文章
如何在 gcc4.9 中设置 GCC_COLORS 以发出着色诊断消息?
stl(GCC4.9.3 in MinGW)中rbtree lower_bound/upper_bound 的实现