Welcome to mirror list, hosted at ThFree Co, Russian Federation.

configure.in « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f1af3eae79d41d6223b179378424c42f15318c5c (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
AC_INIT(src)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(moses, 0.1)

AC_PROG_CXX
AC_LANG_CPLUSPLUS
AC_PROG_RANLIB
#AM_PROG_LIBTOOL

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(boost,
            [AC_HELP_STRING([--with-srilm=PATH], [path to BOOST libraries])],
            [with_boost=$withval],
            [with_boost=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" ]
           )

if test "x$with_boost" != 'xno'
then
  CPPFLAGS="$CPPFLAGS -I${with_boost} -I${with_boost}/include"
  LDFLAGS="$LDFLAGS -L${with_boost}/lib"
fi

AC_CHECK_HEADER([boost/algorithm/string.hpp], [], [AC_MSG_ERROR([Cannot find boost.  Use --with-boost=PATH])])
AC_CHECK_HEADER([boost/iostreams/filtering_stream.hpp], [], [AC_MSG_ERROR([Cannot find boost.  Use --with-boost=PATH])])

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)
  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 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 -lboost_filesystem -lboost_thread"
FMT_LIBS="$FMT_LIBS libboost_iostreams.a libboost_filesystem.a libboost_thread.a"


AC_OUTPUT(Makefile src/Makefile)