FunctionCompileExportLibrary
✖
FunctionCompileExportLibrary
exports a compiled version of function specification fspec as a shared library suitable for external use.
uses the auxiliary definitions defs for compilation.
Details and Options

- FunctionCompileExportLibrary generates a library suitable for use on the type of computer on which it is 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 library types are generated on different types of systems:
-
Macintosh .dylib Windows .dll Linux .so - The following option can be given:
-
CompilerEnvironment Automatic an environment of definitions for compilation ProgressReporting Automatic how to report progress during the compilation - By default, FunctionCompileExportLibrary creates a library in the current directory given by Directory[].
- FunctionCompileExportLibrary has the option CompilerOptions, which allows detailed options to be passed to different parts of the compilation pipeline.
- The library generated by FunctionCompileExportLibrary is suitable for linking into external programs. It can also be loaded into the Wolfram System using LibraryFunctionLoad.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
Export a compiled version of a function into a library:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-ck3oom

Load the library and create a CompiledCodeFunction:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-zycyv8

Execute the function in the CompiledCodeFunction:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-ktnk74

The file can be an absolute path:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-uyet0v

Several functions can be compiled with FunctionCompileExportLibrary:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-xps8uh
Loading the library creates a list of compiled code functions:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-geqr94

Execute the code that was loaded:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-zm6d3

Several functions can be compiled with FunctionCompileExportLibrary:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-yjoav5
Loading the library creates a list of compiled code functions:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-wmdzir

Execute the code that was loaded:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-44heqt

Auxiliary definitions can be given with FunctionDeclaration:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-19znon
Load and execute code in the library:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-iz6lyx

Options (2)Common values & functionality for each option
CompilerEnvironment (1)
Create a compiler environment and add a function definition:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-frh
Use a compiler environment in a compilation:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-x1j2b1
Loading the library creates a CompiledCodeFunction:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-tuec9q

Execute the code that was loaded:

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-edi2nu

ProgressReporting (1)
Progress during a compilation is reported:

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

https://wolfram.com/xid/0bmt58lu1c0fs3888uo-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.
Wolfram Research (2019), FunctionCompileExportLibrary, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html (updated 2021).
Text
Wolfram Research (2019), FunctionCompileExportLibrary, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html (updated 2021).
Wolfram Research (2019), FunctionCompileExportLibrary, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html (updated 2021).
CMS
Wolfram Language. 2019. "FunctionCompileExportLibrary." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html.
Wolfram Language. 2019. "FunctionCompileExportLibrary." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html.
APA
Wolfram Language. (2019). FunctionCompileExportLibrary. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html
Wolfram Language. (2019). FunctionCompileExportLibrary. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html
BibTeX
@misc{reference.wolfram_2025_functioncompileexportlibrary, author="Wolfram Research", title="{FunctionCompileExportLibrary}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html}", note=[Accessed: 29-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_functioncompileexportlibrary, organization={Wolfram Research}, title={FunctionCompileExportLibrary}, year={2021}, url={https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html}, note=[Accessed: 29-May-2025
]}