kaldi从下载到配置环境再到编译记录

下载文件

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

  1. 安装缺少的库文件 sudo apt-get install wget sox subversion
  2. 安装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

  1. extras/check_dependencies.sh: all OK.
  2. 然后 make -j4会报错,安装openblas
  3. extras/install_openblas.sh
  4. cd openfst-1.7.2然后在安装openfst,执行make 操作时出现 如下问题
Makefile:372: recipe for target 'aclocal.m4' failed
解决办法:在linux终端下执行 :autoreconf -vfi
  1. ./configure
  2. make
  3. sudo make install
  4. cd ..
  5. 然后 make -j4
  6. cd ..
  7. 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

版权声明:本文为weixin_48386234原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。