- Configure the model to operate in "Normal" mode rather than "Accelerated" mode.
- Avoid setting the "UseParallel" flag to true within the optimizer's settings.
Why do I receive an error "Problem creating Accelerator MEX file for model 'X'." when I try to run accelerator mode for a model containing s-function (Simulink 2019b)?
18 次查看(过去 30 天)
显示 更早的评论
I have a model which includes some S-function blocks that requires certain libraries. This libraries are included in the "Code Generation > Custom Code" section and also in Simulation Target section.
When I try to run a simulation in Accelerator mode I obtain the following error:
-### Build procedure for model: 'SimApplSw' aborted due to an error.
Problem creating Accelerator MEX file for model 'SimApplSw'.
Caused by:
C:\Users\roccag\Desktop\AggregationModel_3_0\slprj\accel\SimApplSw\mathlib.c not found; check that you are in the correct current folder, and check the spelling of 'C:\Users\roccag\Desktop\AggregationModel_3_0\slprj\accel\SimApplSw\mathlib.c'.
Normal simulation runs correctly.
Thanks,
Giuseppe
0 个评论
回答(1 个)
Shivani
2024-3-4
I understand that you’re currently facing an error while running a simulation in accelerator mode
The error you're experiencing is due to an attempt to optimize an accelerated Simulink model while the "UseParallel" flag is enabled in the optimization function. Since the model needs to be compiled for acceleration, any changes to the model will require the compiled code to be deleted and recompiled before the next simulation. When operating in parallel, multiple workers may try to delete and compile the same files at the same time, which can lead to the "Invalid argument" error you're seeing.
The following workarounds can get around this issue:
Additionally, you can refer to this MATLAB Answer thread for more details: Problem creating Accelerator MEX file for simulink model in windows 10 - MATLAB Answers - MATLAB Central (mathworks.com)
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block and Blockset Authoring 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!