Skip to content

Commit

Permalink
Do not delete rpath from torch.dylib on Darwin (#47337)
Browse files Browse the repository at this point in the history
Summary:
Fixes CI regressions introduced by #47262

Pull Request resolved: #47337

Reviewed By: ngimel

Differential Revision: D24721954

Pulled By: malfet

fbshipit-source-id: 395b037b29c0fc3b62ca50bba9be940ad72e0c5b
  • Loading branch information
malfet authored and facebook-github-bot committed Nov 4, 2020
1 parent 53a5f08 commit 3a00245
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ def _embed_libiomp(self):
return
lib_dir = os.path.join(self.build_lib, 'torch', 'lib')
libtorch_cpu_path = os.path.join(lib_dir, 'libtorch_cpu.dylib')
libtorch_path = os.path.join(lib_dir, 'libtorch.dylib')
libtorch_python_path = os.path.join(lib_dir, 'libtorch_python.dylib')
# Parse libtorch_cpu load commands
otool_cmds = subprocess.check_output(['otool', '-l', libtorch_cpu_path]).decode('utf-8').split('\n')
rpaths, libs = [], []
Expand Down Expand Up @@ -397,11 +395,6 @@ def _embed_libiomp(self):
self.copy_file(source_lib, target_lib)
break

# Delete rpath from those libs
for rpath in rpaths:
for lib in [libtorch_cpu_path, libtorch_path, libtorch_python_path]:
subprocess.check_call(['install_name_tool', '-delete_rpath', rpath, lib])

def run(self):
# Report build options. This is run after the build completes so # `CMakeCache.txt` exists and we can get an
# accurate report on what is used and what is not.
Expand Down

0 comments on commit 3a00245

Please sign in to comment.