Why does running Simulink in rapid acceleration mode cause a compiler error indicating that the line is too long?

36 views (last 30 days)
I have a model that I would like to run in rapid acceleration mode. However, when I attempt to run it, I get a compiler error, culminating in the following lines:
model_name.c:134 compiler limit: line too long (more than 20197 chars)
gmake: *** [model_name.obj] Error 1
I tried moving the files to a shorter directory, but that had no effect. What is causing this issue?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Aug 2021
Edited: MathWorks Support Team on 2 Sep 2021
This error may occur if the you do not have any installed/configured compilers (as may be verified by the output of the command "mex -setup"), in which case MATLAB defaults to lcc. 
The issue can be corrected by installing a supported compiler. Supported compilers are listed in the documentation at the following link:
  1 Comment
Daran Smalley
Daran Smalley on 29 Jan 2020
As MinGW is a supporeted compiler and this issue is still arrising, there must be another reason.
Is there any update, this occurs in 2018b and 2019b

Sign in to comment.

More Answers (3)

Antonio Carlo Bertolino
Antonio Carlo Bertolino on 17 Feb 2019
I have installed the supported compiler suggested in the link, indeed when i type
mex -setup
the answer is
>> mex -setup
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. You will be required
to update your code to utilize the new API.
You can find more information about this at:
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
but still I get the same error when trying to compile my model in rapid accelerator mode:
cpp: test_bench_17feb19_capi.c:855 compiler limit: line too long (more than 19709 chars)
gmake: *** [Test_bench_17feb19_capi.obj] Error 1
### Build procedure for model: 'Test_bench_17feb19' aborted due to an error.
What should I do to solve this problem?
Thank you,

Giovanni Sartori
Giovanni Sartori on 10 Nov 2020
As others have reported, I have installed a supported compiler (specifically MinGW, I'm using Windows 10 and Matlab 2020a), and the problem still arises.

hbot on 19 Jan 2021
I solved a similar issue in my case and the rapid accelerator simulation is running fine. Initially, when I just had installed the MinGW64 compiler, I still got the error.
The following steps helped then:
  1. Close MATLAB.
  2. Remove manually all generated cache data (slprj, mex, slxc, etc.)
  3. Start MATLAB and open your Simulink model.
  4. In the model make sure that MinGW64 (gmake 64-bit Windows) compiler is selected in the Toolchain item on the Model Configuration Parameters/Code Generation pane.
  5. Run rapid accelerator simulation.
It's important to note, that in the generated make file found in slprj\raccel\model_name\model_name.mk there must be MinGW64 set under the TOOLCHAIN SPECIFICATIONS section. Before I did the steps from above, it was set to LCC and correspondingly it didn't work.




Community Treasure Hunt

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

Start Hunting!