Commit eb3773e12a5acd9b3301c63acf0e3faaa6146afd

Authored by Jean-François Rey
1 parent 52d318a618
Exists in master

do not install scoring tools (still in dev)

Showing 1 changed file with 1 additions and 1 deletions Inline Diff

1 #!/bin/bash 1 #!/bin/bash
2 2
3 #-------------------# 3 #-------------------#
4 # OTMEDIA LIA # 4 # OTMEDIA LIA #
5 # Install script # 5 # Install script #
6 # version : 1.1.0 # 6 # version : 1.1.0 #
7 #-------------------# 7 #-------------------#
8 8
9 # nyx login name 9 # nyx login name
10 username=${LOGNAME} 10 username=${LOGNAME}
11 11
12 # Color variables 12 # Color variables
13 txtred=$(tput setaf 1) # red 13 txtred=$(tput setaf 1) # red
14 txtgrn=$(tput setaf 2) # Green 14 txtgrn=$(tput setaf 2) # Green
15 txtylw=$(tput setaf 3) # Yellow 15 txtylw=$(tput setaf 3) # Yellow
16 txtblu=$(tput setaf 4) # Blue 16 txtblu=$(tput setaf 4) # Blue
17 txtred=$(tput setaf 5) # Purple 17 txtred=$(tput setaf 5) # Purple
18 txtcyn=$(tput setaf 6) # Cyan 18 txtcyn=$(tput setaf 6) # Cyan
19 txtwht=$(tput setaf 7) # White 19 txtwht=$(tput setaf 7) # White
20 txtrst=$(tput sgr0) # Text reset. 20 txtrst=$(tput sgr0) # Text reset.
21 #/color 21 #/color
22 22
23 # 23 #
24 ### Global Variables 24 ### Global Variables
25 # 25 #
26 PWD=$(pwd) 26 PWD=$(pwd)
27 OTMEDIA_HOME=$PWD 27 OTMEDIA_HOME=$PWD
28 test=$(arch) 28 test=$(arch)
29 if [ "$test" == "x86_64" ]; then ARCH=".64"; else ARCH=""; fi 29 if [ "$test" == "x86_64" ]; then ARCH=".64"; else ARCH=""; fi
30 #/Global 30 #/Global
31 31
32 32
33 # 33 #
34 # Put to 0 to disable dependencies of a pass 34 # Put to 0 to disable dependencies of a pass
35 # and 1 to enable 35 # and 1 to enable
36 # 36 #
37 PASS1=1 # First Pass 37 PASS1=1 # First Pass
38 PASS2=1 # Second and Third Pass 38 PASS2=1 # Second and Third Pass
39 CONFPASS=1 # Confidence Pass 39 CONFPASS=1 # Confidence Pass
40 EXPLOITCONFPASS=1 # SOLR query and trigg 40 EXPLOITCONFPASS=1 # SOLR query and trigg
41 SCORING=1 # Compile scoring tools (crf++) 41 SCORING=0 # Compile scoring tools (crf++)
42 42
43 echo -e "\nWill do install for :" 43 echo -e "\nWill do install for :"
44 if [ $PASS1 -eq 1 ];then echo "- Pass 1";fi 44 if [ $PASS1 -eq 1 ];then echo "- Pass 1";fi
45 if [ $PASS2 -eq 1 ];then echo "- Pass 2";fi 45 if [ $PASS2 -eq 1 ];then echo "- Pass 2";fi
46 if [ $CONFPASS -eq 1 ];then echo "- Confidence Pass";fi 46 if [ $CONFPASS -eq 1 ];then echo "- Confidence Pass";fi
47 if [ $EXPLOITCONFPASS -eq 1 ];then echo "- Exploit Confidence Pass";fi 47 if [ $EXPLOITCONFPASS -eq 1 ];then echo "- Exploit Confidence Pass";fi
48 if [ $SCORING -eq 1 ];then echo "- Scoring Tools";fi 48 if [ $SCORING -eq 1 ];then echo "- Scoring Tools";fi
49 49
50 # 50 #
51 ### CHECK Dependencies ### 51 ### CHECK Dependencies ###
52 # 52 #
53 echo -e "\n\t${txtblu}Check Dependencies${txtrst}\n" 53 echo -e "\n\t${txtblu}Check Dependencies${txtrst}\n"
54 54
55 ## make 55 ## make
56 test=$(whereis make) 56 test=$(whereis make)
57 if [ "$test" == "make:" ] 57 if [ "$test" == "make:" ]
58 then 58 then
59 echo -e "${txtred}ERROR${txtrst} make not found\n You have to install make\n sudo apt-get install make" 59 echo -e "${txtred}ERROR${txtrst} make not found\n You have to install make\n sudo apt-get install make"
60 exit 1; 60 exit 1;
61 fi 61 fi
62 echo -e "make \t ${txtgrn}OK${txtrst}" 62 echo -e "make \t ${txtgrn}OK${txtrst}"
63 63
64 ## CC 64 ## CC
65 test=$(whereis cc) 65 test=$(whereis cc)
66 if [ "$test" == "cc:" ] 66 if [ "$test" == "cc:" ]
67 then 67 then
68 echo -e "${txtred}ERROR${txtrst} cc not found\n You have to install cc\n sudo apt-get install gcc" 68 echo -e "${txtred}ERROR${txtrst} cc not found\n You have to install cc\n sudo apt-get install gcc"
69 exit 1; 69 exit 1;
70 fi 70 fi
71 echo -e "cc \t ${txtgrn}OK${txtrst}" 71 echo -e "cc \t ${txtgrn}OK${txtrst}"
72 72
73 73
74 ## C++ 74 ## C++
75 if [ $SCORING -eq 1 ] 75 if [ $SCORING -eq 1 ]
76 then 76 then
77 test=$(whereis g++) 77 test=$(whereis g++)
78 if [ "$test" == "g++:" ] 78 if [ "$test" == "g++:" ]
79 then 79 then
80 echo -e "${txtred}ERROR${txtrst} g++ not found\n You have to install g++\n sudo apt-get install g++" 80 echo -e "${txtred}ERROR${txtrst} g++ not found\n You have to install g++\n sudo apt-get install g++"
81 exit 1; 81 exit 1;
82 fi 82 fi
83 echo -e "g++ \t ${txtgrn}OK${txtrst}" 83 echo -e "g++ \t ${txtgrn}OK${txtrst}"
84 fi 84 fi
85 85
86 ## AVCONV 86 ## AVCONV
87 test=$(whereis avconv) 87 test=$(whereis avconv)
88 if [ "$test" == "avconv:" ] 88 if [ "$test" == "avconv:" ]
89 then 89 then
90 echo -e "${txtred}ERROR${txtrst} avconv not found\n You have to install avconv\n sudo apt-get install libav-tools" 90 echo -e "${txtred}ERROR${txtrst} avconv not found\n You have to install avconv\n sudo apt-get install libav-tools"
91 exit 1; 91 exit 1;
92 fi 92 fi
93 echo -e "libav-tools : avconv \t ${txtgrn}OK${txtrst}" 93 echo -e "libav-tools : avconv \t ${txtgrn}OK${txtrst}"
94 94
95 ## JAVA 95 ## JAVA
96 test=$(whereis java) 96 test=$(whereis java)
97 if [ "$test" == "java:" ] 97 if [ "$test" == "java:" ]
98 then 98 then
99 echo -e "${txtred}ERROR${txtrst} java not found\n You have to install java JRE\n sudo apt-get install openjdk-7-jre" 99 echo -e "${txtred}ERROR${txtrst} java not found\n You have to install java JRE\n sudo apt-get install openjdk-7-jre"
100 exit 1; 100 exit 1;
101 fi 101 fi
102 echo -e "Java : JRE \t ${txtgrn}OK${txtrst}" 102 echo -e "Java : JRE \t ${txtgrn}OK${txtrst}"
103 test=$(whereis javac) 103 test=$(whereis javac)
104 if [ "$test" == "javac:" ] 104 if [ "$test" == "javac:" ]
105 then 105 then
106 echo -e "${txtred}ERROR${txtrst} javac not found\n You have to install java JDK\n sudo apt-get install openjdk-7-jdk" 106 echo -e "${txtred}ERROR${txtrst} javac not found\n You have to install java JDK\n sudo apt-get install openjdk-7-jdk"
107 exit 1; 107 exit 1;
108 fi 108 fi
109 echo -e "Java : JDK \t ${txtgrn}OK${txtrst}" 109 echo -e "Java : JDK \t ${txtgrn}OK${txtrst}"
110 110
111 if [ $EXPLOITCONFPASS -eq 1 ] 111 if [ $EXPLOITCONFPASS -eq 1 ]
112 then 112 then
113 ## Python 113 ## Python
114 test=$(whereis python) 114 test=$(whereis python)
115 if [ "$test" == "python:" ] 115 if [ "$test" == "python:" ]
116 then 116 then
117 echo -e "${txtred}ERROR${txtrst} python not found\n You have to install python\n sudo apt-get install python" 117 echo -e "${txtred}ERROR${txtrst} python not found\n You have to install python\n sudo apt-get install python"
118 exit 1; 118 exit 1;
119 fi 119 fi
120 echo -e "python : \t ${txtgrn}OK${txtrst}" 120 echo -e "python : \t ${txtgrn}OK${txtrst}"
121 121
122 ## csh shell 122 ## csh shell
123 test=$(whereis csh) 123 test=$(whereis csh)
124 if [ "$test" == "csh:" ] 124 if [ "$test" == "csh:" ]
125 then 125 then
126 echo -e "${txtred}ERROR${txtrst} csh shell not found\n You have to install csh shell\n sudo apt-get install csh" 126 echo -e "${txtred}ERROR${txtrst} csh shell not found\n You have to install csh shell\n sudo apt-get install csh"
127 exit 1; 127 exit 1;
128 fi 128 fi
129 echo -e "csh shell : \t ${txtgrn}OK${txtrst}" 129 echo -e "csh shell : \t ${txtgrn}OK${txtrst}"
130 fi 130 fi
131 131
132 ## Perl 132 ## Perl
133 test=$(whereis perl) 133 test=$(whereis perl)
134 if [ "$test" == "perl:" ] 134 if [ "$test" == "perl:" ]
135 then 135 then
136 echo -e "${txtred}ERROR${txtrst} perl not found\n You have to install perl\n sudo apt-get install perl" 136 echo -e "${txtred}ERROR${txtrst} perl not found\n You have to install perl\n sudo apt-get install perl"
137 exit 1; 137 exit 1;
138 fi 138 fi
139 echo -e "perl : \t ${txtgrn}OK${txtrst}" 139 echo -e "perl : \t ${txtgrn}OK${txtrst}"
140 140
141 ## iconv 141 ## iconv
142 test=$(whereis iconv) 142 test=$(whereis iconv)
143 if [ "$test" == "iconv:" ] 143 if [ "$test" == "iconv:" ]
144 then 144 then
145 echo -e "${txtred}ERROR${txtrst} iconv not found\n You have to install iconv\n sudo apt-cache search iconv" 145 echo -e "${txtred}ERROR${txtrst} iconv not found\n You have to install iconv\n sudo apt-cache search iconv"
146 exit 1; 146 exit 1;
147 fi 147 fi
148 echo -e "iconv : \t ${txtgrn}OK${txtrst}" 148 echo -e "iconv : \t ${txtgrn}OK${txtrst}"
149 149
150 ## SRI LM 150 ## SRI LM
151 if [ -z "$SRILM" ] || [ -z "$MACHINE_TYPE" ] 151 if [ -z "$SRILM" ] || [ -z "$MACHINE_TYPE" ]
152 then 152 then
153 echo -e "${txtred}ERROR${txtrst} SRILM toolkit variables are not defined (SRILM and MACHINE_TYPE)\n You have to install SRILM Toolkit\n" 153 echo -e "${txtred}ERROR${txtrst} SRILM toolkit variables are not defined (SRILM and MACHINE_TYPE)\n You have to install SRILM Toolkit\n"
154 exit 1; 154 exit 1;
155 fi 155 fi
156 export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE 156 export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE
157 echo -e "SRILM toolkit : \t ${txtgrn}OK${txtrst}" 157 echo -e "SRILM toolkit : \t ${txtgrn}OK${txtrst}"
158 158
159 ### Speeral Configuration ### 159 ### Speeral Configuration ###
160 160
161 echo -e "\n\t${txtblu}Speeral configuration${txtrst}\n" 161 echo -e "\n\t${txtblu}Speeral configuration${txtrst}\n"
162 read -e -p "Download Speeral bin and data ? (y/n) " speeral 162 read -e -p "Download Speeral bin and data ? (y/n) " speeral
163 if [ "$speeral" == "y" ] 163 if [ "$speeral" == "y" ]
164 then 164 then
165 echo -e "Download Speeral bin and data :" 165 echo -e "Download Speeral bin and data :"
166 scp -r ${username}@nyx:/local/OTMEDIA/OTMEDIA_DATA/Speeral $OTMEDIA_HOME/tools/ 166 scp -r ${username}@nyx:/local/OTMEDIA/OTMEDIA_DATA/Speeral $OTMEDIA_HOME/tools/
167 fi 167 fi
168 echo -e "\n\t${txtblu}Generating Speeral configuration files :${txtrst}\n" 168 echo -e "\n\t${txtblu}Generating Speeral configuration files :${txtrst}\n"
169 cat $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \ 169 cat $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \
170 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \ 170 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \
171 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \ 171 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \
172 > $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml 172 > $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml
173 echo $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml 173 echo $PWD/tools/Speeral/CFG/SpeeralFirstPass.xml
174 cat $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \ 174 cat $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \
175 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \ 175 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \
176 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \ 176 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \
177 > $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml 177 > $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml
178 echo $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml 178 echo $PWD/tools/Speeral/CFG/SpeeralSecondPass.xml
179 cat $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \ 179 cat $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml.tmp | sed -e "s|<nom>[^<]*</nom>|<nom>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer</nom>|g" \
180 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \ 180 | sed -e "s|<ngramme>[^<]*</ngramme>|<ngramme>$PWD/tools/Speeral/LM/ML_4gOTMEDIA_LEXIQUE_V6</ngramme>|g" \
181 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \ 181 | sed -e "s|<binode>[^<]*</binode>|<binode>$PWD/tools/Speeral/LEX/LEXIQUE_V6.speer.bin</binode>|g" \
182 > $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml 182 > $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml
183 echo $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml 183 echo $PWD/tools/Speeral/CFG/SpeeralThirdPass.xml
184 184
185 185
186 if [ $EXPLOITCONFPASS -eq 1 ] 186 if [ $EXPLOITCONFPASS -eq 1 ]
187 then 187 then
188 ### LIA ltbox ### 188 ### LIA ltbox ###
189 echo -e "\t${txtblu}Install lia_ltbox${txtrst}\n" 189 echo -e "\t${txtblu}Install lia_ltbox${txtrst}\n"
190 export LIA_TAGG_LANG="french" 190 export LIA_TAGG_LANG="french"
191 export LIA_TAGG="$OTMEDIA_HOME/tools/lia_ltbox/lia_tagg/" 191 export LIA_TAGG="$OTMEDIA_HOME/tools/lia_ltbox/lia_tagg/"
192 export LIA_PHON_REP="$OTMEDIA_HOME/tools/lia_ltbox/lia_phon/" 192 export LIA_PHON_REP="$OTMEDIA_HOME/tools/lia_ltbox/lia_phon/"
193 export LIA_BIGLEX="$OTMEDIA_HOME/tools/lia_ltbox/lia_biglex/" 193 export LIA_BIGLEX="$OTMEDIA_HOME/tools/lia_ltbox/lia_biglex/"
194 194
195 ### config lia_phon 195 ### config lia_phon
196 cd $LIA_PHON_REP 196 cd $LIA_PHON_REP
197 make clean > /dev/null 197 make clean > /dev/null
198 make clean_ressource > /deV/null 198 make clean_ressource > /deV/null
199 make all > /dev/null 199 make all > /dev/null
200 make ressource > /dev/null 200 make ressource > /dev/null
201 ### config lia_tagg 201 ### config lia_tagg
202 cd $LIA_TAGG 202 cd $LIA_TAGG
203 make clean > /dev/null 203 make clean > /dev/null
204 make clean_ressource > /dev/null 204 make clean_ressource > /dev/null
205 make all > /dev/null 205 make all > /dev/null
206 make ressource.french > /dev/null 206 make ressource.french > /dev/null
207 ### config lia_biglex 207 ### config lia_biglex
208 cd $LIA_BIGLEX 208 cd $LIA_BIGLEX
209 make -f makefile.biglex clean > /dev/null 209 make -f makefile.biglex clean > /dev/null
210 make -f makefile.biglex > /dev/null 210 make -f makefile.biglex > /dev/null
211 cd $OTMEDIA_HOME 211 cd $OTMEDIA_HOME
212 212
213 if [ $SCORING -eq 1 ] 213 if [ $SCORING -eq 1 ]
214 then 214 then
215 echo -e "\t${txtblu}Install CRF++${txtrst}\n" 215 echo -e "\t${txtblu}Install CRF++${txtrst}\n"
216 tar -xvzf "$OTMEDIA_HOME/tools/CRF++-0.58.tar.gz" -C "$OTMEDIA_HOME/tools/" 216 tar -xvzf "$OTMEDIA_HOME/tools/CRF++-0.58.tar.gz" -C "$OTMEDIA_HOME/tools/"
217 cd $OTMEDIA_HOME/tools/CRF++-0.58 217 cd $OTMEDIA_HOME/tools/CRF++-0.58
218 ./configure --prefix="$OTMEDIA_HOME/tools/install" 218 ./configure --prefix="$OTMEDIA_HOME/tools/install"
219 make 219 make
220 make install 220 make install
221 echo -e "\t${txtblu}Install lia_ne${txtrst}\n" 221 echo -e "\t${txtblu}Install lia_ne${txtrst}\n"
222 export PATH=$PATH:$OTMEDIA_HOME/tools/install/bin 222 export PATH=$PATH:$OTMEDIA_HOME/tools/install/bin
223 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib 223 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib
224 export LIA_NE=$OTMEDIA_HOME/tools/lia_ltbox/lia_ne_v2.2 224 export LIA_NE=$OTMEDIA_HOME/tools/lia_ltbox/lia_ne_v2.2
225 cd $LIA_NE 225 cd $LIA_NE
226 mkdir $LIA_NE/bin 2> /dev/null 226 mkdir $LIA_NE/bin 2> /dev/null
227 make clean > /dev/null 227 make clean > /dev/null
228 make all > /dev/null 228 make all > /dev/null
229 cd $OTMEDIA_HOME 229 cd $OTMEDIA_HOME
230 fi 230 fi
231 231
232 ### SOLR DB ### 232 ### SOLR DB ###
233 # Tomcat fisrtly 233 # Tomcat fisrtly
234 test=$(dpkg -l | grep "^ii" | grep tomcat) 234 test=$(dpkg -l | grep "^ii" | grep tomcat)
235 if [ "$test" == "" ] 235 if [ "$test" == "" ]
236 then 236 then
237 echo -e "${txtred}ERROR${txtrst} TOMCAT seems to not be installed)\n You have to install TOMCAT\n" 237 echo -e "${txtred}ERROR${txtrst} TOMCAT seems to not be installed)\n You have to install TOMCAT\n"
238 #exit 1; 238 #exit 1;
239 echo -e "\nTOMCAT : \t ${txtred}NOT OK${txtrst}\n" 239 echo -e "\nTOMCAT : \t ${txtred}NOT OK${txtrst}\n"
240 else 240 else
241 echo -e "\nTOMCAT : \t ${txtgrn}OK${txtrst}\n" 241 echo -e "\nTOMCAT : \t ${txtgrn}OK${txtrst}\n"
242 fi 242 fi
243 # SOLR secondly 243 # SOLR secondly
244 echo -e "\t${txtblu}Install SOLR DB${txtrst}\n" 244 echo -e "\t${txtblu}Install SOLR DB${txtrst}\n"
245 echo -e "You will need 300 Go of free space to install SOLR DB" 245 echo -e "You will need 300 Go of free space to install SOLR DB"
246 read -p "Continue ? (y/n) " solr 246 read -p "Continue ? (y/n) " solr
247 if [ "$solr" == "y" ] 247 if [ "$solr" == "y" ]
248 then 248 then
249 249
250 echo -e "Download SOLR DB\r" 250 echo -e "Download SOLR DB\r"
251 mkdir -p $OTMEDIA_HOME/tools/SOLR 2> /dev/null 251 mkdir -p $OTMEDIA_HOME/tools/SOLR 2> /dev/null
252 scp -r ${username}@nyx:/local/OTMEDIA/OTMEDIA_DATA/SOLR/otmedia-2013-04.tar.gz $OTMEDIA_HOME/tools/SOLR 252 scp -r ${username}@nyx:/local/OTMEDIA/OTMEDIA_DATA/SOLR/otmedia-2013-04.tar.gz $OTMEDIA_HOME/tools/SOLR
253 echo -e "Unzip SOLR DB\r" 253 echo -e "Unzip SOLR DB\r"
254 tar -xvzf "$OTMEDIA_HOME/tools/SOLR/otmedia-2013-04.tar.gz" -C "$OTMEDIA_HOME/tools/SOLR/" 254 tar -xvzf "$OTMEDIA_HOME/tools/SOLR/otmedia-2013-04.tar.gz" -C "$OTMEDIA_HOME/tools/SOLR/"
255 else 255 else
256 echo "Skipping SOLR install" 256 echo "Skipping SOLR install"
257 fi 257 fi
258 read -e -p "Configure SOLR DB server ? (y/n) " solr 258 read -e -p "Configure SOLR DB server ? (y/n) " solr
259 if [ "$solr" == "y" ] 259 if [ "$solr" == "y" ]
260 then 260 then
261 read -p "Enter SOLR server IP :" ip 261 read -p "Enter SOLR server IP :" ip
262 if [ "${ip}" == "" ];then ip="localhost";fi 262 if [ "${ip}" == "" ];then ip="localhost";fi
263 echo "machine = \"${ip}\"" > $OTMEDIA_HOME/tools/scripts/solrinfo.py 263 echo "machine = \"${ip}\"" > $OTMEDIA_HOME/tools/scripts/solrinfo.py
264 read -p "Enter SOLR server port :" port 264 read -p "Enter SOLR server port :" port
265 if [ "${port}" == "" ]; then port="8080";fi 265 if [ "${port}" == "" ]; then port="8080";fi
266 echo -e "\n\tSOLR server IP ${ip}" 266 echo -e "\n\tSOLR server IP ${ip}"
267 echo -e "\tSOLR server port ${port}" 267 echo -e "\tSOLR server port ${port}"
268 echo "port = \"${port}\"" >> $OTMEDIA_HOME/tools/scripts/solrinfo.py 268 echo "port = \"${port}\"" >> $OTMEDIA_HOME/tools/scripts/solrinfo.py
269 else 269 else
270 echo "Skipping SOLR DB Configuration" 270 echo "Skipping SOLR DB Configuration"
271 fi 271 fi
272 echo -e "\nSee SOLR.INSTALL file for more information\n" 272 echo -e "\nSee SOLR.INSTALL file for more information\n"
273 fi 273 fi
274 274
275 ### Set Variables in bashrc ### 275 ### Set Variables in bashrc ###
276 cat ~/.bashrc | grep -v "OTMEDIA_HOME" | grep -v "SRILM_BIN" | grep -v "main_tools" | grep -v "/tools/install/" > ~/.bashrc.org 276 cat ~/.bashrc | grep -v "OTMEDIA_HOME" | grep -v "SRILM_BIN" | grep -v "main_tools" | grep -v "/tools/install/" > ~/.bashrc.org
277 #cat ~/.bashrc | grep -v "OTMEDIA_HOME" | grep -v "SRILM_BIN" | grep -v "LIA_TAGG" | grep -v "LIA_PHON" | grep -v "LIA_BIGLEX" > ~/.bashrc.org 277 #cat ~/.bashrc | grep -v "OTMEDIA_HOME" | grep -v "SRILM_BIN" | grep -v "LIA_TAGG" | grep -v "LIA_PHON" | grep -v "LIA_BIGLEX" > ~/.bashrc.org
278 cp ~/.bashrc.org ~/.bashrc 278 cp ~/.bashrc.org ~/.bashrc
279 export OTMEDIA_HOME=$PWD 279 export OTMEDIA_HOME=$PWD
280 echo "export OTMEDIA_HOME=$PWD" >> ~/.bashrc 280 echo "export OTMEDIA_HOME=$PWD" >> ~/.bashrc
281 echo "export PATH=\$PATH:$PWD/main_tools" >> ~/.bashrc 281 echo "export PATH=\$PATH:$PWD/main_tools" >> ~/.bashrc
282 echo "export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE" >> ~/.bashrc 282 echo "export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE" >> ~/.bashrc
283 #echo "export LIA_TAGG_LANG=french" >> ~/.bashrc 283 #echo "export LIA_TAGG_LANG=french" >> ~/.bashrc
284 #echo "export LIA_TAGG=$OTMEDIA_HOME/tools/lia_ltbox/lia_tagg/" >> ~/.bashrc 284 #echo "export LIA_TAGG=$OTMEDIA_HOME/tools/lia_ltbox/lia_tagg/" >> ~/.bashrc
285 #echo "export LIA_PHON_REP=$OTMEDIA_HOME/tools/lia_ltbox/lia_phon/" >> ~/.bashrc 285 #echo "export LIA_PHON_REP=$OTMEDIA_HOME/tools/lia_ltbox/lia_phon/" >> ~/.bashrc
286 #echo "export LIA_BIGLEX=$OTMEDIA_HOME/tools/lia_ltbox/lia_biglex/" >> ~/.bashrc 286 #echo "export LIA_BIGLEX=$OTMEDIA_HOME/tools/lia_ltbox/lia_biglex/" >> ~/.bashrc
287 #echo "export LIA_NE=$OTMEDIA_HOME/tools/lia_ltbox/lia_ne_v2.2" >> ~/.bashrc 287 #echo "export LIA_NE=$OTMEDIA_HOME/tools/lia_ltbox/lia_ne_v2.2" >> ~/.bashrc
288 if [ $SCORING -eq 1 ] 288 if [ $SCORING -eq 1 ]
289 then 289 then
290 echo "export PATH=\$PATH:$OTMEDIA_HOME/tools/install/bin" >> ~/.bashrc 290 echo "export PATH=\$PATH:$OTMEDIA_HOME/tools/install/bin" >> ~/.bashrc
291 echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib" >> ~/.bashrc 291 echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib" >> ~/.bashrc
292 fi 292 fi
293 293
294 # set global configuration file 294 # set global configuration file
295 echo "OTMEDIA_HOME=\"$PWD\"" > $OTMEDIA_HOME/cfg/main_cfg.cfg 295 echo "OTMEDIA_HOME=\"$PWD\"" > $OTMEDIA_HOME/cfg/main_cfg.cfg
296 echo "ARCH=\"$ARCH\"" >> $OTMEDIA_HOME/cfg/main_cfg.cfg 296 echo "ARCH=\"$ARCH\"" >> $OTMEDIA_HOME/cfg/main_cfg.cfg
297 echo "VERBOSE=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg 297 echo "VERBOSE=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg
298 echo "DEBUG=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg 298 echo "DEBUG=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg
299 echo "CHECK=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg 299 echo "CHECK=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg
300 echo "RERUN=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg 300 echo "RERUN=0" >> $OTMEDIA_HOME/cfg/main_cfg.cfg
301 301
302 echo -e "\n\t${txtgrn}### Install completed ###${txtrst}\n" 302 echo -e "\n\t${txtgrn}### Install completed ###${txtrst}\n"
303 echo -e "do : source ~/.bashrc" 303 echo -e "do : source ~/.bashrc"
304 echo -e "or set variable :\n" 304 echo -e "or set variable :\n"
305 echo "export OTMEDIA_HOME=$PWD" 305 echo "export OTMEDIA_HOME=$PWD"
306 echo "export PATH=\$PATH:$OTMEDIA_HOME/main_tools" 306 echo "export PATH=\$PATH:$OTMEDIA_HOME/main_tools"
307 echo "export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE" 307 echo "export SRILM_BIN=$SRILM/bin/$MACHINE_TYPE"
308 if [ $SCORING -eq 1 ] 308 if [ $SCORING -eq 1 ]
309 then 309 then
310 echo "export PATH=\$PATH:$OTMEDIA_HOME/tools/install/bin" 310 echo "export PATH=\$PATH:$OTMEDIA_HOME/tools/install/bin"
311 echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib" 311 echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$OTMEDIA_HOME/tools/install/lib"
312 fi 312 fi
313 313
314 314
315 315
316 echo "${txtwht} \\\\ " 316 echo "${txtwht} \\\\ "
317 echo " ,-~~~-\\\\_" 317 echo " ,-~~~-\\\\_"
318 echo " ( .\ " 318 echo " ( .\ "
319 echo " @\___(__--'${txtrst}" 319 echo " @\___(__--'${txtrst}"
320 320
321 echo "${txtgrn}Yes${txtylw}I${txtred}Rastafari${txtrst}" 321 echo "${txtgrn}Yes${txtylw}I${txtred}Rastafari${txtrst}"
322 322