FFILoader

Provides a standardized way to load and compile a potential using a potential template

libs_folder: str
cpp_std: str

 

__init__(self, name, src=None, src_ext='src', load_path=None, description='A compiled potential', version='1.0.0', include_dirs=None, linked_libs=None, runtime_dirs=None, macros=None, source_files=None, build_script=None, requires_make=True, out_dir=None, cleanup_build=True, pointer_name=None, build_kwargs=None, nodebug=False, threaded=False, manage_threading_flags=True, manage_libffi_flags=True, extra_compile_args=None, extra_link_args=None, recompile=False, debug_level=False): 

LLM Docstring

Configure compilation and loading of the FFI extension, including NumPy, libffi, OpenMP, macro, and linker settings.

  • name: Any

    extension module name

  • src: Any

    source root

  • src_ext: Any

    source subdirectory name

  • load_path: Any

    locations searched for an existing extension

  • description: Any

    package description

  • version: Any

    package version

  • include_dirs: Any

    additional include directories

  • linked_libs: Any

    additional linked libraries

  • runtime_dirs: Any

    runtime library directories

  • macros: Any

    compiler macro definitions

  • source_files: Any

    extension source files

  • build_script: Any

    optional custom build script

  • requires_make: Any

    whether helper libraries require a make step

  • out_dir: Any

    output directory

  • cleanup_build: Any

    whether build products are removed

  • pointer_name: Any

    stored legacy pointer attribute

  • build_kwargs: Any

    additional CLoader arguments

  • nodebug: Any

    whether to define _NODEBUG

  • threaded: Any

    whether OpenMP support is enabled

  • manage_threading_flags: Any

    whether platform OpenMP flags are added

  • manage_libffi_flags: Any

    whether libffi paths are discovered

  • extra_compile_args: Any

    additional compiler flags

  • extra_link_args: Any

    additional linker flags

  • recompile: Any

    whether to force recompilation

  • debug_level: Any

    debug selector used by the wrapped module

  • :returns: None

    nothing; creates the configured CLoader

 

@property
lib(self): 

LLM Docstring

Load and cache the compiled extension module.

  • :returns: module

    the loaded Python extension

 

@property
caller_api_version(self): 

LLM Docstring

Detect the extension calling API from the presence of _FFIModule.

  • :returns: int

    2 for capsule-based modules, otherwise 1

 

@property
call_obj(self): 

The object that defines how to call the potential. Can either be a pure python function, an FFIModule, or a PyCapsule

  • :returns: _

Feedback

Examples

Templates

Documentation