Skip to content

Commit aa5e6c8

Browse files
committed
Update README
1 parent 3d93a43 commit aa5e6c8

File tree

1 file changed

+47
-23
lines changed

1 file changed

+47
-23
lines changed

README.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,16 @@ to use and feel like a natural extension.
2727
Dependencies
2828
------------
2929
* pytorch (nightly version needed for development)
30-
* libsox v14.3.2 or above
30+
* libsox v14.3.2 or above (only when building from source. not required for binary installation)
3131
* [optional] vesis84/kaldi-io-for-python commit cb46cb1f44318a5d04d4941cf39084c5b021241e or above
3232

33-
Quick install on
34-
OSX (Homebrew):
35-
```bash
36-
brew install sox
37-
```
38-
Linux (Ubuntu):
39-
```bash
40-
sudo apt-get install sox libsox-dev libsox-fmt-all
41-
```
42-
Anaconda
43-
```bash
44-
conda install -c conda-forge sox
45-
```
46-
4733
Installation
4834
------------
4935

50-
### Binaries
36+
### Binary Distibutions
5137

5238
To install the latest version using anaconda, run:
39+
5340
```
5441
conda install -c pytorch torchaudio
5542
```
@@ -64,26 +51,48 @@ pip install torchaudio -f https://download.pytorch.org/whl/torch_stable.html
6451
torch from PyPI. If you need a different torch configuration, preinstall torch
6552
before running this command.)
6653

67-
At the moment, there is no automated nightly build process, but we occasionally
68-
build nightlies based on PyTorch nightlies by hand following the instructions in
69-
[packaging](packaging). To install the latest nightly via pip, run:
54+
### Nightly build
55+
56+
Note that nightly build is build on PyTorch's nightly build. Therefore, you need to install the latest PyTorch when you use nightly build of torchaudio.
57+
58+
**pip**
7059

7160
```
7261
pip install numpy
7362
pip install --pre torchaudio -f https://download.pytorch.org/whl/nightly/torch_nightly.html
7463
```
7564

76-
To install the latest nightly via conda, run:
65+
**conda**
7766

7867
```
7968
conda install -y -c pytorch-nightly torchaudio
8069
```
8170

82-
8371
### From Source
8472

8573
If your system configuration is not among the supported configurations
86-
above, you can build from source.
74+
above, you can build torchaudio from source.
75+
76+
This will require libsox v14.3.2 or above.
77+
78+
<Details><Summary>Click here for the examples on how to install SoX</Summary>
79+
80+
OSX (Homebrew):
81+
```bash
82+
brew install sox
83+
```
84+
85+
Linux (Ubuntu):
86+
```bash
87+
sudo apt-get install sox libsox-dev libsox-fmt-all
88+
```
89+
90+
Anaconda
91+
```bash
92+
conda install -c conda-forge sox
93+
```
94+
95+
</Details>
8796

8897
```bash
8998
# Linux
@@ -93,8 +102,22 @@ python setup.py install
93102
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
94103
```
95104

96-
If while building from within an anaconda environment you come across errors similar to the following:
105+
Alternatively, the build process can build SoX (and codecs such as libmad, lame and flac) statically and torchaudio can link them, by defining `BUILD_SOX` environment variable.
106+
The build process will fetch and build SoX, liblame, libmad, flac before building extension.
107+
108+
```bash
109+
# Linux
110+
BUILD_SOX= python setup.py install
97111

112+
# OSX
113+
BUILD_SOX= MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
114+
```
115+
116+
#### Troubleshooting:
117+
118+
<Details><Summary>Undefined reference to `tgetnum' when using `BUILD_SOX`</Summary>
119+
120+
If while building from within an anaconda environment you come across errors similar to the following:
98121

99122
```
100123
../bin/ld: console.c:(.text+0xc1): undefined reference to `tgetnum'
@@ -106,6 +129,7 @@ Install `ncurses` from `conda-forge` before running `python setup.py install`:
106129
# Install ncurses from conda-forge
107130
conda install -c conda-forge ncurses
108131
```
132+
</Details>
109133

110134

111135
Quick Usage

0 commit comments

Comments
 (0)