diff --git a/README.md b/README.md index b2a9e3c2..dfa297e4 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,13 @@ git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode pip install . ``` +## Installation for Chinese users +The download-site of third-lib openfst and boost may not be reached easily in China, I suggest that you can replace the download-site by: + + +```bash +# get the code +git clone --recursive -b linrio-patch-1 https://github.com/linrio/ctcdecode.git +cd ctcdecode +pip install . +``` diff --git a/build.py b/build.py index 6112c0f0..dc337136 100644 --- a/build.py +++ b/build.py @@ -4,24 +4,35 @@ import os import tarfile -import wget +#import wget from torch.utils.ffi import create_extension +#from urllib.request import urlretrieve +#from urllib import request def download_extract(url, dl_path): if not os.path.isfile(dl_path): - wget.download(url, - out=dl_path) + pass + #wget.download(url, out=dl_path) + #file, _ = request.urlretrieve(url, dl_path) + #print("downloaded: ", file) tar = tarfile.open(dl_path) tar.extractall('third_party/') tar.close() # Download/Extract openfst, boost -download_extract('https://sites.google.com/site/openfst/home/openfst-down/openfst-1.6.7.tar.gz', - 'third_party/openfst-1.6.7.tar.gz') -download_extract('https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.gz', - 'third_party/boost_1_63_0.tar.gz') +site_in_China = True +if not site_in_China: + download_extract('https://sites.google.com/site/openfst/home/openfst-down/openfst-1.6.7.tar.gz', + 'third_party/openfst-1.6.7.tar.gz') + download_extract('https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.gz', + 'third_party/boost_1_63_0.tar.gz') +else: + download_extract('http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.7.tar.gz', + 'third_party/openfst-1.6.7.tar.gz') + download_extract('https://dl.bintray.com/boostorg/release/1.63.0/source/boost_1_63_0.tar.gz', + 'third_party/boost_1_63_0.tar.gz') # Does gcc compile with this header and library?