forked from espnet/espnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_kenlm.sh
executable file
·44 lines (37 loc) · 1 KB
/
install_kenlm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -euo pipefail
if [ $# != 0 ]; then
echo "Usage: $0"
exit 1;
fi
boost_version=1.81.0
if [ ! -d boost_${boost_version//./_} ]; then
if [ ! -e "boost_"${boost_version//./_}".tar.bz2" ]; then
wget --no-check-certificate https://boostorg.jfrog.io/artifactory/main/release/"${boost_version}"/source/boost_"${boost_version//./_}".tar.bz2
fi
tar xvf boost_"${boost_version//./_}".tar.bz2
fi
if [ ! -d boost_${boost_version//./_}_build ]; then
(
set -euo pipefail
cd boost_${boost_version//./_}
./bootstrap.sh
./b2 install --prefix=$(pwd)/../boost_${boost_version//./_}_build install
)
fi
if [ ! -d kenlm ]; then
git clone https://github.com/kpu/kenlm.git
fi
(
set -euo pipefail
cd kenlm
mkdir -p build
(
set -euo pipefail
cd build && cmake -DCMAKE_PREFIX_PATH=$(pwd)/../../boost_${boost_version//./_}_build .. && make
)
(
set -euo pipefail
python3 -m pip install -e .
)
)