Using compile version of program including a C/mex function

2 次查看(过去 30 天)
Hi,
THE PROBLEM
I have a main program that run an optimization function. The cost function is calculated thanks to a C external function for speed. I have compiled the C function without any problem and created a mex functions from it. The main program using the mex function works without any problem.
I want to deploy this program on other machines which do not need Matlab installed. When I run the deployed program it crashes systematically in one function. The error message is:
(ERROR) Output argument "f" (and maybe others) not assigned during call to "MATLAB\InverseKinematics\distrib\InverseKinematics_mcr\MatlabDev\Tools\Optimization\autoGradGOM2C.m (autoGradGOM2C)".
The function autoGradGOM2C.m which crashes is a function where the mex function is evaluated to calculate the gradient.
WHAT I TRIED
I thought that maybe the mex function was not well linked so I called it from somewhere else within the main program. It gave me the results I was expecting without any problem.
The error message is strange, it tells me that the function autogradGOM2C do not return any results. I modified it so that whatever happen the results variables are set before doing anything. Still the same crash.
I am running out of ideas now.
Thanks for your help,
  1 个评论
Walter Roberson
Walter Roberson 2013-2-25
Does your code happen to be of the form (e.g.)
ode45('MexFunctionName', ...)
that is, being referenced by string content? If so then did you add a %#function pragma ?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by