"No supported compiler found" error on Windows 10 (Matlab 2015 b) after installing MinGW

2 Ansichten (letzte 30 Tage)
Hi All,
I have to compile my CUDA mex file and use it in my Matlab function on Windows 10 with Matlab 2015b. I had VS 2015 Pro before, but mexcuda required MinGW. So I installed MinGW64 as per instructions here http://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html. My mex -setup output shows MinGW64 is the default C/C++ compiler,
>> mex -setup C++
MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different C++ compiler, select one from the following:
MinGW64 Compiler (C++) mex -setup:C:\Users\QUIPLAB01\AppData\Roaming\MathWorks\MATLAB\R2015b\mex_C++_win64.xml C++
Microsoft Visual C++ 2015 Professional mex -setup:'C:\Program Files\MATLAB\R2015b\bin\win64\mexopts\msvcpp2015.xml' C++
however when I try to compile my CUDA file, both mex and mexcuda return following error:
>> mex my_cu1.cu
Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, see http://www.mathworks.com/support/compilers/R2015b/win64.html.
>> mexcuda my_cu1.cu
Warning: The selected C++ compiler is not supported for CUDA compilation. Searching for a supported compiler.
> In mexcuda (line 89)
Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, see http://www.mathworks.com/support/compilers/R2015b/win64.html.
Error in mexcuda (line 157)
[varargout{1:nargout}] = mex(mexArguments{:});
I had CUDA v7.5 before, so I uninstalled it and installed v7.0 from here https://developer.nvidia.com/cuda-toolkit-70.
I am able to run the examples in the 'gpuArray' documentation.
Any help to compile my CUDA mex file would be really appreciated.
-- Thanks, Ram.
PS: BTW, I am able to compile and run my_cu1.cu mex file on a CentOS 6.7 with Matlab 2014b and CUDA 7.5 on it.

Akzeptierte Antwort

Ramaprasad Kulkarni
Ramaprasad Kulkarni am 23 Mär. 2016
I tried lot of steps and finally it worked. Don't know which option actually resolved the issue.
-> Reinstalled MinGW64 -> Installed Matlab R2014b to try to compile on it. -> So installed MS Visual Studio 2013 Pro. -> Then installed Win 7 SDK, and Visual C++ 2010 express.
Although I tried following the steps to compile on R2014b, I was getting error that it was not able to find nvcc.
As a last resort, I tried compiling my CUDA mex file on R2015b using mexcuda and it successfully compiled. Currently, MinGW64 is the default compiler on R2015b for both C and C++.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by