MATLAB: How to rectify an anomaly in the mex setup which does not recognize the Visual Studio 2010 Professional setup

mex compiler

Hi,
Wish you a Very Happy New Year !!!
I have 64-bit windows 7 installation along with Visual Studio 2010 Prof. installed after the installation of Matlab 2012a.
I run mex -setup, it does not recognize the compiler installation.
_____________________
>> mex -setup
Welcome to mex -setup. This utility will help you set up a default compiler. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
No supported SDK or compiler was found on this computer. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html
Error using mex (line 206) Unable to complete successfully.
_________________________________________
I try to manually configure it.
_______________________________________
>> mex -setup
Welcome to mex -setup. This utility will help you set up a default compiler. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? n
Select a compiler: [1] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker) [2] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker) [3] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker) [4] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) [5] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker) [6] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker) [7] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker) [8] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker) [9] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) [10] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker) [11] Microsoft Software Development Kit (SDK) 7.1 [12] Microsoft Visual C++ 2005 SP1 [13] Microsoft Visual C++ 2008 SP1 [14] Microsoft Visual C++ 2010
[0] None
Compiler: 14
Warning: The default location for Microsoft Visual C++ 2010 compiler is: "C:\Program Files (x86)\Microsoft Visual Studio 10.0" but either that directory does not exist or the configuration is invalid.
Use C:\Program Files (x86)\Microsoft Visual Studio 10.0 anyway [y]/n? y
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
************************************************************************* Warning: MEX-files generated using Microsoft Visual C++ 2010 require that Microsoft Visual Studio 2010 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************
Trying to update options file: C:\Users\swaroop\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2012a\bin\win64\mexopts\msvc100opts.bat
Done . . .
************************************************************************ 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/techdoc/matlab_external/bsflnue-1.html Building with the -largeArrayDims option enables the new API. ************************************************************************ ___________________________________
When I try the sample program given with the distribution: _________________________ ************************************************************************* Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected. Using -compatibleArrayDims. In the future, MATLAB will require the use of -largeArrayDims and remove the -compatibleArrayDims option. For more information, see: http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html **************************************************************************
-> Default options filename found in C:\Users\swaroop\AppData\Roaming\MathWorks\MATLAB\R2012a —————————————————————- -> Options file = C:\Users\swaroop\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat MATLAB = C:\PROGRA~1\MATLAB\R2012A -> COMPILER = cl -> Compiler flags: COMPFLAGS = /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD OPTIMFLAGS = /O2 /Oy- /DNDEBUG DEBUGFLAGS = /Z7 arguments = Name switch = /Fo -> Pre-linking commands = -> LINKER = link -> Link directives: LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2012A\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\templib.x" /MAP:"yprime.mexw64.map" LINKDEBUGFLAGS = /debug /PDB:"yprime.mexw64.pdb" LINKFLAGSPOST = Name directive = /out:"yprime.mexw64" File link directive = Lib. link directive = Rsp file indicator = @ -> Resource Compiler = rc /fo "mexversion.res" -> Resource Linker = —————————————————————-
–> cl /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2012A\extern\include -IC:\PROGRA~1\MATLAB\R2012A\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
yprime.c Contents of C:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\mex_tmp.rsp: C:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\yprime.obj
–> link /out:"yprime.mexw64" /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2012A\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\SWAROOP\APPDATA\LOCAL\TEMP\MEX_7O~1\MEX_TMP.RSP
LINK : fatal error LNK1104: cannot open file 'yprime.mexw64'
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Link of 'yprime.mexw64' failed.
Error using mex (line 206) Unable to complete successfully.
________________________________________
Please help me to resolve this issue.
Thanks, Swaroop

Best Answer

Did you install the SDK 7.1 as stated in the error message:
No supported SDK or compiler was found on this computer.
What does "When I try the sample program given with the distribution" exactly mean? Which is the current directory and do you have write access there?
Related Question