Compiler is invoked even though "Generate Code Only" is specified.
Show older comments
I have created a simple Simulink model and I'm attempting to generate C code. I'm using ert.tlc for the system target. I've specified "Generate Code Only" in the model's Configuration Parameters -> Real-Time Workshop options.
I get compiler errors when I build the model. The lcc compiler is called, even though I specified "Generate Code Only". I see the lcc compiler errors in the MATLAB command window.
How to I generate code without invoking the compiler.
Thanks, Tim
I have R2009b.
Answers (4)
Kaustubha Govind
on 22 Jun 2011
0 votes
My guess is that you have Stateflow, Embedded MATLAB or Model Reference (Accelerator mode) blocks in your model that need to generate and build code to update the model and propagate signal types, dimensions, etc. Is there a reason you want to avoid this?
Tim
on 22 Jun 2011
0 votes
2 Comments
Kaustubha Govind
on 22 Jun 2011
Yes, that should be feasible. However, for the purpose of simulation, it is necessary that LCC be called to generate a MEX-file corresponding to the Embedded MATLAB block - this is only needed for Simulink engine propagation and will not have any direct effect on the generated code.
Victor Noel
on 13 Mar 2020
I am having the same problem: I want Simulink to generate code which I will link using my external build system for an embedded Arm processor.
However I am getting Microsoft Visual Studio link errors, and these are preventing the <model>.c code from being generated.
Can you explain more why the host build has to occur?
The function I am trying to call in my external source file in turn calls many other functions, many of which have hardware dependancies. That will work fine when I do my build, but Simulink wants to find all of these other functions, which are sprayed all over my build system.
Can I just get Embedded Coder to generate the 'C' code without needing to build the Simulink code?
Tim
on 22 Jun 2011
0 votes
Walter Roberson
on 22 Jun 2011
0 votes
I speculate that for whatever reason, it is trying to open the directory as a file. For example if somehow the directory was named as a {specific} Source File.
I have not worked with that tool, but putting together some things other people have said, it would not surprise me if the Source Files area had to explicitly name each source file. There is not usually equivalent of a "source file include path" in the IDE I have used: usually you either have to give the tools either paths relative to your current directory or else absolute paths.
Categories
Find more on Deployment, Integration, and Supported Hardware 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!