Simulink with block using external sfunction throws Unable to find makefile when generating code using embedded coder

I have been supplied a simulink model with a block referencing an sfunction, "ab_sf.mexw64", when I include this block in my simulink model I and try to generate code using embedded coder the process fails with the following error message:
Generating code into build folder: C:\xxxx\Matlab\CTLbuild_ert_rtw
### Build procedure for model: 'CTLbuild' aborted due to an error.
Error in 'CTLbuild/xxxx/VscIdd/ab_sfcn': Initialization commands cannot be evaluated.
Caused by:
Unable to find makefile:
C:\xxx\MATLAB\S3_VCM_Stage10b_R2015b\Main\Models\VCM\VscIdd_sfcn_rtw\ab.mk
for the generated MEX S-function 'ab_sf '.
This is required in order to show the underlying modules or to build a target from this model. If simulation capability is only needed, unselect the 'Show Module List' checkbox, otherwise try rebuilding the S-function target for model 'ab'
What am I doing wrong?

 採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 1 月 18 日
The S-function ab_sf.mexw64 was created using "mex" command from its source code (for example, source C code) together with some other files (for example the make file).
You will need to have the source code and supporting files to be able to generate code from your Simulink model if the modle uses this S-function.

2 件のコメント

Thank you for your answer, just to clarify, so if I include an sfunction mex file as a simulink block and try to generate code it will look for the make file that was used to generate the mex file in the first place so it can find the source that was used to generate it and then output the source in the generated code directory?
Yes. Otherwise, it will be really hard to figure out the source code with only the S-function binary code.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by