ARM 安装 SRILM

ARM 安装 SRILM

ARM 平台下没有提供 srilm 的编译方式,我们可以通过复制 x86 平台下的 Makefile 并做一定的修改就可以在 ARM 平台下使用。

下载 srilm

git clone https://github.com/BitSpeech/SRILM srilm

编译 srilm

# uname -m 查看系统架构
uname -m

# 修改 machine-type 脚本支持 armv8
# aarch64) MACHINE_TYPE=armv8

cp common/Makefile.machine.i686 common/Makefile.machine.armv8

删除 GCC_FLAGS 中所有不已 -W 开头的选项,删除完后的内容应该是

GCC_FLAGS=-Wall -Wno-unused-variable -Wno-uninitialized

kaldi/tools 目录下执行 ./install_srilm.sh 文件安装 srilm

若没有安装 kaldi,将下方的 shell 脚本保存为 install_srilm.sh 文件,并执行 ./install_srilm.sh 脚本即可安装。

#!/usr/bin/env bash
if [ ! -d liblbfgs-1.10 ];then
	echo Install libLBFGS first
	exit -1
fi

! which gawk 2>/dev/null && \
   echo "GNU awk is not installed so SRILM will probably not work correctly: refusing to install" && exit 1;

# mkdir -p srilm
cd srilm

# set the SRILM variable in the top-level Makefile to this directory.
cp Makefile tmpf

cat tmpf | awk -v pwd=`pwd` '/SRILM =/{printf("SRILM = %s\n", pwd); next;} {print;}' \
  > Makefile || exit 1;

mtype=`sbin/machine-type`

echo HAVE_LIBLBFGS=1 >> common/Makefile.machine.$mtype
grep ADDITIONAL_INCLUDES common/Makefile.machine.$mtype | \
    sed 's|$| -I$(SRILM)/../liblbfgs-1.10/include|' \
    >> common/Makefile.machine.$mtype

grep ADDITIONAL_LDFLAGS common/Makefile.machine.$mtype | \
    sed 's|$| -L$(SRILM)/../liblbfgs-1.10/lib/ -Wl,-rpath -Wl,$(SRILM)/../liblbfgs-1.10/lib/|' \
    >> common/Makefile.machine.$mtype

make || exit 1

echo >&2 "Installation of SRILM finished successfully"
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值