我必须将GCC降级到4.7版,因为在编译MatConvnet
时我遇到了这种问题Warning: You are using gcc version '5.4.0'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
所以,我做了以下步骤使GCC 4.7.0我的机器的默认编译器:
sudo apt-get install gcc-4.7
sudo rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.7 /usr/bin/gcc
但是,当我尝试再次编译MatConvnet时,我有以下错误:
Error using vl_compilenn>mex_compile (line 434)
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2016a/glnxa64.html.
Error in vl_compilenn (line 387)
parfor i = 1:numel(horzcat(lib_src, mex_src))
我错过了什么?
编辑:我意识到问题是G 编译器
当我在MATLAB中执行MEX -SETUP C 命令时,我有一个错误:
Error using mex
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2016a/glnxa64.html.
当我执行哪个g 命令时,它不会返回我。当我apt-get安装g 时,以下返回给我:
g++ is already the newest version (4:5.3.1-1ubuntu1).
我该怎么做才能使MATLAB识别我的G 编译器?
可能是迟到答案的方法,但是当我有类似的问题时,以下问题似乎是解决方案:
sudo apt-get install --reinstall gcc
sudo apt-get install --reinstall g++
希望它可以帮助每个偶然发现的人。