Kompilieren von generiertem Code
Um nach der Quellcodegenerierung ausführbaren Code zu erzeugen, legen Sie einen Buildprozess fest, der den generierten Quellcode kompiliert und Objektcode verknüpft. Zur Erstellung von Code, den Sie aus Simulink®-Modellen generieren, können Sie einen Ansatz mit CMake, Toolchain oder einer Template-Makefile nutzen. MATLAB® liefert eine ausführbare CMake-Datei. Jeder Ansatz erfordert die Installation unterstützter Build-Tools. Informationen zur Anpassung des Build-Prozesses für Ihre Entwicklungsumgebung finden Sie unter Code Compilation Customization.
Sie können den SIL/PIL Manager verwenden, um die numerische Äquivalenz Ihres Modells und des generierten Codes zu testen.
Funktionen
Themen
Überblick
- Approaches for Building Code Generated from Simulink Models
Choose CMake toolchain, makefile-based toolchain, or template makefile approach for building generated code.
Workflows
- 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. - Add Build Process Dependencies
Add dependency information for external code to the build process. - Build Integrated Code Within the Simulink Environment
Add support files and control model code generation and builds within the Simulink Environment. - Build Process Workflow for Real-Time Systems
Generate C code from a model and build an executable program. - Rebuild a Model
Rebuild a model after customizing generated source code or makefiles. - Reduce Build Time for Referenced Models by Using Parallel Builds
Apply parallel builds to reduce build time for large model reference hierarchies. - Compile Code in Another Development Environment
Relocate generated code and compile in another environment. - Build Generated Code Remotely
Create a connection and build generated code on a remote computer. - Build Models from Windows Command Prompt
Build models by running MATLAB with a batch file. - Deploy Component Algorithm as Component Model Library by Using CMake
Deploy component algorithm as a component model library by using CMake.
Testen der numerischen Äquivalenz des Modells und des generierten Codes
- SIL/PIL Manager Verification Workflow
A simplified workflow for verifying generated code.
Fehlersuche
Identify and fix issues that prevent compiler operation in the build process.