主要内容

MEX Configuration Dialog Box Options

MEX Configuration Dialog Box Options

The following table describes parameters for fine-tuning the behavior of fiaccel for converting MATLAB® files to MEX:

ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Report
Create code generation reportGenerateReport
true, false
Document generated code in a report.
Launch report automaticallyLaunchReport
true, false

Specify whether to automatically open report after code generation completes.

Note

Requires that you enable Create code generation report

Debugging
Echo expressions without semicolonsEchoExpressions
true, false
Specify whether or not actions that do not terminate with a semicolon appear in the MATLAB Command Window.
Enable debug buildEnableDebugging
true, false
Compile the generated code in debug mode.
Language and Semantics
Constant Folding TimeoutConstantFoldingTimeout
integer, 10000
Specify the maximum number of instructions to be executed by the constant folder.
Dynamic memory allocationDynamicMemoryAllocation
'off', 'AllVariableSizeArrays'

Enable dynamic memory allocation for variable-size data. By default, dynamic memory allocation is disabled and fiaccel allocates memory statically on the stack. When you select dynamic memory allocation, fiaccel allocates memory for all variable-size data dynamically on the heap.

You must use dynamic memory allocation for all unbounded variable-size data.

Enable variable sizingEnableVariableSizing
true, false
Enable support for variable-size arrays.
Extrinsic callsExtrinsicCalls
true, false

Allow calls to extrinsic functions.

When enabled (true), the compiler generates code for the call to a MATLAB function, but does not generate the function's internal code.

When disabled (false), the compiler ignores the extrinsic function. Does not generate code for the call to the MATLAB function—as long as the extrinsic function does not affect the output of the caller function. Otherwise, the compiler issues a compiler error.

Global Data Synchronization ModeGlobalDataSyncMethod
string,SyncAlways, SyncAtEntryAndExits, NoSync

Controls when global data is synchronized with the MATLAB global workspace. By default, (SyncAlways), synchronizes global data at MEX function entry and exit and for all extrinsic calls. This synchronization ensures maximum consistency between MATLAB and generated code. If the extrinsic calls do not affect global data, use this option with the coder.extrinsic -sync:off option to turn off synchronization for these calls.

SyncAtEntryAndExits synchronizes global data at MEX function entry and exit only. If only a few extrinsic calls affect global data, use this option with the coder.extrinsic -sync:on option to turn on synchronization for these calls.

NoSync disables synchronization. Ensure that your generated code does not interact with MATLAB before disabling synchronization. Otherwise, inconsistencies might occur.

Saturate on integer overflowSaturateOnIntegerOverflow
true, false
Add checks in the generated code to detect integer overflow or underflow.
Safety (disable for faster MEX)
Ensure memory integrityIntegrityChecks
true, false
Detects violations of memory integrity while building MATLAB Function blocks and stops simulation with a diagnostic message. Setting IntegrityChecks to false also disables the run-time stack.
Ensure responsivenessResponsivenessChecks
true, false
Enables responsiveness checks in code generated from MATLAB algorithms.
Function Inlining and Stack Allocation
Inline Stack LimitInlineStackLimit
integer, 4000
Specify the stack size limit on inlined functions.
Inline ThresholdInlineThreshold
integer, 10
Specify the maximum size of functions to be inlined.
Inline Threshold MaxInlineThresholdMax
integer, 200
Specify the maximum size of functions after inlining.
Stack Usage MaxStackUsageMax
integer, 200000
Specify the maximum stack usage per application in bytes. Set a limit that is lower than the available stack size. Otherwise, a runtime stack overflow might occur. Overflows are detected and reported by the C compiler, not by fiaccel.
Optimizations
Use BLAS library if possibleEnableBLAS
true, false
Speed up low-level matrix operations during simulation by calling the Basic Linear Algebra Subprograms (BLAS) library.

See Also