Merge branch 'master' of github.com:moses-smt/mosesdecoder

This commit is contained in:
Tetsuo Kiso 2012-03-21 00:22:52 +09:00
commit 8ffa48e530

View File

@ -1,7 +1,15 @@
#This is somewhat hairy due to the number of optional language models.
#Currently, the optional models are IRSTLM, SRILM, and RandLM. These are
#activated by --with-irstlm, --with-srilm, and --with-randlm respectively.
#The value is the path where it's installed e.g. --with-irstlm=/path/to/irst.
#Each optional model has a section below. The top level rule is lib LM, which
#appears after the optional models.
import option path build-system ;
local dependencies = ;
#IRSTLM
local with-irstlm = [ option.get "with-irstlm" ] ;
if $(with-irstlm) {
lib irstlm : : <search>$(with-irstlm)/lib <search>$(with-irstlm)/lib64 ;
@ -13,9 +21,11 @@ if $(with-irstlm) {
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
}
#SRILM
local with-srilm = [ option.get "with-srilm" ] ;
if $(with-srilm) {
if [ option.get "with-srilm-dynamic" : no : yes ] = yes {
lib srilm ;
alias sri-libs : srilm ;
} else {
sri-arch = [ option.get "with-srilm-arch" ] ;
@ -36,6 +46,7 @@ if $(with-srilm) {
dependencies += sri ;
}
#RandLM
local with-randlm = [ option.get "with-randlm" ] ;
if $(with-randlm) {
lib randlm : : <search>$(with-randlm)/lib <search>$(with-randlm)/lib64 ;
@ -44,15 +55,22 @@ if $(with-randlm) {
dependencies += rand ;
}
#ORLM is always compiled but needs special headers
obj ORLM.o : ORLM.cpp ..//headers ../DynSAInclude//dynsa : : : <include>../DynSAInclude ;
#The factory needs the macros LM_IRST etc to know which ones to use.
obj Factory.o : Factory.cpp ..//headers $(dependencies) : <include>../DynSAInclude ;
#Top-level LM library. If you've added a file that doesn't depend on external
#libraries, put it here.
lib LM : Base.cpp Factory.o Implementation.cpp Joint.cpp Ken.cpp MultiFactor.cpp Remote.cpp SingleFactor.cpp ORLM.o
../../../lm//kenlm ..//headers $(dependencies) ;
#Huge kludge to force building if different --with options are passed.
#Could have used features like <srilm>on but getting these to apply only to linking was ugly and it still didn't trigger an install (since the install path doesn't encode features).
#Everything below is a kludge to force rebuilding if different --with options
#are passed. Could have used features like <srilm>on but getting these to
#apply only to linking was ugly and it still didn't trigger an install (since
#the install path doesn't encode features). It stores a file lm.log with the
#previous options and forces a rebuild if the current options differ.
path-constant LM-LOG : bin/lm.log ;
#Is there no other way to read a file with bjam?
local previous = none ;