Why MATLAB Coder can't build MEX?

10 visualizaciones (últimos 30 días)
dm b
dm b el 8 de Dic. de 2017
Editada: Ryan Livingston el 2 de Mzo. de 2018
I have a problem. MATLAB Coder doesn't work properly with one of my projects. At Check For Issues state it generates error "MEX build failed". But it doesn't generate any error. Target Build Log is empty. When I try to do the same on the another PC with the same settings, there is no errors and MEX building is successfull. On the first PC MATLAB R2017a is installed, on the second PC MATLAB R2016b is installed. Why MEX building fails on the first PC and how can I define what error was occured?
  5 comentarios
dm b
dm b el 28 de Feb. de 2018
Deleting mex and any other generated files has no effect.
Ryan Livingston
Ryan Livingston el 2 de Mzo. de 2018
Editada: Ryan Livingston el 2 de Mzo. de 2018
I second Denis's advice to contact technical support as at least some sort of diagnostic should be given. Some thoughts beyond that:
  • Are you able to generate a simple MEX file without Coder by following the "Build C MEX File" steps in the MEX documentation? If that errors out try mex -v yprime.c to get verbose messages.
  • Are you able to call codegen on a trivial MATLAB function:
function y = timestwo(x)
y = 2*x;
>> codegen timestwo -args 1
>> timestwo_mex(10)
  • You can also try to get insight into any errors that may be occurring by running:
>> dbstop if all error
in MATLAB and then re-running the "check for issues" step again. That will stop in the MATLAB debugger at all errors thrown regardless of whether or not they are caught. If you keep pressing continue in the MATLAB debugger you may eventually encounter an error that gives you a hint as to what is wrong. Note that you'll likely see many innocuous errors using this technique. Every MATLAB exception that is thrown will cause MATLAB to stop in the debugger, even if that exception is caught and handled. So it may take a bit of time to pinpoint the meaningful issue, if one even exists.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by