Do I need to recompile MEX if I edit a function?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tommi Muller
el 23 de Jul. de 2020
Respondida: Darshan Ramakant Bhat
el 24 de Jul. de 2020
Let's say I have a MATLAB function "fun1", which calls another MATLAB function "fun2".
I then run the MATLAB Coder on fun1 and compile it into MEX code. Then later, I edit fun2. Does fun1 need to be recompiled again?
I am in this situation now and after editing fun2, it seems that fun1 is still running fast and its outputs reflects the changes made in fun2. But I want to be sure that I do or don't have to recompile fun1 again.
0 comentarios
Respuesta aceptada
Darshan Ramakant Bhat
el 24 de Jul. de 2020
When you generate code for "fun1" (which is called as "entry-point function" in code generation terminology), codes will be generated for underlying functions as well in a recursive manner.
So if you modify any function which is called from entry point function, the MEX needs to be re-compiled.
Special Case :
The above mentioned details are not true when you call a function by making it "extrinsic" function. Coder pragma coder.extrinsic is used to declare a function as extrinsic :
When you declare a function as extrinsic, the generated code will call back to MATLAB to execute the function in MATLAB. So if you modify a function which is extrinsic, it may take effect without recompiling as well. But declaring a function as extrinsic will come with a performance hit.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!