No supported compiler or SDK was found. although VS 2015 Pro and VS 2017 Comm. installed

4 次查看(过去 30 天)
Hi I am using Matlab 2017a on Windows 10. I have both Visual studio 2015 Professional and Visual studio 2017 Community installed. I also have:
msvc2015.xml, msvcpp2015.xml and msvc2017.xml, msvcpp2017.xml
in the mexopts folder in the Matlab installation path. When I run the mex setup, I can see that one of the two versions is configured for use with mex:
MEX configured to use 'Microsoft Visual C++ 2017 (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. 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:
Microsoft Visual C++ 2015 (C) mex -setup:'C:\Program Files\MATLAB\R2017a\bin\win64\mexopts\msvc2015.xml' C
Microsoft Visual C++ 2017 (C) mex -setup:C:\Use ........
However, when I compile cpp files, some files are compiled successfully such as:
mex yprime.c
Building with 'Microsoft Visual C++ 2017 (C)'.
MEX completed successfully
Whereas, some other files cannot be compiled such as:
mex edge_correct.cpp
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.
When I try to compile MatConvNet (Deep Learning Library):
vl_compilenn('enableGpu',true)
Failed to run C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/bin (The system cannot find the file specified.
).
Error using vl_compilenn>nvcc_compile (line 616)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc" -c -o
"D:\Documents\MATLAB\Libraries\matconvnet-1.0-beta25\matlab\mex\.build\bits\data.obj"
"D:\Documents\MATLAB\Libraries\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU -DENABLE_DOUBLE -O
-DNDEBUG -D_FORCE_INLINES --std=c++11 -I"C:\Program Files\MATLAB\R2017a_FinalRelease\extern\include"
-I"C:\Program Files\MATLAB\R2017a\toolbox\distcomp\gpu\extern\include"
-gencode=arch=compute_61,code=\"sm_61,compute_61\" --compiler-options=/MD --compiler-bindir="C:\Program Files
(x86)\Microsoft Visual Studio\2017\Community\VC\bin" failed.
And again by changing parameters:
vl_compilenn('enableGpu',false)
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, visit http://www.mathworks.com/support/compilers/R2017a/.
Error in vl_compilenn>mex_compile (line 584)
mex(args{:}) ;
Error in vl_compilenn (line 493)
mex_compile(opts, srcs{i}, objfile, flags) ;
I have tried uninstalling all the Visual Studio versions, restarting the PC, then only installing one of the two VS version. This error still appears.
There does not seem to be any error in the code as it was previously compiled with VS 2013. Any idea what is going wrong?
Best Regards
Wajahat

采纳的回答

Wajahat Kazmi
Wajahat Kazmi 2017-9-5
Hi again Apparently, the problem got solved when I deleted the file:
C:\Users\mypc\AppData\Roaming\MathWorks\MATLAB\R2017a\mex_C++_win64.xml
Restarting Matlab recreated this file.
Now I am able to compile with VS2015 but now Matlab does not seem to detect VS2017.
  1 个评论
Joss Knight
Joss Knight 2017-9-6
I don't believe VS2017 is supported in MATLAB R2017a. Certainly the NVIDIA compiler nvcc does not support it, so you won't be able to compile MatConvNet for your GPU with it.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by