gives a string of textual LLVM code obtained by compiling the function specification fspec.
uses the auxiliary definitions defs for compilation.
gives a string of textual code in the specified format.
Details and Options
- 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.
- Possible values for "format" include:
"LLVM" LLVM intermediate code "Assembler" assembler for a specific architecture
- The following options can be given:
CompilerEnvironment Automatic an environment of definitions for compilation CompilerOptions Automatic detailed options for the compilation pipeline TargetSystem Automatic $SystemID for the target architecture
- With the setting TargetSystem->Automatic, FunctionCompileExportString will generate code for the machine architecture on which it is being run, including, for example, taking account of word length.
- In FunctionCompileExportString[func,…], func can be a CompiledCodeFunction object.
Examplesopen allclose all
Basic Examples (3)
Several functions can be compiled with FunctionCompileExportString:
Auxiliary definitions can be given with FunctionDeclaration:
The default setting of Automatic generates code for the machine architecture on which it is being run:
TargetSystem can be combined with different format settings:
TargetSystem can be set for architectures for which the Wolfram Engine does not exist:
Wolfram Research (2019), FunctionCompileExportString, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionCompileExportString.html (updated 2021).
Wolfram Language. 2019. "FunctionCompileExportString." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/FunctionCompileExportString.html.
Wolfram Language. (2019). FunctionCompileExportString. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionCompileExportString.html