forked from moses-smt/mosesdecoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
66 lines (49 loc) · 1.51 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
AC_INIT()
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gibbler, 0.1)
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_CPLUSPLUS
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
# Shared library are disabled for default
#LT_INIT([disable-shared])
BOOST_REQUIRE([1.36.0])
BOOST_PROGRAM_OPTIONS
BOOST_THREADS
AC_ARG_WITH(moses,
[AC_HELP_STRING([--with-moses=PATH], [path to Moses toolkit (sparse feature version)])],
[with_moses=$withval],
[AC_MSG_ERROR([Uses the --with-moses flag to provide the moses location])]
)
ac_have_mpi=no
AC_ARG_WITH(mpi,
AC_HELP_STRING([--with-mpi],
[Force compilation with MPI]),
[ if test $withval != no ; then
ac_have_mpi=yes
fi ] )
if test $ac_have_mpi = yes ; then
AC_PATH_PROG(CXX, mpic++, none)
if test $CXX = none ; then
AC_MSG_ERROR([Cannot locate MPI compiler drivers])
fi
BOOST_MPI
BOOST_SERIALIZATION
AC_DEFINE(MPI_ENABLED,1,[Define if compiling with MPI.])
CPPFLAGS="$CPPFLAGS -DMPI_ENABLED"
fi
AM_CONDITIONAL([WITH_THREADS],true)
if test "x$with_moses" != 'xno'
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I${with_moses}/moses/src -I${with_moses}/kenlm"
AC_CHECK_HEADER(StaticData.h,
[AC_MSG_NOTICE([Found Moses])],
[AC_MSG_ERROR([Cannot find Moses!])])
MOSES_LDFLAGS="-L\$(with_moses)/kenlm -L$\$(with_moses)/moses/src"
MOSES_LIBS="-lmoses -lkenlm"
fi
AC_CONFIG_FILES(Makefile src/Makefile)
AC_OUTPUT()