Do I need to recompile MEX if I edit a function?
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Darshan Ramakant Bhat
2020-7-24
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!