2011-11-25 21:30:36 +04:00
|
|
|
#BUILDING MOSES
|
2011-11-21 18:31:10 +04:00
|
|
|
#
|
2011-11-25 21:30:36 +04:00
|
|
|
#PACKAGES
|
|
|
|
#Language models (optional):
|
2011-11-25 15:55:36 +04:00
|
|
|
#--with-irstlm=/path/to/irstlm
|
2012-11-12 23:56:18 +04:00
|
|
|
#--with-srilm=/path/to/srilm See moses/LM/Jamfile for more options.
|
2013-12-21 00:04:09 +04:00
|
|
|
#--with-maxent-srilm=true (requires a maxent-enabled version of SRILM to be specified via --with-srilm)
|
2013-12-21 00:06:49 +04:00
|
|
|
#--with-nplm=/path/to/nplm
|
2011-11-21 18:31:10 +04:00
|
|
|
#--with-randlm=/path/to/randlm
|
|
|
|
#KenLM is always compiled.
|
|
|
|
#
|
2011-11-25 15:55:36 +04:00
|
|
|
#--with-boost=/path/to/boost
|
|
|
|
#If Boost is in a non-standard location, specify it here. This directory is
|
|
|
|
#expected to contain include and lib or lib64.
|
|
|
|
#
|
2011-11-21 21:19:24 +04:00
|
|
|
#--with-xmlrpc-c=/path/to/xmlrpc-c for libxmlrpc-c (used by server)
|
|
|
|
#Note that, like language models, this is the --prefix where the library was
|
|
|
|
#installed, not some executable within the library.
|
|
|
|
#
|
2012-08-05 00:49:42 +04:00
|
|
|
#Compact phrase table and compact lexical reordering table
|
|
|
|
#--with-cmph=/path/to/cmph
|
|
|
|
#
|
2012-11-15 00:01:07 +04:00
|
|
|
#Thread-caching malloc (if present, used for multi-threaded builds by default)
|
2013-08-21 13:16:33 +04:00
|
|
|
#--without-tcmalloc does not compile with tcmalloc even if present
|
|
|
|
#--full-tcmalloc links against the full version (useful for memory profiling)
|
2011-11-21 21:19:24 +04:00
|
|
|
#
|
2011-11-28 19:52:53 +04:00
|
|
|
#REGRESSION TESTING
|
|
|
|
#--with-regtest=/path/to/moses-reg-test-data
|
|
|
|
#
|
2011-11-25 20:53:02 +04:00
|
|
|
#INSTALLATION
|
2012-05-31 15:55:05 +04:00
|
|
|
#--prefix=/path/to/prefix sets the install prefix [default is source root].
|
2011-11-28 16:01:33 +04:00
|
|
|
#--bindir=/path/to/prefix/bin sets the bin directory [PREFIX/bin]
|
|
|
|
#--libdir=/path/to/prefix/lib sets the lib directory [PREFIX/lib]
|
2012-02-13 23:31:37 +04:00
|
|
|
#--includedir=/path/to/prefix/include installs headers.
|
|
|
|
# Does not install if missing. No argument defaults to PREFIX/include .
|
2011-11-25 20:53:02 +04:00
|
|
|
#--install-scripts=/path/to/scripts copies scripts into a directory.
|
2012-08-09 00:49:02 +04:00
|
|
|
# Does not install if missing. No argument defaults to PREFIX/scripts .
|
2011-11-28 16:01:33 +04:00
|
|
|
#--git appends the git revision to the prefix directory.
|
2011-11-21 21:19:24 +04:00
|
|
|
#
|
2011-11-25 21:30:36 +04:00
|
|
|
#
|
|
|
|
#BUILD OPTIONS
|
2011-11-23 15:29:42 +04:00
|
|
|
# By default, the build is multi-threaded, optimized, and statically linked.
|
|
|
|
# Pass these to change the build:
|
2011-11-21 18:31:10 +04:00
|
|
|
#
|
2011-11-23 15:29:42 +04:00
|
|
|
# threading=single|multi controls threading (default multi)
|
2011-11-21 18:31:10 +04:00
|
|
|
#
|
2011-11-23 15:29:42 +04:00
|
|
|
# variant=release|debug|profile builds optimized (default), for debug, or for
|
|
|
|
# profiling
|
|
|
|
#
|
2012-08-06 18:41:49 +04:00
|
|
|
# link=static|shared controls preferred linking (default static)
|
|
|
|
# --static forces static linking (the default will fall
|
|
|
|
# back to shared)
|
2011-11-23 15:29:42 +04:00
|
|
|
#
|
|
|
|
# debug-symbols=on|off include (default) or exclude debugging
|
|
|
|
# information also known as -g
|
2011-11-25 22:09:07 +04:00
|
|
|
# --notrace compiles without TRACE macros
|
2011-11-25 21:30:36 +04:00
|
|
|
#
|
2014-03-12 12:06:55 +04:00
|
|
|
# --enable-boost-pool uses Boost pools for the memory SCFG tabgle
|
2011-11-27 20:53:40 +04:00
|
|
|
#
|
2011-12-16 01:54:56 +04:00
|
|
|
# --enable-mpi switch on mpi
|
2012-08-06 18:41:49 +04:00
|
|
|
# --without-libsegfault does not link with libSegFault
|
|
|
|
#
|
2012-08-09 00:22:13 +04:00
|
|
|
# --max-kenlm-order maximum ngram order that kenlm can process (default 6)
|
2011-11-23 15:29:42 +04:00
|
|
|
#
|
2012-10-19 15:00:10 +04:00
|
|
|
# --max-factors maximum number of factors (default 4)
|
|
|
|
#
|
2014-03-21 14:53:15 +04:00
|
|
|
# --unlabelled-source ignore source labels (redundant in hiero or string-to-tree system)
|
|
|
|
# for better performance
|
2011-11-25 21:30:36 +04:00
|
|
|
#CONTROLLING THE BUILD
|
2011-11-21 21:19:24 +04:00
|
|
|
#-a to build from scratch
|
2011-11-21 18:31:10 +04:00
|
|
|
#-j$NCPUS to compile in parallel
|
2011-11-23 15:29:42 +04:00
|
|
|
#--clean to clean
|
2011-11-21 18:31:10 +04:00
|
|
|
|
2011-12-05 15:09:48 +04:00
|
|
|
import option ;
|
|
|
|
import modules ;
|
2012-03-31 03:57:05 +04:00
|
|
|
import path ;
|
2011-11-21 15:42:46 +04:00
|
|
|
path-constant TOP : . ;
|
2012-05-10 20:18:49 +04:00
|
|
|
include $(TOP)/jam-files/sanity.jam ;
|
2011-11-21 15:42:46 +04:00
|
|
|
|
2012-05-07 20:58:34 +04:00
|
|
|
boost 103600 ;
|
|
|
|
external-lib z ;
|
2013-09-12 12:17:18 +04:00
|
|
|
|
2013-09-12 12:27:01 +04:00
|
|
|
lib dl : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
2013-09-12 12:17:18 +04:00
|
|
|
requirements += <library>dl ;
|
|
|
|
|
2011-11-30 16:17:47 +04:00
|
|
|
|
2012-11-15 00:29:55 +04:00
|
|
|
if ! [ option.get "without-tcmalloc" : : "yes" ] && [ test_library "tcmalloc_minimal" ] {
|
2013-08-21 13:16:33 +04:00
|
|
|
if [ option.get "full-tcmalloc" : : "yes" ] {
|
2013-08-21 17:29:00 +04:00
|
|
|
external-lib unwind ;
|
2013-08-22 13:16:12 +04:00
|
|
|
external-lib tcmalloc_and_profiler : : unwind ;
|
|
|
|
requirements += <library>tcmalloc_and_profiler <library>unwind <cflags>-fno-omit-frame-pointer <cxxflags>-fno-omit-frame-pointer ;
|
2013-08-21 13:16:33 +04:00
|
|
|
} else {
|
2013-08-21 17:29:00 +04:00
|
|
|
external-lib tcmalloc_minimal ;
|
2014-03-01 11:42:32 +04:00
|
|
|
requirements += <threading>multi:<library>tcmalloc_minimal ;
|
2013-08-21 13:16:33 +04:00
|
|
|
}
|
2013-06-18 21:31:37 +04:00
|
|
|
} else {
|
|
|
|
echo "Tip: install tcmalloc for faster threading. See BUILD-INSTRUCTIONS.txt for more information." ;
|
2011-11-21 19:09:38 +04:00
|
|
|
}
|
|
|
|
|
2011-12-16 01:54:56 +04:00
|
|
|
if [ option.get "enable-mpi" : : "yes" ] {
|
|
|
|
import mpi ;
|
|
|
|
using mpi ;
|
2012-06-07 03:26:22 +04:00
|
|
|
external-lib boost_mpi ;
|
|
|
|
external-lib boost_serialization ;
|
2011-12-16 01:54:56 +04:00
|
|
|
requirements += <define>MPI_ENABLE ;
|
|
|
|
requirements += <library>mpi ;
|
|
|
|
requirements += <library>boost_mpi ;
|
|
|
|
requirements += <library>boost_serialization ;
|
|
|
|
}
|
|
|
|
|
2011-11-30 16:17:47 +04:00
|
|
|
requirements += [ option.get "notrace" : <define>TRACE_ENABLE=1 ] ;
|
|
|
|
requirements += [ option.get "enable-boost-pool" : : <define>USE_BOOST_POOL ] ;
|
2014-02-08 22:18:45 +04:00
|
|
|
requirements += [ option.get "with-mm" : : <define>PT_UG ] ;
|
|
|
|
requirements += [ option.get "with-mm" : : <define>MAX_NUM_FACTORS=4 ] ;
|
2014-03-21 14:53:15 +04:00
|
|
|
requirements += [ option.get "unlabelled-source" : : <define>UNLABELLED_SOURCE ] ;
|
2011-11-28 13:35:46 +04:00
|
|
|
|
2014-07-15 18:26:50 +04:00
|
|
|
if [ option.get "with-lbllm" ] {
|
|
|
|
external-lib boost_serialization ;
|
|
|
|
external-lib gomp ;
|
|
|
|
requirements += <library>boost_serialization ;
|
|
|
|
requirements += <library>gomp ;
|
|
|
|
}
|
|
|
|
|
2012-08-04 17:39:30 +04:00
|
|
|
if [ option.get "with-cmph" ] {
|
2012-08-03 18:38:45 +04:00
|
|
|
requirements += <define>HAVE_CMPH ;
|
|
|
|
}
|
|
|
|
|
2014-06-13 12:48:32 +04:00
|
|
|
if [ option.get "with-probing-pt" : : "yes" ]
|
|
|
|
{
|
2014-01-23 17:14:59 +04:00
|
|
|
external-lib boost_serialization ;
|
2014-01-23 00:57:06 +04:00
|
|
|
requirements += <define>HAVE_PROBINGPT ;
|
2014-01-23 17:14:59 +04:00
|
|
|
requirements += <library>boost_serialization ;
|
2014-01-23 00:57:06 +04:00
|
|
|
}
|
|
|
|
|
2011-11-18 18:37:01 +04:00
|
|
|
project : default-build
|
|
|
|
<threading>multi
|
|
|
|
<warnings>on
|
2011-11-22 22:17:31 +04:00
|
|
|
<debug-symbols>on
|
2011-11-18 18:37:01 +04:00
|
|
|
<variant>release
|
|
|
|
<link>static
|
|
|
|
;
|
|
|
|
|
2013-07-01 12:01:56 +04:00
|
|
|
#Apparently OS X likes to link against iconv for fgetsUTF8.
|
|
|
|
lib iconv ;
|
2013-07-01 13:57:06 +04:00
|
|
|
requirements += <os>MACOSX:<library>iconv ;
|
2013-07-01 12:01:56 +04:00
|
|
|
|
2011-11-18 18:37:01 +04:00
|
|
|
project : requirements
|
|
|
|
<threading>multi:<define>WITH_THREADS
|
|
|
|
<threading>multi:<library>boost_thread
|
2013-07-25 18:56:20 +04:00
|
|
|
<library>boost_system
|
2011-11-22 20:06:34 +04:00
|
|
|
<define>_FILE_OFFSET_BITS=64 <define>_LARGE_FILES
|
2011-11-30 16:17:47 +04:00
|
|
|
$(requirements)
|
2012-11-14 17:43:04 +04:00
|
|
|
<include>.
|
2011-11-18 18:37:01 +04:00
|
|
|
;
|
|
|
|
|
2011-11-21 18:31:10 +04:00
|
|
|
#Add directories here if you want their incidental targets too (i.e. tests).
|
2013-08-15 18:39:40 +04:00
|
|
|
build-projects lm util phrase-extract search moses moses/LM mert moses-cmd moses-chart-cmd mira scripts regression-testing ;
|
2011-11-18 18:37:01 +04:00
|
|
|
|
2013-10-29 01:49:36 +04:00
|
|
|
if [ option.get "with-mm" : : "yes" ]
|
|
|
|
{
|
|
|
|
alias mm :
|
2014-06-28 23:08:41 +04:00
|
|
|
moses/TranslationModel/UG//ptable-lookup
|
2013-10-29 01:49:36 +04:00
|
|
|
moses/TranslationModel/UG/mm//mtt-build
|
|
|
|
moses/TranslationModel/UG/mm//mtt-dump
|
|
|
|
moses/TranslationModel/UG/mm//symal2mam
|
2014-03-12 12:06:55 +04:00
|
|
|
moses/TranslationModel/UG/mm//mam2symal
|
|
|
|
moses/TranslationModel/UG/mm//mam_verify
|
2013-10-29 01:49:36 +04:00
|
|
|
moses/TranslationModel/UG/mm//custom-pt
|
2014-02-08 22:18:45 +04:00
|
|
|
moses/TranslationModel/UG/mm//mmlex-build
|
2014-03-20 00:41:29 +04:00
|
|
|
moses/TranslationModel/UG/mm//mmlex-lookup
|
2014-02-08 22:18:45 +04:00
|
|
|
moses/TranslationModel/UG/mm//mtt-count-words
|
2014-03-18 16:17:07 +04:00
|
|
|
moses/TranslationModel/UG/mm//calc-coverage
|
2014-02-21 03:56:45 +04:00
|
|
|
moses/TranslationModel/UG//try-align
|
2013-10-29 01:49:36 +04:00
|
|
|
;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
alias mm ;
|
|
|
|
}
|
|
|
|
|
2013-09-25 03:11:11 +04:00
|
|
|
alias programs :
|
|
|
|
lm//programs
|
|
|
|
moses-chart-cmd//moses_chart
|
|
|
|
moses-cmd//programs
|
|
|
|
OnDiskPt//CreateOnDiskPt
|
|
|
|
OnDiskPt//queryOnDiskPt
|
|
|
|
mert//programs
|
|
|
|
misc//programs
|
|
|
|
symal
|
|
|
|
phrase-extract
|
|
|
|
phrase-extract//lexical-reordering
|
|
|
|
phrase-extract//extract-ghkm
|
|
|
|
phrase-extract//pcfg-extract
|
|
|
|
phrase-extract//pcfg-score
|
|
|
|
biconcor
|
|
|
|
mira//mira
|
|
|
|
contrib/server//mosesserver
|
2013-10-29 01:49:36 +04:00
|
|
|
mm
|
2013-09-25 03:11:11 +04:00
|
|
|
;
|
2011-11-28 16:01:33 +04:00
|
|
|
|
2013-10-29 01:49:36 +04:00
|
|
|
|
2012-05-07 20:58:34 +04:00
|
|
|
install-bin-libs programs ;
|
2013-08-15 18:39:40 +04:00
|
|
|
install-headers headers-base : [ path.glob-tree biconcor contrib lm mert misc moses-chart-cmd moses-cmd OnDiskPt phrase-extract symal util : *.hh *.h ] : . ;
|
2012-11-12 23:56:18 +04:00
|
|
|
install-headers headers-moses : moses//headers-to-install : moses ;
|
2012-02-13 23:31:37 +04:00
|
|
|
|
2012-05-07 20:58:34 +04:00
|
|
|
alias install : prefix-bin prefix-lib headers-base headers-moses ;
|
2012-03-31 03:57:05 +04:00
|
|
|
|
2012-05-07 20:58:34 +04:00
|
|
|
if ! [ option.get "includedir" : : $(prefix)/include ] {
|
|
|
|
explicit install headers-base headers-moses ;
|
2012-04-02 23:20:56 +04:00
|
|
|
}
|
2012-06-01 03:13:01 +04:00
|
|
|
|
|
|
|
if [ path.exists $(TOP)/dist ] && $(prefix) != dist {
|
|
|
|
echo "You have a $(TOP)/dist directory, but the build system now places files directly in the root i.e. $(TOP)/bin ." ;
|
|
|
|
echo "To disable this message, delete $(TOP)/dist ." ;
|
|
|
|
echo ;
|
|
|
|
}
|