kaldi交叉编译
编译openfst
- 下载所需版本的openfst,我这里用的是1.6.7版本,这里需要注意的是低版本的openfst(比如1.4)与高版本的gcc(比如8.0以上)会出现编译不通过的现象,我这里碰到的是“include/fst/replace.h:1253:57: error: expected ‘;’ before ‘::’ token ->template CacheBaseImpl<typename C::State, >::InitArcIterator(”,这里参照https://github.com/srvk/eesen/issues/215解决了问题;
- 解压并进入到解压目录下,执行configure命令,配置编译选项,命令如下:./configure --host=arm-linux-gnueabihf --prefix=xxx --enable-static
make -j8
编译openblas
- 下载OpenBLAS源代码,代码地址:https://github.com/xianyi/OpenBLAS,这里使用的版本是OpenBLAS-0.3.10
- 在OpenBLAS目录下面执行如下命令:make PREFIX=$(pwd)/install TARGET=ARMV7 HOSTCC=gcc BINARY=32 CC=arm-linux-gnueabihf-gcc FC=arm-linux-gnueabihf-gfortran all install
编译kaldi
- 下载kaldi代码,进入到src目录下,执行configure命令,配置编译选项,命令如下:./configure --static --fst-root=xxx --host=arm-linux-gnueabihf --openblas-root=xxx --use-cuda=no --static-fst=yes
make -j clean depend
make -j 8