-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·103 lines (76 loc) · 2.27 KB
/
setup.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
## ===== Init submodules ===== ##
git submodule init
## ===== Update submodules ===== ##
git submodule update
## ===== Install sphinxbase ===== ##
cd sphinxbase
# autogen script will run configure with the given arguments
./autogen.sh --prefix=${PWD}/installation && make && make check && make install
if [ $? -ne 0 ]
then
echo "Could not build sphinxbase" >> ../setup.log
exit 1
else
echo "sphinxbase was successfully built and installed" >> ../setup.log
fi
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${PWD}
cd ..
## ===== Install sphinxtrain ===== ##
cd sphinxtrain
# autogen script will run configure with the given arguments
./autogen.sh --prefix=${PWD}/installation && make && make check && make install
if [ $? -ne 0 ]
then
echo "Could not build sphinxtrain" >> ../setup.log
exit 1
else
echo "sphinxtrain was successfully built and installed" >> ../setup.log
fi
cd ..
## ===== Install pocketsphinx ===== ##
cd pocketsphinx
# autogen script will run configure with the given arguments
./autogen.sh --prefix=${PWD}/installation && make && make check && make install
if [ $? -ne 0 ]
then
echo "Could not build pocketsphinx" >> ../setup.log
exit 1
else
echo "pocketsphinx was successfully built and installed" >> ../setup.log
fi
# If no first argument is supplied
if [ -z "$1" ]
then
export JAVA_HOME=/usr/lib/jvm/default-java
else
export JAVA_HOME=$1
fi
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${PWD}
cd swig/java
make && javac edu/cmu/pocketsphinx/*.java && jar -cf pocketsphinx.jar edu libpocketsphinx_jni.so
if [ $? -ne 0 ]
then
echo "Could not build pocketsphinx for java" >> ../../../setup.log
exit 1
else
echo "pocketsphinx for java was successfully built" >> ../../../setup.log
fi
cp pocketsphinx.jar ../../../libs
cd ../../../
## ===== Download and Install cmuclmtk ===== ##
wget https://sourceforge.net/projects/cmusphinx/files/cmuclmtk/0.7/cmuclmtk-0.7.tar.gz/download \
-O cmuclmtk-0.7.tar.gz
tar -xf cmuclmtk-0.7.tar.gz
rm cmuclmtk-0.7.tar.gz
mv cmuclmtk-0.7 cmuclmtk
cd cmuclmtk
./configure --prefix=${PWD}/installation && make && make check && make install
if [ $? -ne 0 ]
then
echo "Could not build cmuclmtk" >> ../setup.log
exit 1
else
echo "cmuclmtk was successfully built and installed" >> ../setup.log
fi
cd ..