Mips平台kaldi源码的交叉编译一kaldi源码的交叉编译

版权声明: https://blog.csdn.net/cj1989111/article/details/84323405

前言:

在编译kaldi源码时,请先参照 https://www.jianshu.com/p/05e1bbe0ca3a 这篇文章在x86平台能够编译后,再进行以下操作。

Kaldi交叉编译:

1. 确保openfst已经编译完成,并且存放路径为:kaldi/tools/openfst/include/   kaldi/tools/openfst/lib/

2. 确保openBlas和Clapack编译完成,并且拷贝Clapack编译生成的lib库:libblas.a libclapack.a libf2c.a至OpenBLAS/install/lib下

3. 切换到kaldi/src目录,执行

CXX=mips-linux-gnu-g++ AR=mips-linux-gnu-ar AS=mips-linux-gnu-as RANLIB=mips-linux-gnu-ranlib ./configure --static --use-cuda=no --openblas-root=/home/xxx/OpenBLAS-master/install --clapack-root=/home/xxx/OpenBLAS-master/install

以上参数 /home/xxx/OpenBLAS-master/install 是我openBlas编译完成后存放的路径,install目录结构如下:

4. 执行完步骤3的命令后,出现如下信息:

Configuring KALDI to use CLAPACK
Configuring KALDI to use OPENBLAS
Configuring ...
Checking compiler mips-linux-gnu-g++ ...
Checking OpenFst library in /home/chenjiang/work/kaldi/tools/openfst ...
Doing OS specific configurations ...
On Linux: Checking for linear algebra header files ...
Your math library seems to be OpenBLAS from /home/chenjiang/OpenBLAS-master/install.  Configuring appropriately.
Configuring static OpenBlas since --static-math=yes
Successfully configured for Linux with OpenBLAS from /home/chenjiang/OpenBLAS-master/install
Info: configuring Kaldi not to link with Speex (don't worry, it's only needed if you
intend to use 'compress-uncompress-speex', which is very unlikely)
mips-linux-gnu-g++: error: unrecognized command line option '-msse'
mips-linux-gnu-g++: error: unrecognized command line option '-msse2'

make: *** [exp-test] Error 1
./configure: 行 206: ./exp-test: 没有那个文件或目录
SUCCESS
To compile: make clean -j; make depend -j; make -j
 ... or e.g. -j 10, instead of -j, to use a specified number of CPUs

修改kaldi.mk文件,修正红色错误及添加libblas.a libclapack.a libf2c.a的链接库

a. 添加蓝色部分内容

OPENBLASINC = /home/xxx/OpenBLAS-master/install/include
OPENBLASLIBS = /home/xxx/OpenBLAS-master/install/lib/libopenblas.a -lgfortran
OPENBLASLIBS += /home/xxx/OpenBLAS-master/install/lib/libclapack.a 
OPENBLASLIBS += /home/xxx/OpenBLAS-master/install/lib/libblas.a
OPENBLASLIBS += /home/xxx/OpenBLAS-master/install/lib/libf2c.a

b. 删除 -msse -msse2 参数

5. make depend -j4

6 make -j4

若无错误,则编译完成。

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

online解码器未完待续...

猜你喜欢

转载自blog.csdn.net/cj1989111/article/details/84323405
今日推荐