Do I need to recompile MEX if I edit a function?

2 ビュー (過去 30 日間)
Tommi Muller
Tommi Muller 2020 年 7 月 23 日
回答済み: Darshan Ramakant Bhat 2020 年 7 月 24 日
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.

採用された回答

Darshan Ramakant Bhat
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 件)

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by