Using Visual Studio as C++ compiler for MEX files
74 次查看(过去 30 天)
显示 更早的评论
I'm trying to use the following tool with MATLAB 2019a on Windows 10: https://github.com/MouseLand/Kilosort2
The installation instructions say to use Visual Studio 2013 to compile mex files and I've installed the parallel computing and signal processing toolboxes along with CUDA 10.0.
I've tried using
mex -setup
and
mex -setup c++
to set VS 2013 as the compiler, but MATLAB can't seem to find it and returns the following error
% Error using mex
% No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install
% MinGW-w64 Compiler. For more options, visit https://www.mathworks.com/support/compilers.
Now I have found documentation here https://www.mathworks.com/support/requirements/previous-releases.html that indicates that VS2013 isn't a supported compiler in MATLAB 2019a - or any other recent version - but I know this tool is very popular within neuroscience and no one on the github page linked above seems to have had any problems establishing VS2013 as the compiler.
Any ideas are welcome and I appreciate the help.
Edit: I am using "Visual Studio Community 2013 with Update 5", but the authors of the github page indicate that this is permissable as they recommend VS because it is free (only the Community version is free)
0 个评论
回答(3 个)
asaf benjamin
2020-1-15
I had the exact same problem using MATLAB 2019b on Windows 10. Notice that running
mex -setup -v
shows that Matlab isn't looking for VS 2013, only 2015 and later. I downloaded and installed MSVS 2015 Community for free, used a custom instalation with all the C++ components included, and then ran
mex -setup
and set the C and C++ compiler to VS 2015. After that it worked like a charm. Hopes this help others...
2 个评论
Stefan Oline
2020-8-10
I just want to thank you for documenting this solution. I've been running in circles following the KiloSort2 installation instructions. Using 2013 and 2019 both failed but 2015 did work for me (even though MATLAB complained while executing mexGPUall.m). +1
Subhadeep Koley
2019-8-2
MinGW is one of the supported compilers in MATLAB R2019a for mex file compilation according to the documentation.
0 个评论
Torben Ott
2020-12-4
Thanks for bringing this up! Same issue for me with MATLAB R2019b trying to install kilosort2. Installing VS2015 Community instead of VS2013 recommended in the readme solved it (choose VS2015 as your compiler in MATLAB with mex -setup). When installing VS2015 select Programming Languages -> C++.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Electrophysiology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!