Generated Code Compilation
To produce executable code after source code generation, specify a build process that compiles the generated source code and links object code. You can use a CMake, toolchain, or template makefile approach for building code that you generate from Simulink® models. MATLAB® ships the CMake executable file. Each approach requires the installation of supported build tools. For information about customizing the build process for your development environment, see Code Compilation Customization.
To test numeric equivalence between your model and the generated code, you can use the SIL/PIL Manager.
Initiate Build Process
- Approaches for Building Code Generated from Simulink Models
Choose CMake, toolchain, or template makefile approach for building generated code.
- Configure CMake Build Process
Specify CMake toolchain definition for building generated code.
- Compile Code in Another Development Environment
Relocate generated code and compile in another environment.
- Configure Toolchain (ToolchainInfo) or Template Makefile Build Process
Build executable programs from generated code.
- Deploy Component Algorithm as Component Model Library by Using CMake
Deploy component algorithm as a component model library by using CMake.
- Add Build Process Dependencies
Add dependency information for external code to the build process.
- 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.
- Compile and Debug Generated C Code with Microsoft Visual Studio
Build a Visual Studio® Solution from a model.
- Control Regeneration of Top Model Code
Choose options for regenerating code for the top-level model.
- Build Integrated Code Within the Simulink Environment
Add support files and control model code generation and builds within the Simulink Environment.
- Reduce Build Time for Referenced Models by Using Parallel Builds
Apply parallel builds to reduce build time for large model reference hierarchies.
- Executable Program Generation
Build executable programs with the code generator.
- Rebuild a Model
Rebuild a model after customizing generated source code or makefiles.
Test Numeric Equivalence Between Model and Generated Code
- SIL/PIL Manager Verification Workflow
A simplified workflow for verifying generated code.
Identify and fix issues that prevent compiler operation in the build process.