c++ – Error when building torchaudio from source

I tried to build torchaudio from source by forking the main branch and then running setup.py. I created a conda environment to do these. I followed the instruction at github.com/pytorch/audio/blob/main/CONTRIBUTING.md

The command for installation is:
CC=<my_path_to_gcc> BUILD_SOX=1 python setup.py develop

The building log seems fine. When I try to import torchaudio I got the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/rds/project/rds-KQ4S3rlDzm8/gs534/audio/torchaudio/__init__.py", line 1, in <module>
    from torchaudio import (  # noqa: F401
  File "/rds/project/rds-KQ4S3rlDzm8/gs534/audio/torchaudio/_extension.py", line 103, in <module>
    _init_extension()
  File "/rds/project/rds-KQ4S3rlDzm8/gs534/audio/torchaudio/_extension.py", line 91, in _init_extension
    from torchaudio import _torchaudio  # noqa
ImportError: /rds/project/rds-KQ4S3rlDzm8/gs534/audio/torchaudio/_torchaudio.so: undefined symbol: gsm_destroy

This is my environment package list:

Package           Version            Editable project location
----------------- ------------------ ----------------------------------------
certifi           2022.6.15
cmake             3.24.0
ninja             1.10.2.3
pip               22.1.2
setuptools        61.2.0
torch             1.13.0.dev20220807
torchaudio        0.13.0a0+8a6ae5c   /rds/project/rds-KQ4S3rlDzm8/gs534/audio
typing_extensions 4.3.0
wheel             0.37.1

So I don’t think there is mismatching in PyTorch versions. Can anyone help me with this problem?

Read more here: Source link