matlabwinapimex

matlab compiler installation problems


I'm trying to run a compiler on MATLAB but things don't go as expected. How can I properly install MATLAB and how can I check what exactly is going wrong. I have the MATLAB r2013a version.

I've done as follow:

  1. I've downloaded the SDK 7.1 file from here

    • destination folder for Tools: C:\Program Files\Microsoft SDKs\Windows\v7.1
    • destination folder for Samples: C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples
  2. I've added my compiler directories to the path environment

    • Control Panel -> System -> "Advanced" -> "Environment variables".
    • new system variable with the name "MSSdk".
    • value of this variable: C:\Program Files\Microsoft SDKs\Windows\v7.1
    • close and restart MATLAB

Next I tried to configure MATLAB using following steps and using the mex -setup command:

here is where it stops:

Error: The Microsoft Windows Software Development Kit (SDK) installation is 
         incomplete.  Please be sure that the .NET Framework is installed 
         correctly before attempting to reinstall the SDK. 

EDIT:

My second attempt I did as follow:

The following happened:

i selected n:

mex: No compiler selected. No action taken. 

************************************************************************** 
  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: 
           httpx://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html  
           Building with the -largeArrayDims option enables the new API. 
************************************************************************** 


Error using mex (line 206)
Unable to complete successfully.

i selected y:

*************************************************************************** 
  Warning: MEX-files generated using Microsoft Windows Software Development 
           Kit (SDK) 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\Gebruiker\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat 
From template:              C:\PROGRA~1\MATLAB\R2013a\bin\win64\mexopts\mssdk71opts.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: 
           httpx://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html  
           Building with the -largeArrayDims option enables the new API. 
************************************************************************** 


Error using mex (line 206)
Unable to complete successfully.

EDIT:

I've found that the problem I'm facing seems to be isolated to a problem with Perl. For a brief moment the following note appears:

"Perl Command Line Interpreter has stopped working"

This post had a similar problem. I did as follow. I downloaded Strawberry Perl and did several replacements.

However this doesn't seems to work. So it seems to be two things:

EDIT: As recommended I restored the perl in matlab to it's original version.


I've downloaded Visual Studio Express 2012 and trying to make this work. Problems are still the same.


Solution

  • So, the first thing I checked was the matlab supported compilers page:
    http://www.mathworks.com/support/compilers/R2013a/index.html

    I was thinking that SDK 7.1 would not be supported, but clearly it is, and is even at the top of the list. However, one of your errors was complaining about .NET, and on that MATLAB page, there is a caveat about SDK 7.1 needing .NET Framework 4.0 (in table, at the bottom of the SDK 7.1 cell.)

    Whenever I've done this in windows, I've always just used the Visual Studio compiler. I would suggest trying that first, since I don't remember this mex-setup process taking very long (before success/failure).