From 50f2c540330f9bdebf8e90455a9f8ef5d115902e Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Fri, 18 May 2018 14:52:44 +0800 Subject: [PATCH 1/8] Update build.py --- build.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build.py b/build.py index 6112c0f0..62177cda 100644 --- a/build.py +++ b/build.py @@ -18,10 +18,17 @@ def download_extract(url, dl_path): # 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('cn-mirror.openslr.org/resources/2/openfst-1.6.7.tar.gz', + 'third_party/openfst-1.6.7.tar.gz') + download_extract('https://zh.osdn.net/projects/sfnet_boost/downloads/boost/1.63.0/boost_1_63_0.tar.gz', + 'third_party/boost_1_63_0.tar.gz') # Does gcc compile with this header and library? From 7a2076a00d9df542fa9863ceb5ab97e083ed60ce Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Fri, 18 May 2018 15:10:13 +0800 Subject: [PATCH 2/8] Update build.py --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 62177cda..aace6661 100644 --- a/build.py +++ b/build.py @@ -25,7 +25,7 @@ def download_extract(url, dl_path): 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('cn-mirror.openslr.org/resources/2/openfst-1.6.7.tar.gz', + 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://zh.osdn.net/projects/sfnet_boost/downloads/boost/1.63.0/boost_1_63_0.tar.gz', 'third_party/boost_1_63_0.tar.gz') From 47ce56968a9ea281f6e517a3ad3704b645e61ef1 Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Sat, 19 May 2018 17:06:28 +0800 Subject: [PATCH 3/8] Update build.py --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index aace6661..9ba5eea6 100644 --- a/build.py +++ b/build.py @@ -27,7 +27,7 @@ def download_extract(url, dl_path): 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://zh.osdn.net/projects/sfnet_boost/downloads/boost/1.63.0/boost_1_63_0.tar.gz', + download_extract('https://zh.osdn.net/frs/g_redir.php?m=kent&f=boost%2Fboost%2F1.63.0%2Fboost_1_63_0.tar.gz', 'third_party/boost_1_63_0.tar.gz') From d19cfebe9226148114a32638e3fa74db7f612902 Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Sun, 20 May 2018 20:13:06 +0800 Subject: [PATCH 4/8] Update README.md Adding the download-site for Chinese Users. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 . +``` From 6ad591233f37120cf78d22dfc16e0a5ac1ae190e Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Mon, 21 May 2018 17:19:53 +0800 Subject: [PATCH 5/8] Replace the wget by urllib Utilized the `from urllib.request import urlretrieve` to download. Take the place of `import wget` module. --- build.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 9ba5eea6..aa32de80 100644 --- a/build.py +++ b/build.py @@ -4,14 +4,16 @@ import os import tarfile -import wget +#import wget from torch.utils.ffi import create_extension +from urllib.request import urlretrieve def download_extract(url, dl_path): if not os.path.isfile(dl_path): - wget.download(url, - out=dl_path) + #wget.download(url, out=dl_path) + file, _ = urlretrieve(url, dl_path) + print("downloaded: ", file) tar = tarfile.open(dl_path) tar.extractall('third_party/') tar.close() From 294fda6b0e10d4d973c2c2f372b538b2a8c66edf Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Wed, 23 May 2018 10:28:13 +0800 Subject: [PATCH 6/8] Update build.py urllib.reauest.urlretrieve --- build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index aa32de80..4e2d548d 100644 --- a/build.py +++ b/build.py @@ -7,12 +7,13 @@ #import wget from torch.utils.ffi import create_extension -from urllib.request import urlretrieve +#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) - file, _ = urlretrieve(url, dl_path) + file, _ = request.urlretrieve(url, dl_path) print("downloaded: ", file) tar = tarfile.open(dl_path) tar.extractall('third_party/') From bdc9c915a5e71305c08b319cc11a685c1f33f88b Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Wed, 23 May 2018 16:39:43 +0800 Subject: [PATCH 7/8] Update build.py --- build.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 4e2d548d..ae14a3ce 100644 --- a/build.py +++ b/build.py @@ -8,13 +8,14 @@ from torch.utils.ffi import create_extension #from urllib.request import urlretrieve -from urllib import request +#from urllib import request def download_extract(url, dl_path): if not os.path.isfile(dl_path): + pass #wget.download(url, out=dl_path) - file, _ = request.urlretrieve(url, dl_path) - print("downloaded: ", file) + #file, _ = request.urlretrieve(url, dl_path) + #print("downloaded: ", file) tar = tarfile.open(dl_path) tar.extractall('third_party/') tar.close() From b0df8fd1fcd76699c95274c5d5e01c22bb4d97dd Mon Sep 17 00:00:00 2001 From: Lingfeng Lin Date: Wed, 23 May 2018 17:23:02 +0800 Subject: [PATCH 8/8] Update build.py replace the download-site of boost_1_63_0.tar.gz --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index ae14a3ce..dc337136 100644 --- a/build.py +++ b/build.py @@ -31,7 +31,7 @@ def download_extract(url, dl_path): 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://zh.osdn.net/frs/g_redir.php?m=kent&f=boost%2Fboost%2F1.63.0%2Fboost_1_63_0.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')