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

Jamfile « LM « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2f3cde8ef573d622ebfb2dad782ea86da4cc9791 (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
import option path build-system ;

local dependencies = ;

local with-irstlm = [ option.get "with-irstlm" ] ;
if $(with-irstlm) {
  lib irstlm : : <search>$(with-irstlm)/lib ;
  obj IRST.o : IRST.cpp ..//headers : <include>$(with-irstlm)/include ;
  alias irst : IRST.o irstlm : : : <define>LM_IRST ;
  dependencies += irst ;
  echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
  echo "!!! You are linking the IRSTLM library; be sure the release is >= 5.70.02 !!!" ;
  echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
}

local with-srilm = [ option.get "with-srilm" ] ;
if $(with-srilm) {
  if [ option.get "with-srilm-dynamic" : no : yes ] = yes {
    alias sri-libs : srilm ;
  } else {
    sri-arch = [ option.get "with-srilm-arch" ] ;
    sri-arch ?= [ _shell $(with-srilm)/sbin/machine-type ] ;
    sri-lib = <search>$(with-srilm)/lib/$(sri-arch) <search>$(with-srilm)/flm/obj/$(sri-arch) ;

    lib flm : : $(sri-lib) ;
    lib misc : flm : $(sri-lib) ;
    lib dstruct : misc flm : $(sri-lib) ;
    lib oolm : dstruct misc flm : $(sri-lib) ;

    alias sri-libs : oolm dstruct misc flm ;
  }

  obj SRI.o : SRI.cpp ..//headers : <include>$(with-srilm)/include <warnings>off ;
  obj ParallelBackoff.o : ParallelBackoff.cpp ..//headers : <include>$(with-srilm)/include <warnings>off ;
  alias sri : SRI.o ParallelBackoff.o sri-libs : : : <define>LM_SRI ;
  dependencies += sri ;
}

local with-randlm = [ option.get "with-randlm" ] ;
if $(with-randlm) {
  lib randlm : : <search>$(with-randlm)/lib ;
  obj Rand.o : Rand.cpp randlm ..//headers : <include>$(with-randlm)/include ;
  alias rand : Rand.o : : : <define>LM_RAND ;
  dependencies += rand ;
}

obj Factory.o : Factory.cpp ..//headers $(dependencies) ;

lib LM : Base.cpp Factory.o Implementation.cpp Joint.cpp Ken.cpp MultiFactor.cpp Remote.cpp SingleFactor.cpp 
  ../../../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).  
path-constant LM-LOG : bin/lm.log ;
#Is there no other way to read a file with bjam?  
local previous = none ;
if [ path.exists $(LM-LOG) ] {
  previous = [ _shell "cat $(LM-LOG)" ] ;
}
current = "" ;
for local i in srilm irstlm randlm {
  local optval = [ option.get "with-$(i)" ] ;
  if $(optval) {
    current = "$(current) --with-$(i)=$(optval)" ;
  }
}

if $(current) != $(previous) {
  #Write inconsistent while the build is running
  if [ path.exists $(LM-LOG) ] {
    local ignored = @($(LM-LOG):E=inconsistent) ;
  }
  #Write $(current) to $(LM-LOG) after the build completes.  
  rule post-build ( ok ? ) {
    if $(ok) {
      local ignored = @($(LM-LOG):E=$(current)) ;
    }
  }
  IMPORT $(__name__) : post-build : : $(__name__).post-build ;
  build-system.set-post-build-hook $(__name__).post-build ;

  always Factory.o ;
  always LM ;
}