is an option for Compile that specifies settings for the compilation process.


  • CompilationOptions applies to the creation of the compiled function.
  • CompilationOptions accepts lists of settings in the form CompilationOptions->{}.
  • CompilationOptions can also take the following nested settings:
  • "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 "ExpressionOptimization" 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 "InlineCompiledFunctions" are:
  • Falsedo not inline nested compiled functions
    Trueinline nested compiled functions
    Automaticinline small nested compiled functions
  • Possible values for "InlineExternalDefinitions" are:
  • Falsedo not use external definitions
    Trueinsert the body of external definitions
    Automaticuse the type of external definitions


open allclose all

Basic Examples  (1)

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:

Click for copyable input

Options  (3)

See Also

Compile  CompiledFunction  RuntimeOptions  CompilationTarget


Introduced in 2010