Skip to content

Commit 228c813

Browse files
committed
Add linux support by creating symlinks
1 parent 54486f6 commit 228c813

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

sdk/python/src/detail/core_interop.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ def _initialize_native_libraries() -> 'NativeBinaryPaths':
131131
logger.info("Native libraries found — Core: %s ORT: %s GenAI: %s",
132132
paths.core, paths.ort, paths.genai)
133133

134-
# Create the onnxruntime.dll symlink on Linux/macOS if needed.
135-
# create_ort_symlinks(paths)
134+
# Create compatibility symlinks on Linux/macOS so Core can resolve
135+
# ORT/GenAI names regardless of package layout.
136+
create_ort_symlinks(paths)
136137
os.environ["ORT_LIB_PATH"] = str(paths.ort) # For ORT-GENAI to find ORT dependency
137138

138139
if sys.platform.startswith("win"):

sdk/python/src/detail/utils.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import argparse
1414
import importlib.util
15-
import json
1615
import logging
1716
import os
1817
import sys
@@ -90,9 +89,9 @@ def _find_file_in_package(package_name: str, filename: str) -> Path | None:
9089

9190
# Quick checks for well-known sub-directories first
9291
for candidate_dir in (pkg_root, pkg_root / "capi", pkg_root / "native", pkg_root / "lib", pkg_root / "bin"):
93-
candidate = candidate_dir / filename
94-
if candidate.exists():
95-
return candidate
92+
candidates = list(candidate_dir.glob(f"*{filename}*"))
93+
if candidates:
94+
return candidates[0]
9695

9796
# Recursive fallback
9897
for match in pkg_root.rglob(filename):
@@ -310,6 +309,3 @@ def foundry_local_install(args: list[str] | None = None) -> None:
310309
print(f" Core : {paths.core}")
311310
print(f" ORT : {paths.ort}")
312311
print(f" GenAI : {paths.genai}")
313-
314-
315-

0 commit comments

Comments
 (0)