Compiler optimization level
Description
Control compiler optimizations for building generated code, using flexible, generalized controls.
Note
This parameter only appears when the model is configured to use a template makefile-based code generation target, as described in Configure Toolchain or Template Makefile Build Process.
Category: Code Generation
Settings
Default:
Optimizations off (faster builds)
Optimizations off (faster builds)
Customizes compilation during the build process to minimize compilation time.
Optimizations on (faster runs)
Customizes compilation during the makefile build process to minimize run time.
Custom
Allows you to specify custom compiler optimization flags to be applied during the makefile build process.
Tips
Target-independent values
Optimizations on (faster runs)
andOptimizations off (faster builds)
allow you to easily toggle compiler optimizations on and off during code development.Custom
allows you to enter custom compiler optimization flags at Simulink® GUI level, rather than editing compiler flags into template makefiles (TMFs) or supplying compiler flags to make commands.If you specify compiler options for your makefile build using
OPT_OPTS
,MEX_OPTS
(exceptMEX_OPTS="-v"
), orMEX_OPT_FILE
, the value of Compiler optimization level is ignored and a warning is issued about the ignored parameter.
Dependencies
This parameter enables Custom compiler optimization flags.
Command-Line Information
Parameter:
RTWCompilerOptimization |
Type: character vector |
Value:
'off' | 'on' | 'custom' |
Default:
'off' |
Recommended Settings
Application | Setting |
---|---|
Debugging | Optimizations off (faster builds) |
Traceability | Optimizations off (faster builds) |
Efficiency | Optimizations on (faster runs) (execution), No
impact (ROM, RAM) |
Safety precaution | No impact |