diff --git a/BUILD-INSTRUCTIONS.txt b/BUILD-INSTRUCTIONS.txt index 01c41d2f35..7d9cd9cda0 100644 --- a/BUILD-INSTRUCTIONS.txt +++ b/BUILD-INSTRUCTIONS.txt @@ -1,7 +1,7 @@ 0) Preliminaries -Before building you need to decide what language model toolkit (SRI's -or IRST's) you want to use. +Before building you need to decide what language model toolkit (SRI's, +IRST's, or Ken's) you want to use. If you want to use SRI's, you will need to download its source and build it. The SRILM can be downloaded from @@ -12,6 +12,9 @@ If you want to use IRST's, you will need to download its source and build it. The IRSTLM can be downloaded from http://sourceforge.net/projects/irstlm/ + +Ken's LM is included with the Moses distribution. + IMPORTANT: These instructions are for building the moses decoder ONLY, the training and tuning SCRIPTS contained in scripts/ must be built and installed separately. Also, they may require modification to @@ -52,6 +55,22 @@ The resulting decoder binary will be moses-cmd/src/moses . -------------------------------------------------------------------------- +3) Instructions for building with Ken's LM + + ./regenerate-makefiles.sh + ./configure + +The resulting decoder binary will be moses-cmd/src/moses . +Use language model 8 in your moses.ini: +[lmodel-file] +8 0 2 /path/to/lm.arpa + +If you don't want Ken's LM, ./configure --without-kenlm + +-------------------------------------------------------------------------- + + + ALTERNATIVE WAYS TO BUILD ON UNIX AND OTHER PLATFORMS Using Eclipse diff --git a/configure.in b/configure.in index d838c8c6af..fd7ab2064e 100644 --- a/configure.in +++ b/configure.in @@ -41,9 +41,9 @@ AC_ARG_WITH(irstlm, ) AC_ARG_WITH(kenlm, - [AC_HELP_STRING([--with-kenlm=PATH], [(optional) path to Ken's LM toolkit])], + [AC_HELP_STRING([--with-kenlm], [(optional) Include Ken's LM toolkit; default is yes])], [with_kenlm=$withval], - [with_kenlm=no] + [with_kenlm=yes] ) AC_ARG_WITH(randlm, @@ -174,14 +174,14 @@ fi if test "x$with_kenlm" != 'xno' then SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I${with_kenlm}" + CPPFLAGS="$CPPFLAGS -I${PWD}/kenlm" AC_CHECK_HEADER(lm/ngram.hh, [AC_DEFINE([HAVE_KENLM], [], [flag for KENLM])], [AC_MSG_ERROR([Cannot find KEN-LM in ${with_kenlm}])]) LIB_KENLM="-lkenlm" - LDFLAGS="$LDFLAGS -L${with_kenlm}" + LDFLAGS="$LDFLAGS -L${PWD}/kenlm" LIBS="$LIBS $LIB_KENLM" FMTLIBS="$FMTLIBS libkenlm.a" AM_CONDITIONAL([KEN_LM], true) diff --git a/regenerate-makefiles.sh b/regenerate-makefiles.sh index d39dad57c1..22fff22532 100755 --- a/regenerate-makefiles.sh +++ b/regenerate-makefiles.sh @@ -53,7 +53,7 @@ $LIBTOOLIZE || die "libtoolize failed" echo echo "You should now be able to configure and build:" -echo " ./configure [--with-srilm=/path/to/srilm] [--with-irstlm=/path/to/irstlm] [--with-randlm=/path/to/randlm] [--with-kenlm=/path/to/kenlm] [--with-xmlrpc-c=/path/to/xmlrpc-c-config]" +echo " ./configure [--with-srilm=/path/to/srilm] [--with-irstlm=/path/to/irstlm] [--with-randlm=/path/to/randlm] [--without-kenlm] [--with-xmlrpc-c=/path/to/xmlrpc-c-config]" echo " make -j 4" echo