Fixed MATLAB 2016a msvc2013 mexopt files

The original files are full of bugs; with the submitted ones mex starts at least

Al momento, stai seguendo questo contributo

I'm a C++ guy and new to Matlab (though I'm very familiar with R and similar tools). Some of my friends wanted to do analysis of NMR spectra using Matlab, so I downloaded the demo and tried to create a mex which can access my NMR spectrum library (https://github.com/rochus-keller/NAF). Surprisingly the mex command didn't find any of the installed compilers. The solutions available to this problem from matlabcentral didn't work because they seem to have changed the mexopt concept with release 2016. So I had to do an analysis myself and was surprised to find out, that the xml config files in the mexopt directory were full of bugs. These mex tries to identify the available compilers using the wrong assumptions in these files. For example: the MSVC 2013 compiler lives in VCROOT\Bin\x86_amd64, not in VCROOT\Bin\amd64; the IDE is called VSWinExpress.exe, not devenv.exe; also MSVC 2013 no longer supports /MT, so I changed to /MD. After these changes mex found at least this compiler but still wasn't able to successfully build. The Matlab terminal only says "Error using mex"; not very helpful. At least it lists the command sent to the compiler when using -v. Here is the result when I directly run it in the terminal:
...MATLAB>cl /c /Zp8 /GR /W3 /EHs /nologo /MD /O2 /Oy- /DNDEBUG /DMX_COMPAT_32 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2016a\extern\include" -I"C:\Program Files\MATLAB\R2016a\simulink\include" C:\Users\me\Documents\MATLAB\yprime.c /FoC:\Users\me\AppData\Local\Temp\mex_81214722198338_2060\yprime.obj
yprime.c
C:\Users\me\Documents\MATLAB\yprime.c : fatal error C1083: Cannot open compiler generated file: 'C:\Users\me\AppData\Local\Temp\mex_81214722198338_2060\yprime.obj': No such file or directory

I will continue my research. Maybe someone has a hint on how to circumvent also this obstacle.

Best
R.K.

Cita come

Rochus Keller (2026). Fixed MATLAB 2016a msvc2013 mexopt files (https://it.mathworks.com/matlabcentral/fileexchange/57434-fixed-matlab-2016a-msvc2013-mexopt-files), MATLAB Central File Exchange. Recuperato .

Categorie

Scopri di più su Large Files and Big Data in Help Center e MATLAB Answers

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con qualsiasi release

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0.0.0