Before you can build an executable program or shared library for a model, choose and set up a compiler or IDE and configure the target environment. Several methods are available for initiating the build process. Tooling is available for reloading, rebuilding, and relocating generated code.
If your system includes referenced models, reduce build time and control whether the code generator regenerates code for the top model.
To improve the speed of code execution, consider using available profiling capabilities.
Build Process Workflow for Real-Time Systems
Generate C code from a model and build an executable program.
Build Models from a Windows Command Prompt Window
Build models by running MATLAB with a batch file.
Rebuild a model after customizing generated source code or makefiles.
Reload generated code from the Model Explorer.
Build Integrated Code Within the Simulink Environment
Add support files and control model code generation and builds within the Simulink Environment.
Relocate Code to Another Development Environment
Use code generation and packaging options to relocate code and artifacts to another development environment.
Compile and Debug Generated C Code with Microsoft® Visual Studio®
Build a Visual Studio® Solution from a model.
Profile execution speed of generated code with TLC hook function interface.
Choose Build Approach and Configure Build Process
Build executable programs from generated code.
Template Makefiles and Make Options
Template makefiles that are built into the code generator.
Select C or C++ Programming Language
Choose C or C++ as the programming language for code generation.
Select and Configure C or C++ Compiler
Consider programming language compliance for generated code and select a compiler for the build process.
Identify and fix issues that prevent compiler operation in the build process.
Run-Time Environment Configuration
Select and configure target environment that best aligns with your application goals
Access the generated code files and information about the generated code with the code generation report.
Configure a model so that generated code and the build process are set for debugging.
Manage folders that the code generator creates.
Work with generated source files and dependency files that the code generator produces.
Manage Build Process File Dependencies
Work with generated source files and dependency files that the code generator produces.
Add Build Process Dependencies
Add dependency information for external code to the build process.
Build Process Support for Folder Names with Spaces or Special Characters
Troubleshoot build process errors that occur when file system issues prevent file processing.
Build executable programs with the code generator.