MATLAB No supported compiler or SDK was found in mex_compile Linux

1k views Asked by At

I had to downgrade my GCC to version 4.7 because I had this kind of problem when compiling 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.

So, I did the following steps to make GCC 4.7.0 the default compiler of my machine:

sudo apt-get install gcc-4.7
sudo rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.7 /usr/bin/gcc

However, when I try to compile Matconvnet again I had the following error:

  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))  

What I missed in my procedure?

EDIT: I realized that the problem is with the g++ compiler

when I do the mex -setup C++ command in MATLAB I have this error:

Error using mex
No supported compiler or SDK was found. For options, visit     http://www.mathworks.com/support/compilers/R2016a/glnxa64.html.

When I do the which g++ command it returns me nothing. When I apt-get install g++ the following returns to me:

g++ is already the newest version (4:5.3.1-1ubuntu1).

What I can do to make MATLAB recognize my g++ compiler?

1

There are 1 answers

0
Gerry On

It's probably way to late for an answer, but when I had a similar problem, the following seemed to be the solution:

sudo apt-get install --reinstall gcc
sudo apt-get install --reinstall g++

Hope it helps everyone who stumbles upon this.