Why does running Simulink in rapid acceleration mode cause a compiler error indicating that the line is too long?
36 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Jun 2017
Edited: MathWorks Support Team
on 2 Sep 2021
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
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
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
More Answers (3)
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:
https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
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,
Antonio
0 Comments
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.
0 Comments
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:
- Close MATLAB.
- Remove manually all generated cache data (slprj, mex, slxc, etc.)
- Start MATLAB and open your Simulink model.
- 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.
- 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.
0 Comments
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler 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!