2021-05-12 14:32:11
Ubuntu 12.04下編譯安裝Kaldi
因為同事工作需要 kaldi ,所以安裝過程有點麻煩。在此記錄一下折騰的過程。
OS:Ubuntu 12.04 (amd64)
kaldi的下載地址 http://svn.code.sf.net/p/kaldi/code/ 我這裡下載的是 stable
svn co http://svn.code.sf.net/p/kaldi/code/stable kaldi-stable
“ 在編譯之前需要改個 sph2pipe_v2.5.tar.gz 的下載地址,原始碼中的地址一直連線不上,無法下載,需要改成 sourceforge 的地址,奇怪的是其他包的地址都是 sourceforge的,為什麼這個會是http://merlin.fit.vutbr.cz/kaldi/sph2pipe_v2.5.tar.gz ”
編輯 kaldi-stable/tools/Makefile 將最後面部分的sph2pipe 下載地址改成如下地址
sph2pipe_v2.5.tar.gz:
wget -T 10 -t 3 http://merlin.fit.vutbr.cz/kaldi/sph2pipe_v2.5.tar.gz
sph2pipe_v2.5.tar.gz:
wget -T 10 -t 3 http://sourceforge.net/projects/kaldi/files/sph2pipe_v2.5.tar.gz
地址修改完成後,可以進行 make 了
cd kaldi-stable/tools
make 會自動去下載相應軟體包、然後解壓等等操作,除非中間出錯,否則不用干預
出錯了。。。。。由於之前用不到 automake autoconf libtool 工具,在進行到 irstlm 這一步時出錯了。。。安裝剛才提到的三個軟體 automake autoconf libtool
patching file src/lmtable.h
patching file src/interpolate-lm.cpp
touch irstlm/.patched
cd irstlm;
(./regenerate-makefiles.sh || ./regenerate-makefiles.sh) &&
./configure --prefix `pwd`
Calling
Calling ...
./regenerate-makefiles.sh: line 52: -I: command not found
aclocal failed
Calling
Calling ...
./regenerate-makefiles.sh: line 52: -I: command not found
aclocal failed
安裝依賴
aptitude install automake autoconf libtool -y
繼續make。。。。
make clean
make -j4
cd ../src
./configure
make -j4
-------------------------------------------------------------------------
如果您需要 nnetbin 工具,那麼您得下載這個版本的了..... -_-!!
svn co http://svn.code.sf.net/p/kaldi/code/trunk
root@GPU:~/kaldi-trunk/src# ./configure
Configuring ...
Checking OpenFST library in /root/kaldi-trunk/tools/openfst ...
Checking OpenFst library was patched.
Backing up kaldi.mk to kaldi.mk.bak
Doing OS specific configurations ...
On Linux: Checking for linear algebra header files ...
Using ATLAS as the linear algebra library.
Atlas found in /usr/lib
... no libatlas.so in /usr/lib/atlas
... no libatlas.so in /usr/lib/atlas-sse2
... no libatlas.so in /usr/lib/atlas-sse3
... no libatlas.so in /usr/lib64
... no libatlas.so in /usr/lib64/atlas
... no libatlas.so in /usr/lib64/atlas-sse2
... no libatlas.so in /usr/lib64/atlas-sse3
... no libatlas.so in /usr/local/lib
... no libatlas.so in /usr/local/lib/atlas
... no libatlas.so in /usr/local/lib/atlas-sse2
... no libatlas.so in /usr/local/lib/atlas-sse3
... no libatlas.so in /usr/local/lib64
... no libatlas.so in /usr/local/lib64/atlas
... no libatlas.so in /usr/local/lib64/atlas-sse2
... no libatlas.so in /usr/local/lib64/atlas-sse3
... no libatlas.so in /root/kaldi-trunk/src/../tools/ATLAS/build/install/lib/
... no libatlas.so in /root/kaldi-trunk/tools/ATLAS/lib
Looking for ATLAS libs in /usr/lib
Using library -L/usr/lib -llapack as ATLAS's CLAPACK library.
Using CUDA toolkit /usr/local/cuda (nvcc compiler and runtime libraries)
Static=[false] Speex library not found: You can still build Kaldi without Speex.
Successfully configured for Linux [dynamic libraries] with ATLASLIBS =-L/usr/lib -llapack -lcblas -latlas -lf77blas
exp() time: 0.00276494
expf() time: 0.00307679
*** WARNING: expf() seems to be slower than exp() on your machine. This is a known bug in old versions of glibc. Please consider updating glibc. ***
*** Kaldi will be configured to use exp() instead of expf() in base/kaldi-math.h Exp() routine for single-precision floats. ***
關於那個gblic的提示,不知道是不是一定要升級glibc。
Linux升級Glibc http://www.linuxidc.com/Linux/2015-04/116472.htm
Kaldi語音識別庫在Linux下的安裝和編譯 http://www.linuxidc.com/Linux/2014-01/95843.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2015-07/120455.htm
相關文章