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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2011-11-25 19:48:21 +0400
committerKenneth Heafield <github@kheafield.com>2011-11-25 19:48:21 +0400
commit0a7608406c070f7272a766010f7f63dfd3aa7971 (patch)
tree985044f5890b5953aa701048cb3e487c3f29ec6b /scripts
parent8100d587c7b282943ad3ab3798e665db55d14243 (diff)
Allow scripts to compile without GIZA
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Jamfile46
-rw-r--r--scripts/training/Jamfile12
2 files changed, 32 insertions, 26 deletions
diff --git a/scripts/Jamfile b/scripts/Jamfile
index c20827bd8..8b79af84d 100644
--- a/scripts/Jamfile
+++ b/scripts/Jamfile
@@ -1,6 +1,7 @@
#MOSES SCRIPTS INSTRUCTIONS
#
-#--bindir=/path/to/bindir where GIZA++ binaries live
+#--with-giza=/path/to/giza where GIZA++ binaries GIZA++, snt2cooc.out, and
+# mkcls live.
#
#--install=/path/to/install to set a path to install (default dist)
#--git appends the git revision to the install directory
@@ -16,24 +17,6 @@ build-project training ;
location = [ option.get "install" : $(TOP)/scripts/dist ] ;
location = $(location)$(GITTAG) ;
-bindir = [ option.get "bindir" ] ;
-if ! $(bindir) {
- echo "Pass --bindir=/path/to/bindir" ;
- echo "It should contain GIZA++, snt2cooc.out, and mkcls." ;
- echo "These are available from http://www.fjoch.com/GIZA++.html and" ;
- echo "http://www-i6.informatik.rwth-aachen.de/Colleagues/och/software/mkcls.html ." ;
- exit : 1 ;
-}
-rule check-for-bin ( name ) {
- if ! [ FILE_OPEN $(bindir)/$(name) : "r" ] {
- exit "Did not find $(bindir)/$(name)." : 1 ;
- }
-}
-check-for-bin GIZA++ ;
-check-for-bin snt2cooc.out ;
-check-for-bin mkcls ;
-constant BINDIR : $(bindir) ;
-
#These two used to live in a tools directory.
install ghkm : training/phrase-extract/extract-ghkm//extract-ghkm : <location>$(location)/training/phrase-extract/extract-ghkm/tools ;
install compactify : training/compact-rule-table//compactify : <location>$(location)/training/compact-rule-table/tools ;
@@ -42,7 +25,29 @@ install phrase-extract : training/phrase-extract//released-programs : <location>
install lexical-reordering : training/lexical-reordering//score : <location>$(location)/training/lexical-reordering ;
install symal : training/symal//symal : <location>$(location)/symal ;
-install train-model : training//train-model.perl : <location>$(location)/training ;
+with-giza = [ option.get "with-giza" ] ;
+if $(with-giza) {
+ rule check-for-bin ( name ) {
+ if ! [ FILE_OPEN $(with-giza)/$(name) : "r" ] {
+ echo "Did not find "$(with-giza)/$(name)"." ;
+ echo "The with-giza directory should contain GIZA++, snt2cooc.out, and mkcls." ;
+ echo "These are available from http://www.fjoch.com/GIZA++.html and" ;
+ echo "http://www-i6.informatik.rwth-aachen.de/Colleagues/och/software/mkcls.html ." ;
+ exit : 1 ;
+ }
+ }
+
+ constant WITH-GIZA : $(with-giza) ;
+
+ check-for-bin GIZA++ ;
+ check-for-bin snt2cooc.out ;
+ check-for-bin mkcls ;
+
+ install train-model : training//train-model.perl : <location>$(location)/training ;
+} else {
+ echo "If you want training/train-model.perl, pass --with-giza=/path/to/giza" ;
+ constant WITH-GIZA : "no" ;
+}
install scripts :
analysis/README
@@ -98,7 +103,6 @@ install scripts :
generic/multi-bleu.perl
generic/qsub-wrapper.pl
README
- released-files
tokenizer/detokenizer.perl
tokenizer/tokenizer.perl
tokenizer/lowercase.perl
diff --git a/scripts/training/Jamfile b/scripts/training/Jamfile
index 2de16d05c..26cec5a1d 100644
--- a/scripts/training/Jamfile
+++ b/scripts/training/Jamfile
@@ -3,9 +3,11 @@ build-project phrase-extract ;
build-project lexical-reordering ;
build-project symal ;
-make train-model.perl : train-model.perl.missing_bin_dir : @missing_bin_dir ;
-actions missing_bin_dir {
- sed 's#^my \$BINDIR\s*=.*#my\ \$BINDIR=\"$(BINDIR)\";#' $(>) >$(<)
-}
+if $(WITH-GIZA) != no {
+ make train-model.perl : train-model.perl.missing_bin_dir : @missing_bin_dir ;
+ actions missing_bin_dir {
+ sed 's#^my \$BINDIR\s*=.*#my\ \$BINDIR=\"$(WITH-GIZA)\";#' $(>) >$(<)
+ }
-install legacy : train-model.perl : <location>. ;
+ install legacy : train-model.perl : <location>. ;
+}