mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
219 lines
7.2 KiB
Plaintext
219 lines
7.2 KiB
Plaintext
#BUILDING MOSES
|
|
#
|
|
#PACKAGES
|
|
#Language models (optional):
|
|
#--with-irstlm=/path/to/irstlm
|
|
#--with-srilm=/path/to/srilm See moses/LM/Jamfile for more options.
|
|
#--with-maxent-srilm=true (requires a maxent-enabled version of SRILM to be specified via --with-srilm)
|
|
#--with-nplm=/path/to/nplm
|
|
#--with-randlm=/path/to/randlm
|
|
#KenLM is always compiled.
|
|
#
|
|
#--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.
|
|
#
|
|
#--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.
|
|
#
|
|
#Compact phrase table and compact lexical reordering table
|
|
#--with-cmph=/path/to/cmph
|
|
#
|
|
#Thread-caching malloc (if present, used for multi-threaded builds by default)
|
|
#--without-tcmalloc does not compile with tcmalloc even if present
|
|
#--full-tcmalloc links against the full version (useful for memory profiling)
|
|
#
|
|
#REGRESSION TESTING
|
|
#--with-regtest=/path/to/moses-reg-test-data
|
|
#
|
|
#INSTALLATION
|
|
#--prefix=/path/to/prefix sets the install prefix [default is source root].
|
|
#--bindir=/path/to/prefix/bin sets the bin directory [PREFIX/bin]
|
|
#--libdir=/path/to/prefix/lib sets the lib directory [PREFIX/lib]
|
|
#--includedir=/path/to/prefix/include installs headers.
|
|
# Does not install if missing. No argument defaults to PREFIX/include .
|
|
#--install-scripts=/path/to/scripts copies scripts into a directory.
|
|
# Does not install if missing. No argument defaults to PREFIX/scripts .
|
|
#--git appends the git revision to the prefix directory.
|
|
#
|
|
#
|
|
#BUILD OPTIONS
|
|
# By default, the build is multi-threaded, optimized, and statically linked.
|
|
# Pass these to change the build:
|
|
#
|
|
# threading=single|multi controls threading (default multi)
|
|
#
|
|
# variant=release|debug|profile builds optimized (default), for debug, or for
|
|
# profiling
|
|
#
|
|
# link=static|shared controls preferred linking (default static)
|
|
# --static forces static linking (the default will fall
|
|
# back to shared)
|
|
#
|
|
# debug-symbols=on|off include (default) or exclude debugging
|
|
# information also known as -g
|
|
# --notrace compiles without TRACE macros
|
|
#
|
|
# --enable-boost-pool uses Boost pools for the memory SCFG tabgle
|
|
#
|
|
# --enable-mpi switch on mpi
|
|
# --without-libsegfault does not link with libSegFault
|
|
#
|
|
# --max-kenlm-order maximum ngram order that kenlm can process (default 6)
|
|
#
|
|
# --max-factors maximum number of factors (default 4)
|
|
#
|
|
# --unlabelled-source ignore source labels (redundant in hiero or string-to-tree system)
|
|
# for better performance
|
|
#CONTROLLING THE BUILD
|
|
#-a to build from scratch
|
|
#-j$NCPUS to compile in parallel
|
|
#--clean to clean
|
|
|
|
import option ;
|
|
import modules ;
|
|
import path ;
|
|
path-constant TOP : . ;
|
|
include $(TOP)/jam-files/sanity.jam ;
|
|
|
|
boost 103600 ;
|
|
external-lib z ;
|
|
|
|
lib dl : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
|
requirements += <library>dl ;
|
|
|
|
|
|
if ! [ option.get "without-tcmalloc" : : "yes" ] && [ test_library "tcmalloc_minimal" ] {
|
|
if [ option.get "full-tcmalloc" : : "yes" ] {
|
|
external-lib unwind ;
|
|
external-lib tcmalloc_and_profiler : : unwind ;
|
|
requirements += <library>tcmalloc_and_profiler <library>unwind <cflags>-fno-omit-frame-pointer <cxxflags>-fno-omit-frame-pointer ;
|
|
} else {
|
|
external-lib tcmalloc_minimal ;
|
|
requirements += <threading>multi:<library>tcmalloc_minimal ;
|
|
}
|
|
} else {
|
|
echo "Tip: install tcmalloc for faster threading. See BUILD-INSTRUCTIONS.txt for more information." ;
|
|
}
|
|
|
|
if [ option.get "enable-mpi" : : "yes" ] {
|
|
import mpi ;
|
|
using mpi ;
|
|
external-lib boost_mpi ;
|
|
external-lib boost_serialization ;
|
|
requirements += <define>MPI_ENABLE ;
|
|
requirements += <library>mpi ;
|
|
requirements += <library>boost_mpi ;
|
|
requirements += <library>boost_serialization ;
|
|
}
|
|
|
|
requirements += [ option.get "notrace" : <define>TRACE_ENABLE=1 ] ;
|
|
requirements += [ option.get "enable-boost-pool" : : <define>USE_BOOST_POOL ] ;
|
|
requirements += [ option.get "with-mm" : : <define>PT_UG ] ;
|
|
requirements += [ option.get "with-mm" : : <define>MAX_NUM_FACTORS=4 ] ;
|
|
requirements += [ option.get "unlabelled-source" : : <define>UNLABELLED_SOURCE ] ;
|
|
|
|
if [ option.get "with-lbllm" ] {
|
|
external-lib boost_serialization ;
|
|
external-lib gomp ;
|
|
requirements += <library>boost_serialization ;
|
|
requirements += <library>gomp ;
|
|
}
|
|
|
|
if [ option.get "with-cmph" ] {
|
|
requirements += <define>HAVE_CMPH ;
|
|
}
|
|
|
|
if [ option.get "with-probing-pt" : : "yes" ]
|
|
{
|
|
external-lib boost_serialization ;
|
|
requirements += <define>HAVE_PROBINGPT ;
|
|
requirements += <library>boost_serialization ;
|
|
}
|
|
|
|
project : default-build
|
|
<threading>multi
|
|
<warnings>on
|
|
<debug-symbols>on
|
|
<variant>release
|
|
<link>static
|
|
;
|
|
|
|
#Apparently OS X likes to link against iconv for fgetsUTF8.
|
|
lib iconv ;
|
|
requirements += <os>MACOSX:<library>iconv ;
|
|
|
|
project : requirements
|
|
<threading>multi:<define>WITH_THREADS
|
|
<threading>multi:<library>boost_thread
|
|
<library>boost_system
|
|
<define>_FILE_OFFSET_BITS=64 <define>_LARGE_FILES
|
|
$(requirements)
|
|
<include>.
|
|
;
|
|
|
|
#Add directories here if you want their incidental targets too (i.e. tests).
|
|
build-projects lm util phrase-extract search moses moses/LM mert moses-cmd moses-chart-cmd mira scripts regression-testing ;
|
|
|
|
if [ option.get "with-mm" : : "yes" ]
|
|
{
|
|
alias mm :
|
|
moses/TranslationModel/UG//spe-check-coverage2
|
|
moses/TranslationModel/UG//ptable-lookup
|
|
moses/TranslationModel/UG//sim-pe
|
|
moses/TranslationModel/UG//spe-check-coverage
|
|
moses/TranslationModel/UG/mm//mtt-build
|
|
moses/TranslationModel/UG/mm//mtt-dump
|
|
moses/TranslationModel/UG/mm//symal2mam
|
|
moses/TranslationModel/UG/mm//mam2symal
|
|
moses/TranslationModel/UG/mm//mam_verify
|
|
moses/TranslationModel/UG/mm//mmlex-build
|
|
moses/TranslationModel/UG/mm//mmlex-lookup
|
|
moses/TranslationModel/UG/mm//mtt-count-words
|
|
moses/TranslationModel/UG/mm//calc-coverage
|
|
moses/TranslationModel/UG//try-align
|
|
;
|
|
}
|
|
else
|
|
{
|
|
alias mm ;
|
|
}
|
|
|
|
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
|
|
mm
|
|
;
|
|
|
|
|
|
install-bin-libs programs ;
|
|
install-headers headers-base : [ path.glob-tree biconcor contrib lm mert misc moses-chart-cmd moses-cmd OnDiskPt phrase-extract symal util : *.hh *.h ] : . ;
|
|
install-headers headers-moses : moses//headers-to-install : moses ;
|
|
|
|
alias install : prefix-bin prefix-lib headers-base headers-moses ;
|
|
|
|
if ! [ option.get "includedir" : : $(prefix)/include ] {
|
|
explicit install headers-base headers-moses ;
|
|
}
|
|
|
|
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 ;
|
|
}
|