Skip to content

Commit

Permalink
#0: Fix TT-NN wheel update issue by making sure rpath is updated when… (
Browse files Browse the repository at this point in the history
#12336)

#0: Fix TT-NN wheel update issue by making sure rpath is updated when needed
  • Loading branch information
ayerofieiev-tt authored Sep 6, 2024
1 parent 0ca24c6 commit dc76271
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions ttnn/ttnn/library_tweaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ def _has_not_found(target_so):

def _setup_so_rpath(site_pkgs_ttnn, so_name, new_rpath):
directory = site_pkgs_ttnn
check_f = directory / f".rpath_checked_{so_name}"
if os.path.exists(check_f):
return

target_so = None
for f in os.listdir(directory):
Expand All @@ -35,25 +32,21 @@ def _setup_so_rpath(site_pkgs_ttnn, so_name, new_rpath):

if _has_not_found(target_so):
subprocess.check_call(f"patchelf --set-rpath {new_rpath} {target_so}", shell=True)
subprocess.check_call(f"touch {check_f}", shell=True)


def _setup_so_rpath_in_build_lib(site_pkgs_ttnn):
directory = site_pkgs_ttnn / "build/lib"
check_f = directory / ".rpath_checked"
if not os.path.exists(directory):
logger.trace(f"Directory {directory} does not exists")
return
if os.path.exists(check_f):
return

import subprocess

metal_so = directory / "libtt_metal.so"

new_rpath = directory
if _has_not_found(metal_so):
subprocess.check_call(f"patchelf --set-rpath {new_rpath} {metal_so}", shell=True)
subprocess.check_call(f"touch {check_f}", shell=True)


def _setup_env(site_pkgs_ttnn):
Expand Down

0 comments on commit dc76271

Please sign in to comment.