mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-04 01:45:52 +03:00
36266e68c9
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2555 1f5c12ca-751b-0410-a591-d2e778427230
163 lines
4.5 KiB
Plaintext
163 lines
4.5 KiB
Plaintext
AC_INIT(moses/src)
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
|
AM_INIT_AUTOMAKE(moses, 0.1)
|
|
|
|
AC_PROG_CXX
|
|
AC_LANG_CPLUSPLUS
|
|
AC_PROG_RANLIB
|
|
#AM_PROG_LIBTOOL
|
|
|
|
AX_XMLRPC_C
|
|
|
|
AC_ARG_WITH(protobuf,
|
|
[AC_HELP_STRING([--with-protobuf=PATH], [(optional) path to Google protobuf])],
|
|
[with_protobuf=$withval],
|
|
[with_protobuf=no]
|
|
)
|
|
|
|
AC_ARG_WITH(srilm,
|
|
[AC_HELP_STRING([--with-srilm=PATH], [(optional) path to SRI's LM toolkit])],
|
|
[with_srilm=$withval],
|
|
[with_srilm=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(randlm,
|
|
[AC_HELP_STRING([--with-randlm=PATH], [(optional) path to RandLM toolkit])],
|
|
[with_randlm=$withval],
|
|
[with_randlm=no]
|
|
)
|
|
|
|
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(threads,
|
|
[AC_HELP_STRING([--enable-threads], [compile threadsafe library and multi-threaded moses (mosesmt)])],
|
|
[with_threads=yes]
|
|
)
|
|
|
|
AM_CONDITIONAL([INTERNAL_LM], false)
|
|
AM_CONDITIONAL([SRI_LM], false)
|
|
AM_CONDITIONAL([IRST_LM], false)
|
|
AM_CONDITIONAL([RAND_LM], false)
|
|
AM_CONDITIONAL([PROTOBUF], false)
|
|
AM_CONDITIONAL([am__fastdepCC], false)
|
|
AM_CONDITIONAL([WITH_THREADS],false)
|
|
|
|
if test "x$with_threads" = 'xyes'
|
|
then
|
|
AC_MSG_NOTICE([Building threaded moses])
|
|
AX_BOOST_BASE([1.35.0])
|
|
AX_BOOST_THREAD
|
|
CPPFLAGS="$CPPFLAGS -DWITH_THREADS"
|
|
AM_CONDITIONAL([WITH_THREADS],true)
|
|
else
|
|
AC_MSG_NOTICE([Building non-threaded moses. This will disable the moses server])
|
|
fi
|
|
|
|
if test "x$with_protobuf" != 'xno'
|
|
then
|
|
SAVE_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS -I${with_protobuf}/include"
|
|
|
|
AC_CHECK_HEADER(google/protobuf/message.h,
|
|
[AC_DEFINE([HAVE_PROTOBUF], [], [flag for protobuf])],
|
|
[AC_MSG_ERROR([Cannot find protobuf!])])
|
|
|
|
LIB_PROTOBUF="-lprotobuf"
|
|
LDFLAGS="$LDFLAGS -L${with_protobuf}/lib"
|
|
LIBS="$LIBS $LIB_PROTOBUF"
|
|
AC_PATH_PROG(PROTOC,protoc,,"${PATH}:${with_protobuf}/bin")
|
|
FMTLIBS="$FMTLIBS libprotobuf.a"
|
|
AM_CONDITIONAL([PROTOBUF], true)
|
|
fi
|
|
|
|
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!])])
|
|
|
|
LIB_SRILM="-loolm -ldstruct -lmisc"
|
|
# ROOT/lib/i686-m64/liboolm.a
|
|
# ROOT/lib/i686-m64/libdstruct.a
|
|
# ROOT/lib/i686-m64/libmisc.a
|
|
MY_ARCH=`${with_srilm}/sbin/machine-type`
|
|
LDFLAGS="$LDFLAGS -L${with_srilm}/lib/${MY_ARCH}"
|
|
LIBS="$LIBS $LIB_SRILM"
|
|
FMTLIBS="$FMTLIBS liboolm.a libdstruct.a libmisc.a"
|
|
AM_CONDITIONAL([SRI_LM], true)
|
|
fi
|
|
|
|
if test "x$with_irstlm" != 'xno'
|
|
then
|
|
SAVE_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS -I${with_irstlm}/include"
|
|
|
|
AC_CHECK_HEADER(n_gram.h,
|
|
[AC_DEFINE([HAVE_IRSTLM], [], [flag for IRSTLM])],
|
|
[AC_MSG_ERROR([Cannot find IRST-LM!])])
|
|
|
|
MY_ARCH=`uname -m`
|
|
LIB_IRSTLM="-lirstlm"
|
|
LDFLAGS="$LDFLAGS -L${with_irstlm}/lib/${MY_ARCH}"
|
|
LIBS="$LIBS $LIB_IRSTLM"
|
|
FMTLIBS="$FMTLIBS libirstlm.a"
|
|
AM_CONDITIONAL([IRST_LM], true)
|
|
fi
|
|
|
|
if test "x$with_randlm" != 'xno'
|
|
then
|
|
SAVE_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS -I${with_randlm}/include"
|
|
|
|
AC_CHECK_HEADER(RandLM.h,
|
|
[AC_DEFINE([HAVE_RANDLM], [], [flag for RandLM])],
|
|
[AC_MSG_ERROR([Cannot find RandLM!])])
|
|
|
|
|
|
MY_ARCH=`uname -m`
|
|
LIB_RANDLM="-lrandlm"
|
|
LDFLAGS="$LDFLAGS -L${with_randlm}/lib"
|
|
LIBS="$LIBS $LIB_RANDLM"
|
|
FMTLIBS="$FMTLIBS librandlm.a"
|
|
AM_CONDITIONAL([RAND_LM], true)
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([WITH_MERT],false)
|
|
AC_CHECK_HEADERS([getopt.h],
|
|
[AM_CONDITIONAL([WITH_MERT],true)],
|
|
[AC_MSG_WARN([Cannot find getopt.h - disabling new mert])])
|
|
|
|
AM_CONDITIONAL([WITH_SERVER],false)
|
|
if test "x$have_xmlrpc_c" = "xyes" && test "x$with_threads" = "xyes"; then
|
|
AM_CONDITIONAL([WITH_SERVER],true)
|
|
else
|
|
AC_MSG_NOTICE([Disabling server])
|
|
fi
|
|
|
|
LIBS="$LIBS -lz"
|
|
|
|
|
|
AC_CONFIG_FILES(Makefile moses/src/Makefile moses-cmd/src/Makefile misc/Makefile mert/Makefile server/Makefile)
|
|
|
|
AC_OUTPUT()
|