How do I make compiled mex files take precedence over m files when using Matlab Compiler?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Normally when executing Matlab code, compiled mex files take precedence over m files. So if you have an .m and a compiled mex file, the compiled mex file will be called. Therefore, when using mex files a useful pattern which helps end users is to include an .m file for each mex file, where the .m file displays a message to the user altering them that the mex file has not been compiled. This is useful because otherwise it is hard for the end user to understand the cause of the error.
However, it seems that Matlab Compiler (mcc) has the opposite precedence; i.e. when compiling a function using mcc - m, if a mex file is invoked in the function, but a corresponding .m file exists, then the compiled mex file will be ignored and the .m file will be called instead. So with the above pattern, no compiled mex files will be included and all calls to mex files will fail. In other words, the Matlab Compiler has a different precedence behaviour to the Matlab interpreter.
Is there any way to force the Matlab Compiler mcc to include the compiled mex files in preference to .m files, to match the precedence behaviour of the interpreter? (Other than manually deleting all the corresponding .m files?)
0 Kommentare
Antworten (3)
Sean de Wolski
am 11 Okt. 2016
Are you adding the MEX files to the CTF with the -a option in mcc (or as "Other files" in the app)?
Hazem
am 30 Aug. 2018
I use the app (from the Apps tab):
Application Compiler
There, you can manually add the mex-files in the box:
Files required for your application to run
if they are not already there. For me, they were automatically detected with Matlab compiler version 9.01
0 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!