How can I find and configure a Visual C++ 2013 compiler

4 ビュー (過去 30 日間)
Genki Minamisawa
Genki Minamisawa 2017 年 5 月 24 日
編集済み: Walter Roberson 2017 年 5 月 25 日
Hello,
I'm using MATLAB R2017a with 64 bit Windows 7 SP1. I recently installed CUDA 8.0 and Visual Studio Community 2013. But MATLAB does not find those compilers. When I run "mex -setup -v" (or "mexcuda -setup -v"), MATLAB returns the following message (only the relevant part for C++ 2013):
... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\').
... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2013 Professional (C)'.
Any suggestions? I tried Visual Studio 2013 professional extension (trial) as well, but the same thing happend.

採用された回答

Genki Minamisawa
Genki Minamisawa 2017 年 5 月 25 日
The followings worked:
  1. Install MATLAB R2016b (instead of MATLAB R2017a)
  2. Install Visual Studio 2013 Community
  3. Install CUDA 7.5 (custom install, select cuda toolkit and visual studio integration).
  4. Run 'mex -setup c++' in Matlab command window.
I don't know why R2017a didn't find Visual Studio 2013. An issue caused by a combination of Windows 7 and R2017a? Anyway, Visual Studio 2013 Community was recognized by MATLAB as Visual C++ 2013 Professional edition!

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 24 日
R2017a supports the Professional and Community edition of Microsoft Visual C++ 2017, but for 2015, 2013, and 2012, it supports only the Professional versions.
But for Windows 7, you can use SDK 7.1
  2 件のコメント
Genki Minamisawa
Genki Minamisawa 2017 年 5 月 24 日
Thanks Roberson, My goal is to compile .cu files with NVCC compiler (CUDA 8.0) and Visual C++ compilier (2013). Is SDK 7.1 helpful for that purpose...?
Walter Roberson
Walter Roberson 2017 年 5 月 25 日
編集済み: Walter Roberson 2017 年 5 月 25 日
nvcc does not support Visual C++ 2013 Community
http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/ . It needs VS2015 Professional, or VS2015 Community, or VS2013 Professional, or VS2012 Professional, or VS 2010 Professional.
Your overlap with R2017a (needed for CUDA 8 support) is then VS2015 Professional, or VS2013 Professional, or VS2012 Professional.

サインインしてコメントする。

カテゴリ

Help Center および File Exchangeコード生成、GPU、サードパーティ サポート についてさらに検索

Community Treasure Hunt

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

Start Hunting!