Expand description
FFI module for dftd4 (dynamic loading).
This module provides dynamic loading support.
§Rule and guide of dynamic loading
By enabling the dynamic_loading feature (which is the default), the crate
will attempt to load the dftd4 shared library at runtime. The loading
process will search for the library in multiple locations, by the following
order:
- User-defined candidates via environment variables
DFTD4_DYLOAD. - LD_LIBRARY_PATH style discovery via environment variables
LD_LIBRARY_PATH(Linux),DYLD_LIBRARY_PATHandDYLD_FALLBACK_LIBRARY_PATH(macOS),PATH(Windows). Note we are not distinguishing different operating systems, so all these environment variables will be checked on all platforms. - Python interpreter path discovery: For each python interpreter found, the
library is expected to be at the
libdirectory of the python installation. For example, if python is at/path/bin/python, the library is expected at/path/lib/libdftd4.so.- The python interpreter path of
DFTD4_PYTHON_PATHenvironment variable, if set. - The conda prefix path of
CONDA_PREFIXenvironment variable, if set. - The python interpreter path in
PATHenvironment variable, if exists. Will first checkpython, thenpython3.
- The python interpreter path of
- Standard system candidates, such as
lib{LIB_NAME_LINK}.soin some common library directories such as/usr/lib,/usr/local/lib, and/lib.
For API developer, if you want to check the library libdftd4.so loading
sequence, you can try the following code:
let candidates = unsafe { &dftd4::ffi::dyload_lib().__libraries_path };
println!("Library loading candidates: {candidates:#?}");Structs§
Constants§
Functions§
- dftd4_
check_ ⚠error - dftd4_
custom_ ⚠d4_ model - dftd4_
custom_ ⚠d4s_ model - dftd4_
delete_ ⚠error - dftd4_
delete_ ⚠model - dftd4_
delete_ ⚠param - dftd4_
delete_ ⚠structure - dftd4_
get_ ⚠dispersion - dftd4_
get_ ⚠error - dftd4_
get_ ⚠numerical_ hessian - dftd4_
get_ ⚠pairwise_ dispersion - dftd4_
get_ ⚠properties - dftd4_
get_ ⚠version - dftd4_
load_ ⚠rational_ damping - dftd4_
new_ ⚠d4_ model - dftd4_
new_ ⚠d4s_ model - dftd4_
new_ ⚠error - dftd4_
new_ ⚠rational_ damping - dftd4_
new_ ⚠structure - dftd4_
set_ ⚠model_ realspace_ cutoff - dftd4_
set_ ⚠model_ realspace_ cutoff_ smooth - dftd4_
update_ ⚠structure - dyload_
lib ⚠
Type Aliases§
- dftd4_
error - Error handle class
- dftd4_
model - Dispersion model class
- dftd4_
param - Damping parameter class
- dftd4_
structure - Molecular structure data class