This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

CompilationOptions

CompilationOptions
is an option for Compile that specifies settings for the compilation process.
"ExpressionOptimization"Automaticwhether to optimize the input expression
"InlineCompiledFunctions"Automaticwhether to expand the body of nested compiled functions
"InlineExternalDefinitions"Automaticwhether to use external definitions
  • Possible values for are:
Falsedo not optimize the input expression
Trueoptimize the input expression
Automaticonly use the optimized expression if the compiled function does not make external calls
  • Possible values for are:
Falsedo not inline nested compiled functions
Trueinline nested compiled functions
Automaticinline small nested compiled functions
  • Possible values for are:
Falsedo not use external definitions
Trueinsert the body of external definitions
Automaticuse the type of external definitions
Options to control how the compilation runs can be given in a nested form. For example, you can turn off compilation optimizations. This may cause the same computation to be done more than once:
Options to control how the compilation runs can be given in a nested form. For example, you can turn off compilation optimizations. This may cause the same computation to be done more than once:
In[1]:=
Click for copyable input
Out[1]=
The default setting of Automatic optimizes the input expression to avoid computing the same subpart more than once:
If the compiled function needs to make an external call to Mathematica, the default setting of Automatic does not optimize:
Turning off compilation optimizations may cause the same computation to be done more than once:
Setting to True causes optimization even if the compiled function needs to make an external call to Mathematica:
The default setting of Automatic inlines nested compiled functions if they are small:
A setting of False will avoid inlining the compiled function:
The default setting of Automatic uses the type of external definitions, but makes an external call. In this case the external call fails:
A setting of True will inline the external definition, allowing the computation to proceed without errors:
A setting of False will not inline the external definition and will not use the type information. In this case there is an external call that fails.
New in 8