Why does the Simulink Accelerator in Simulink Performance Tools 1.2 (R13) and later fail to build large models when using MS Visual C 6.0?

1 view (last 30 days)
When I try to accelerate I see the message:
Unable to acquire handle to MATLAB function '<model_name>_acc'
If I look in the accelerator build output above the previous line in the MATLAB command window I see:
fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This happens to models with large data sets when using Simulink Accelerator in Simulink Performance Tools 1.2 (R13) and later. The default options for MEX for Microsoft Visual C 6.0 are not adequate to handle them. You will need to modify the mexopts.bat file that you use for accelerating this model. There are 2 steps required to this:
1) Create the modified mexopts.bat file
1a) Copy the existing mexopts.bat file for MSVC6.0 (refer here for more information)
1b) Modify the COMPFLAGS line to add "-Zm500". The integer you need to add may be bigger or smaller than 500 depending on the size of your data set. The final line will look something like this:
set COMPFLAGS=-c -Zp8 -G5 -W3 -DMATLAB_MEX_FILE -nologo -Zm500
2) Tell the model to use it with the Accelerator
2a) Create a MAKE command that references the new definition of the MEX_OPT_FILE location variable. It will look like this:
makeCmd = ['make_rtw MEX_OPT_FILE="-f fullpath\mymexopts.bat"'];
2b) Configure your model to use the new MAKE command string by typing the following at the MATLAB command prompt:
set_param('your_model_name','AccelMakeCommand',makeCmd);
--------------
There is another approach outlined in the related solution that involves modifying the TMF file.

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!