下载文件
1.升级下载源 sudo apt-get update
2. 安装Git sudo apt-get install git
3. 下载安装包 git clone https://github.com/kaldi-asr/kaldi.git 4. 检查依赖库
cd kaldi/toolsextras/check_dependencies.sh`
root@debian10:/home/ZQ_projects/kaldi/tools#
extras/check_dependencies.sh extras/check_dependencies.sh: wget is not
installed. extras/check_dependencies.sh: sox is not installed.
extras/check_dependencies.sh: subversion is not installed
extras/check_dependencies.sh: OpenBLAS not detected. Run
extras/install_openblas.sh … to compile it for your platform, or
configure with --openblas-root= if you … have it installed in a
location we could not guess. Note that packaged … library may be
significantly slower and/or older than the one the above … would
build. … You can also use other matrix algebra libraries. For
information, see: … http://kaldi-asr.org/doc/matrixwrap.html
extras/check_dependencies.sh: Some prerequisites are missing; install
them using the command: sudo apt-get install wget sox subversion
- 安装缺少的库文件
sudo apt-get install wget sox subversion
- 安装OpenBLAS
sudo apt-get install libopenblas-dev
git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make -j8
sudo make PREFIX=/usr/local/OpenBLAS install
添加环境变量
vim /etc/profile 末尾加上
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/OpenBLAS/lib/
然后 source /etc/profile
extras/check_dependencies.sh
: all OK.- 然后
make -j4
会报错,安装openblas extras/install_openblas.sh
cd openfst-1.7.2
然后在安装openfst,执行make 操作时出现 如下问题
Makefile:372: recipe for target 'aclocal.m4' failed
解决办法:在linux终端下执行 :autoreconf -vfi
./configure
make
sudo make install
cd ..
- 然后
make -j4
cd ..
cd src/
进入src目录依次执行如下命令
./configure
make depend
make
编译时间较长,最好指定cpu个数编译
以上安装方法不能在RK-3399开发板上编译,G++报错g++: internal compiler error: Killed (program cc1plus)
查了很多资料,最后发现主要原因是内存不足,g++编译时需要大量内存
所以在rk3399开发板上安装vosk
可以参考官网的说明资料:
https://alphacephei.com/vosk/install