我不得不将我的 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.
当我执行 which g++ 命令时,它什么也没给我。当我 apt-get install g++ 时,以下内容返回给我:
g++ is already the newest version (4:5.3.1-1ubuntu1).
我可以做些什么来让 MATLAB 识别我的 g++ 编译器?