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:Anyextension module name
src:Anysource root
src_ext:Anysource subdirectory name
load_path:Anylocations searched for an existing extension
description:Anypackage description
version:Anypackage version
include_dirs:Anyadditional include directories
linked_libs:Anyadditional linked libraries
runtime_dirs:Anyruntime library directories
macros:Anycompiler macro definitions
source_files:Anyextension source files
build_script:Anyoptional custom build script
requires_make:Anywhether helper libraries require a make step
out_dir:Anyoutput directory
cleanup_build:Anywhether build products are removed
pointer_name:Anystored legacy pointer attribute
build_kwargs:Anyadditional
CLoaderargumentsnodebug:Anywhether to define
_NODEBUGthreaded:Anywhether OpenMP support is enabled
manage_threading_flags:Anywhether platform OpenMP flags are added
manage_libffi_flags:Anywhether libffi paths are discovered
extra_compile_args:Anyadditional compiler flags
extra_link_args:Anyadditional linker flags
recompile:Anywhether to force recompilation
debug_level:Anydebug selector used by the wrapped module
:returns:Nonenothing; creates the configured
CLoader
@property
lib(self):
LLM Docstring
Load and cache the compiled extension module.
:returns:modulethe loaded Python extension
@property
caller_api_version(self):
LLM Docstring
Detect the extension calling API from the presence of _FFIModule.
:returns:int2for capsule-based modules, otherwise1
@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:_