1.下载http://www.speech.sri.com/projects/srilm/download.html
2.解压:tar zxvf srilm.tar.gz
3.修改 Makefile 文件(SRILM 目录下)
找到:
# SRILM = /home/speech/stolcke/project/srilm/devel
另起一行输入 SRILM 的安装路径 SRILM = $(PWD)
找到:
MACHINE_TYPE := $(shell $(SRILM)/sbin/machine-type)
在其前加#注释掉,并另起一行输入:
MACHINE_TYPE := i686-gcc4
注释:可以通过uname -a命令查看电脑与系统信息
4.修改srilm/common/Makefile.machine.i686-gcc4
找到:
GCC_FLAGS = -mtune=pentium3 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
这里是为了告诉 SRILM 系统使用的 compiler(c 和 c++),符合安装情况,不需要修改。如果是 64 位 CPU,需要做相应调整
找到:
TCL_INCLUDE =
TCL_LIBRARY =
修改为:
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X
找到:
GAWK = /usr/bin/awk
修改为
GAWK = /usr/bin/gawk
5.安装SRILM
编译:srilm目录下:make World
修改环境变量:运行命令 export PATH=/home/.../srilm/bin/i686-m48:/home/.../srilm/bin:$PATH (...为省去的目录名称)
6.测试
make test