个人博客:https://yutouwd.github.io/
kaldi在Windows下的安装
工具准备
- git
- cmake
- Visual Studio 2017
vs2017要注意安装win8.1 SDK,如果已经安装了vs2017,也可以在上方的菜单栏中的工具->获取工具和功能中来查看是否有安装。git和cmake的安装没有什么特别的,就不做介绍了。
编译Openfst
首先从github上将openfst clone下来。然后这里用cmake的方式来先编译出vs的工程文件,具体操作方法如下:
git clone https://github.com/kkm000/openfst.git
cd openfst
mkdir build64
cd build64
cmake -G "Visual Studio 15 2017 Win64" ../
如果这一步成功会显示以下提示:
-- The C compiler identification is MSVC 19.11.25547.0
-- The CXX compiler identification is MSVC 19.11.25547.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The following ICU libraries were not found:
-- data (required)
-- i18n (required)
-- io (required)
-- test (required)
-- tu (required)
-- uc (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY _ICU_REQUIRED_LIBS_FOUND)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/jtrmal/Documents/openfst/build64
成功后会在build64目录下面生成一个openfst.sln文件,用vs2017打开这个文件,分别用Debug|x64和Release|x64来生成一遍,如下图,如果失败为0则代表编译通过。
配置OpenBLAS
首先也是从github上先将kaldi clone下来
git clone https://github.com/kaldi-asr/kaldi.git kaldi
然后我们就需要去配置线性代数库,这里有两个选择,一个是Intel MKL,一个是OpenBLAS。这里我选用OpenBLAS。用下面的命令来下载OpenBLAS的二进制包(在kaldi/tools目录下):
curl -L -O http://sourceforge.net/projects/openblas/files/v0.2.14/OpenBLAS-v0.2.14-Win64-int32.zip
unzip OpenBLAS-v0.2.14-Win64-int32.zip
注意这里要下载Win64-int32版本,而