Unverified Commit 599a82b7 authored by moto's avatar moto Committed by GitHub
Browse files

Put libtorchaudio in lib directory (#1773)

Make the structure of library files somewhat similar to PyTorch core, which has the following pattern

```
torch/_C.so
torch/lib/libc10.so
torch/lib/libtorch.so
...
```

```
torchaudio/_torchaudio.so
torchaudio/lib/libtorchaudio.so
```
parent ac97ad82
......@@ -44,7 +44,7 @@ _TORCH_CUDA_ARCH_LIST = os.environ.get('TORCH_CUDA_ARCH_LIST', None)
def get_ext_modules():
return [
Extension(name='torchaudio.libtorchaudio', sources=[]),
Extension(name='torchaudio.lib.libtorchaudio', sources=[]),
Extension(name='torchaudio._torchaudio', sources=[]),
]
......
......@@ -12,7 +12,7 @@ def _init_extension():
return
suffix = 'dll' if os.name == 'nt' else 'so'
path = Path(__file__).parent / f'libtorchaudio.{suffix}'
path = Path(__file__).parent / 'lib' / f'libtorchaudio.{suffix}'
# In case `torchaudio` is deployed with `pex` format, this file does not exist.
# In this case, we expect that `libtorchaudio` is available somewhere
# in the search path of dynamic loading mechanism, and importing `_torchaudio`,
......
......@@ -92,8 +92,8 @@ endif()
install(
TARGETS libtorchaudio
LIBRARY DESTINATION .
RUNTIME DESTINATION .
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib # For Windows
)
if (APPLE)
......
# For smooth build process, this `lib` directory has to exist.
# git won't allow to have empty directory, so adding .gitignore
# https://stackoverflow.com/a/932982
*
!.gitignore
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment