feat: bridge加载前pre-load ixformer符号 + 运行时验证脚本

This commit is contained in:
claude
2026-08-11 07:43:02 +00:00
parent c31a749143
commit 25f483e46e
2 changed files with 70 additions and 0 deletions

View File

@@ -30,6 +30,19 @@ def _load_bridge():
if _bridge is not None:
return _bridge
# Pre-load ixformer .so symbols (bridge links against them at runtime)
try:
import ctypes, glob as _glob
for _base in ["/usr/local/corex/lib64/python3/dist-packages/ixformer",
"/usr/local/corex/lib/python3/dist-packages/ixformer"]:
for _so in _glob.glob(os.path.join(_base, "**/*.so"), recursive=True):
try:
ctypes.CDLL(_so, mode=ctypes.RTLD_GLOBAL)
except Exception:
pass
except Exception:
pass
search_paths = []
# 1. Same directory as this file