Skip to content

Commit 74da408

Browse files
committed
Try disable TORCHAUDIO_EXT_MODULE
1 parent 0462b79 commit 74da408

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/libtorchaudio/cuctc/src/python_binding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ STABLE_TORCH_LIBRARY(torchaudio_prefixctc, m) {
130130
}
131131

132132
// Defines PyInit_torchaudio_prefixctc when building under Windows:
133-
TORCHAUDIO_EXT_MODULE(torchaudio_prefixctc)
133+
// TORCHAUDIO_EXT_MODULE(torchaudio_prefixctc)

tools/setup_helpers/extension.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@ def _get_build(var, default=False):
4141

4242
class BuildExtensionBugFix(BuildExtension):
4343
def get_ext_filename(self, ext_name):
44-
# Origin: torch/utils/cpp_extension.py
45-
# Fixes a bug: don't try to remove ABI part that does not
46-
# exist in a file name.
44+
# A workaround to https://github.com/pytorch/pytorch/issues/170542
4745
from setuptools.command.build_ext import build_ext
4846

4947
# Get the original shared library name. For Python 3, this name will be
5048
# suffixed with "<SOABI>.so", where <SOABI> will be something like
5149
# cpython-37m-x86_64-linux-gnu.
5250
ext_filename = build_ext.get_ext_filename(self, ext_name)
53-
print(f"ZZZZZZZZZZZZZZZZZZZZ 1: {ext_name} {ext_filename=}")
5451
# If `no_python_abi_suffix` is `True`, we omit the Python 3 ABI
5552
# component. This makes building shared libraries with setuptools that
5653
# aren't Python modules nicer.
@@ -62,12 +59,19 @@ def get_ext_filename(self, ext_name):
6259
# Omit the second to last element.
6360
without_abi = ext_filename_parts[:-2] + ext_filename_parts[-1:]
6461
ext_filename = ".".join(without_abi)
65-
print(f"ZZZZZZZZZZZZZZZZZZZZ 2: {ext_filename=}")
6662
return ext_filename
6763

64+
def get_export_symbols(self, ext):
65+
print(f"ZZZZZZZZZZZZZZZ {ext.name=} {ext.export_symbols=}")
66+
return ext.export_symbols
67+
6868

6969
def get_build_ext():
70-
return BuildExtensionBugFix.with_options(no_python_abi_suffix=False, use_ninja=True)
70+
return BuildExtensionBugFix.with_options(
71+
# See https://github.com/pytorch/pytorch/issues/170542
72+
no_python_abi_suffix=False,
73+
use_ninja=True,
74+
)
7175

7276

7377
def get_ext_modules():

0 commit comments

Comments
 (0)