Skip to content

Commit

Permalink
experiment with relative path for conda build.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentqb committed Dec 18, 2020
1 parent f2253f1 commit 108b5b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build_tools/setup_helpers/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ def _get_ext_transducer(debug):
else:
print("Not building GPU extensions.")

if platform.system() == 'Darwin':
root_dir = "@loader_path"
else:
root_dir = "$ORIGIN"
rel_warp_rnnt_path = os.path.join(root_dir, 'third_party', 'warp_transducer', 'build')
print("path for object:", rel_warp_rnnt_path)
# rel_warp_rnnt_path = os.path.realpath(warp_rnnt_path)
return CppExtension(
name='_warp_transducer',
sources=[os.path.realpath(base_path / 'pytorch_binding' / 'src' / 'binding.cpp')],
Expand All @@ -172,7 +179,7 @@ def _get_ext_transducer(debug):
extra_objects=extra_objects,
library_dirs=[os.path.realpath(warp_rnnt_path)],
libraries=librairies,
extra_link_args=['-Wl,-rpath,' + os.path.realpath(warp_rnnt_path)],
extra_link_args=['-Wl,-rpath,' + rel_warp_rnnt_path],
extra_compile_args=extra_compile_args
)

Expand Down

0 comments on commit 108b5b9

Please sign in to comment.