Kaldi安装与编译报错

Environment

Rule number 1 - use Linux. Although it is possible to use Kaldi on Windows, most people I find trustworthy convinced me that Linux will do the job with the less amount of problems. I have chosen Ubuntu 14.10. This was (in 2014/15) a rich and stable Linux representation which I honestly recommend. When you finally have your Linux running properly, please open a terminal and install some necessary stuff (if you do not already have it):

(has to be installed)

  • atlas – automation and optimization of calculations in the field of linear algebra,
  • autoconf – automatic software compilation on different operating systems,
  • automake – creating portable Makefile files,
  • git – distributed revision control system,
  • libtool – creating static and dynamic libraries,
  • svn – revision control system (Subversion), necessary for Kaldi download and installation,
  • wget – data transfer using HTTP, HTTPS and FTP protocols,
  • zlib – data compression,

安装指令: sudo apt-get install autoconf

(probably has to be installed)

  • awk – programming language, used for searching and processing patterns in files and data streams,
  • bash – Unix shell and script programming language,
  • grep – command-line utility for searching plain-text data sets for lines matching a regular expression,
  • make – automatically builds executable programs and libraries from source code,
  • perl – dynamic programming language, perfect for text files processing.

遇到的问题:

  1. Unable to locate package atlas
  2. Unable to locate package zlib
  3. Package 'svn' has no installation candidate 
  4. Package 'awk' has no installation candidate 

解决方案:

  • Unable to locate xxx:

 1 https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt

 2 zlib官方网站:http://www.zlib.net 上下载源码来安装zlib软件包。

解压下载的包:
$tar -xvzf zlib-1.2.11.tar.gz

到下载的包里进行编译:
$cd zlib-1.2.11.tar.gz
$./configure
$make
$sudo make install
3 atlas

Try to add the repositories with

sudo add-apt-repository universe
sudo add-apt-repository main
sudo apt-get update 

And then install needed packages with

sudo apt-get install libatlas-base-dev liblapack-dev libblas-dev

4 zlib: sudo apt-get install zlib1g

Download Kaldi

Just follow the instruction carefully: Downloading and installing Kaldi. If you do not have much idea about how to use GIT, please read about it: Kaldi Tutorial: Version control with Git (5 minutes).

I installed Kaldi in this directory (called 'Kaldi root path'): /home/{user}/kaldi-trunk

   git clone https://github.com/kaldi-asr/kaldi.git kaldi --origin upstream
   cd kaldi

If you want to get updates and bug fixes you can go to some checked-out directory, and type

   git pull

cd kaldi 之后分别在 /tools 和 /src 文件夹下输入: cat INSTALL 查看安装说明,根据说明安装

首先安装依赖包。在./tool目录下检查依赖包,检查完成后输入make,开始编译,输入make -j 8命令可以加快速度(多核并行处理)。 
之后切换到./src目录下,输入./configure进行配置,然后输入make depend,完成之后输入make进行编译。当然这个过程也可以并行处理加速,输入make -j 8。经过漫长的编译过程以后,就安装完毕了

如果要重新编译,输入make clean, make depend, make 

出现的问题:

原因:安装anaconda之后,很多默认的编译器都变成了anaconda自带的了,比如python和gcc等,导致无法使用原编译器。

参考:https://blog.csdn.net/Zafir_410/article/details/74357544

https://stackoverflow.com/questions/40322301/compile-opencv-3-on-ubuntu-16-04-linking-error-usr-lib-x86-64-linux-gnu-libsox

文中提出了两种解决方案,由于编译过程不使用cmake,故使用第二种方案:

第一种方法:
cmake 后增加  

-D WITH_OPENMP=ON

第二种方法:
从系统变量中删除Anaconda路径

sudo gedit ~/.bashrc

考虑到anaconda之后还会使用,在PATH中注释掉anaconda/bin的路径即可
立即生效:

source ~/.bashrc

此时编译大概需要半小时以上。


安装Kaldi时,编译器使用的是anaconda下的编译器,不是系统自带的编译器,所以报错:

解决方法:

1.卸掉anaconda,参考有些人安装opencv的经验

2.在另一台没有anaconda的电脑上安装

 

我用的是解决方法2,成功!

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dr. 卷心菜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值