Skip to content

Commit

Permalink
#441: Enable standalone ttrt build
Browse files Browse the repository at this point in the history
  • Loading branch information
tapspatel committed Aug 19, 2024
1 parent 8021450 commit 7e35d08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/tools/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
import shutil
import subprocess

TTMLIR_VERSION_MAJOR = os.getenv("TTMLIR_VERSION_MAJOR", "0")
TTMLIR_VERSION_MINOR = os.getenv("TTMLIR_VERSION_MINOR", "0")
Expand Down Expand Up @@ -62,6 +63,13 @@
f"{metallibdir}/{dylib}",
f"{src_dir}/build/runtime/tools/python/ttrt/runtime",
)
command = ["patchelf", "--set-rpath", "$ORIGIN", f"{src_dir}/build/runtime/tools/python/ttrt/runtime/{dylib}"]

try:
result = subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
except subprocess.CalledProcessError as e:
print(f"Command failed with return code {e.returncode}")

ext_modules.append(
Pybind11Extension(
"ttrt.runtime._C",
Expand Down

0 comments on commit 7e35d08

Please sign in to comment.