FunctionCompileExport
✖
FunctionCompileExport
exports a compiled version of functions fspec in the format specified by the file extension ext.
exports a compiled version of fspec using local auxiliary definitions defs.
exports a compiled version using local auxiliary definitions.
Details and Options

- By default, FunctionCompileExport exports object or assembler code suitable for the machine architecture on which it is being run.
- Functions can be given as a Function pure function, a list of pure functions or an association of pure functions.
- Auxiliary definitions can be given with FunctionDeclaration or by giving a CompilerEnvironment option.
- The following file extensions and export formats are supported:
-
".asm", ".s" "Assembler" textual assembler code ".o", ".obj" "Binary" binary machine code ".ll" "LLVM" LLVM textual intermediate code ".bc" "LLVMBinary" LLVM binary code - The following options can be given:
-
CompilerEnvironment Automatic an environment of definitions for compilation CompilerOptions Automatic detailed options for the compilation pipeline ProgressReporting Automatic how to report progress during the compilation TargetSystem Automatic $SystemID for the target architecture - FunctionCompileExport returns the name of the file that it created.
- In FunctionCompileExport[path,func,…], func can be a CompiledCodeFunction object.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Export a compiled version of a function into a file:

https://wolfram.com/xid/0mk7v9cbuks6-ywyh2j

The export format can be determined from the file name:

https://wolfram.com/xid/0mk7v9cbuks6-jyht1m
The export format can be given explicitly:

https://wolfram.com/xid/0mk7v9cbuks6-umtsu2

https://wolfram.com/xid/0mk7v9cbuks6-crmbiq
Several functions can be compiled with FunctionCompileExport:

https://wolfram.com/xid/0mk7v9cbuks6-xps8uh
It can be useful to use an association to hold the functions:

https://wolfram.com/xid/0mk7v9cbuks6-3lkyv9
Auxiliary definitions can be given with FunctionDeclaration:

https://wolfram.com/xid/0mk7v9cbuks6-19znon
Options (3)Common values & functionality for each option
CompilerEnvironment (1)
ProgressReporting (1)
Progress during a compilation is reported:

https://wolfram.com/xid/0mk7v9cbuks6-6cy6wj

https://wolfram.com/xid/0mk7v9cbuks6-nmjw2s
This can be suppressed by setting the option ProgressReporting to False.
The default value of ProgressReporting is Automatic, which means that the global setting $ProgressReporting is used. If this is set to False, then no progress reporting takes place.
TargetSystem (1)
The default setting of Automatic generates code for the machine architecture on which it is being run:

https://wolfram.com/xid/0mk7v9cbuks6-gy1c0o
TargetSystem can be set to the $SystemID of the desired platform:

https://wolfram.com/xid/0mk7v9cbuks6-rxsu02
TargetSystem can be set for architectures for which the Wolfram Engine does not exist:

https://wolfram.com/xid/0mk7v9cbuks6-ewo1vu
Wolfram Research (2019), FunctionCompileExport, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExport.html (updated 2021).
Text
Wolfram Research (2019), FunctionCompileExport, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExport.html (updated 2021).
Wolfram Research (2019), FunctionCompileExport, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExport.html (updated 2021).
CMS
Wolfram Language. 2019. "FunctionCompileExport." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/FunctionCompileExport.html.
Wolfram Language. 2019. "FunctionCompileExport." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/FunctionCompileExport.html.
APA
Wolfram Language. (2019). FunctionCompileExport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionCompileExport.html
Wolfram Language. (2019). FunctionCompileExport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionCompileExport.html
BibTeX
@misc{reference.wolfram_2025_functioncompileexport, author="Wolfram Research", title="{FunctionCompileExport}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FunctionCompileExport.html}", note=[Accessed: 18-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_functioncompileexport, organization={Wolfram Research}, title={FunctionCompileExport}, year={2021}, url={https://reference.wolfram.com/language/ref/FunctionCompileExport.html}, note=[Accessed: 18-April-2025
]}