Build Process
Set up compiler or IDE, configure and initiate build
process, troubleshoot compiler errors
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.
Functions
Topics
Build Process Workflows
- Approaches for Building Code Generated from Simulink Models
Choose CMake, toolchain, or template makefile approach for building generated code. - 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
Rebuild a model after customizing generated source code or makefiles. - Reload Generated Code
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 or Share Generated Code
Package and relocate generated 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.
Configure Build Process
- Configure CMake Build Process
Specify CMake toolchain definition for building generated code. - Configure Toolchain (ToolchainInfo) or Template Makefile 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. - Troubleshoot Compiler Issues
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 - Reports for Code Generation
Access the generated code files and information about the generated code with the code generation report. - Configure Model for Debugging
Configure a model so that generated code and the build process are set for debugging.
Build Process Considerations
- Manage Build Process Folders
Manage folders that the code generator creates. - Manage Build Process Files
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 File and Folder Names
Troubleshoot build process errors that occur when file system issues prevent file processing. - Executable Program Generation
Build executable programs with the code generator.