CompiledComponent

CompiledComponent[name]

represents a compiled component.

Details

  • Compiled components can be used to represent a named group of compiler declarations.
  • Compiled components can be used to represent compiled functionality that can be built into a shared library.
  • Compiled components can be embedded in paclets.
  • A compiled component is created by DeclareCompiledComponent.
  • CompiledComponent objects can be used to add declarations for compilation.
  • CompiledComponent objects can be used to discover details of a compiled component.
  • CompiledComponent objects can be cleared with DeleteObject. »
  • Fields of a compiled component can be accessed with CompiledComponent[name][field].
  • CompiledComponent[name][All] returns an association of all fields in the component.
  • Compiled components contain the following fields, which can be modified with DeclareCompiledComponent:
  • "Declarations"declarations to use with the component
    "InstalledFunctions"functions to compile and symbols into which to install the results
    "LibraryFunctions"functions to compile, to be recovered by LoadCompiledComponent
    "LoadingEpilogs"functions to be executed after the component is loaded by LoadCompiledComponent
    "ExternalLibraries"libraries to be loaded before the component is loaded by LoadCompiledComponent
  • The "InstalledFunctions" and "LibraryFunctions" fields contain the source to be compiled. BuildCompiledComponent builds that source and saves the result to a dynamic library. The dynamic library can be loaded with LoadCompiledComponent to recover the results of the compilation.

Examples

open allclose all

Basic Examples  (2)

Create a compiled component "demo" containing a declaration:

View the resulting component:

Use CompiledComponent in a call to FunctionCompile:

Clear the component:

Create a compiled component:

Use CompiledComponent to add declarations to the compiler environment:

Compile a program using a function from the component:

Scope  (1)

Declare a list of declarations in a component:

Declare a library function:

Declare an installed function:

Extract all properties of the component:

Properties of a component:

The declarations of a component:

Clear the component:

Possible Issues  (1)

It is an error to refer to a component that has not been created:

Wolfram Research (2022), CompiledComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledComponent.html.

Text

Wolfram Research (2022), CompiledComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledComponent.html.

CMS

Wolfram Language. 2022. "CompiledComponent." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompiledComponent.html.

APA

Wolfram Language. (2022). CompiledComponent. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompiledComponent.html

BibTeX

@misc{reference.wolfram_2022_compiledcomponent, author="Wolfram Research", title="{CompiledComponent}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/CompiledComponent.html}", note=[Accessed: 04-February-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_compiledcomponent, organization={Wolfram Research}, title={CompiledComponent}, year={2022}, url={https://reference.wolfram.com/language/ref/CompiledComponent.html}, note=[Accessed: 04-February-2023 ]}