add irstlm support

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@273 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
redpony 2006-07-25 14:42:49 +00:00
parent 64d8e3aef4
commit c2be12bcd4

View File

@ -15,28 +15,36 @@ AC_ARG_WITH(srilm,
)
AC_ARG_WITH(boost,
[AC_HELP_STRING([--with-srilm=PATH], [path to BOOST libraries])],
[AC_HELP_STRING([--with-boost=PATH], [path to BOOST libraries])],
[with_boost=$withval],
[with_boost=no]
)
AC_ARG_WITH(irstlm,
[AC_HELP_STRING([--with-irstlm=PATH], [(optional) path to IRST's LM toolkit])],
[with_irstlm=$withval],
[with_irstlm=no]
)
AC_ARG_WITH(moses,
[AC_HELP_STRING([--with-moses=PATH], [path to moses library])],
[with_moses=$withval],
[with_moses=no]
)
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization], [compile with -O3 flag])],
[CPPFLAGS="$CPPFLAGS -O3"; LDFLAGS="$LDFLAGS -O3" ]
)
AC_ARG_ENABLE(profiling,
[AC_HELP_STRING([--enable-profiling], [moses will dump profiling info])],
[CPPFLAGS="$CPPFLAGS -pg"; LDFLAGS="$LDFLAGS -pg" ]
)
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization], [compile with -O3 flag])],
[CPPFLAGS="$CPPFLAGS -O3"; LDFLAGS="$LDFLAGS -O3" ]
)
AC_ARG_ENABLE(mysql, AC_HELP_STRING([--enable-mysql], [(optional) build in MySQL support])],
[mysql_flag=yes], [mysql_flag=no])
if test "x$with_boost" != 'xno'
then
CPPFLAGS="$CPPFLAGS -I${with_boost} -I${with_boost}/include"
@ -74,7 +82,7 @@ if test "x$with_srilm" != 'xno'
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I${with_srilm}/include"
AC_CHECK_HEADER(Ngram.h,
[AC_DEFINE([HAVE_SRILM], [], [flag for SRILM])],
[AC_MSG_ERROR([Cannot find SRILM!])])
@ -89,10 +97,29 @@ then
FMTLIBS="$FMTLIBS liboolm.a libdstruct.a libmisc.a"
AM_CONDITIONAL([SRI_LM], true)
AM_CONDITIONAL([INTERNAL_LM], false)
AM_CONDITIONAL([IRST_LM], false)
else if test "x$with_irstlm" != 'xno'
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I${with_irstlm}/include"
AC_CHECK_HEADER(ngram.h,
[AC_DEFINE([HAVE_IRSTLM], [], [flag for IRSTLM])],
[AC_MSG_ERROR([Cannot find IRST-LM!])])
LIB_SRILM="-lirstlm"
LDFLAGS="$LDFLAGS -L${with_irstlm}/lib"
LIBS="$LIBS $LIB_SRILM"
FMTLIBS="$FMTLIBS libirstlm.a"
AM_CONDITIONAL([SRI_LM], false)
AM_CONDITIONAL([INTERNAL_LM], false)
AM_CONDITIONAL([IRST_LM], true)
else
echo "Using internal language model (use --with-srilm to change)!"
echo "Using internal language model (use --with-srilm or --with-irstlm to change)!"
AM_CONDITIONAL([SRI_LM], false)
AM_CONDITIONAL([INTERNAL_LM], true)
AM_CONDITIONAL([IRST_LM], false)
fi
fi
LIBS="$LIBS -lboost_iostreams-gcc-mt -lboost_filesystem-gcc-mt -lboost_thread-gcc-mt -lz"