({{, (RefLink[FunctionCompileExportByteArray, paclet:ref/FunctionCompileExportByteArray])[func] 
gives a byte array of binary LLVM code obtained by compiling the function func.}, {, (RefLink[FunctionCompileExportByteArray, paclet:ref/FunctionCompileExportByteArray])[func,"format"]
gives a byte array of binary code in the specified format.}})

OpenersNotesSection(Spacer1)Details and Options

Possible values for "format" include:

The following options can be given:

With the setting (RefLink[TargetSystem, paclet:ref/TargetSystem])->(RefLink[Automatic, paclet:ref/Automatic]), (RefLink[FunctionCompileExportByteArray, paclet:ref/FunctionCompileExportByteArray]) will generate code for the machine architecture on which it is being run, including, for example, taking account of word length.

In (RefLink[FunctionCompileExportByteArray, paclet:ref/FunctionCompileExportByteArray])[func,…], func can be a (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) object.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Generate a compiled version of a function and return the result as a byte array:

FunctionCompileExportByteArray[Function[Typed[arg,"MachineInteger"],arg+1]]

OpenersExampleSection1(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)TargetSystem  (1)

The default setting of (RefLink[Automatic, paclet:ref/Automatic]) generates code for the machine architecture on which it is being run:

FunctionCompileExportByteArray[Function[Typed[arg,"MachineInteger"],arg+1]]

(RefLink[TargetSystem, paclet:ref/TargetSystem]) can be set to the (RefLink[$SystemID, paclet:ref/$SystemID]) of the desired platform:

FunctionCompileExportByteArray[Function[Typed[arg,"MachineInteger"],arg+1],TargetSystem->"Linux-ARM"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FunctionCompile, paclet:ref/FunctionCompile])  ▪  (RefLink[FunctionCompileExport, paclet:ref/FunctionCompileExport])  ▪  (RefLink[FunctionCompileExportString, paclet:ref/FunctionCompileExportString])  ▪  (RefLink[FunctionCompileExportLibrary, paclet:ref/FunctionCompileExportLibrary])  ▪  (RefLink[TargetSystem, paclet:ref/TargetSystem])  ▪  (RefLink[ExportByteArray, paclet:ref/ExportByteArray])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Code Compilation, paclet:guide/CodeCompilation])}})}})