- 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)?
24 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Shivani
il 4 Mar 2024
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 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!