| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| import os ; |
| import option ; |
| import modules ; |
| import path ; |
| path-constant TOP : . ; |
|
|
| include $(TOP)/jam-files/sanity.jam ; |
|
|
| home = [ os.environ "HOME" ] ; |
| if [ path.exists $(home)/moses-environment.jam ] |
| { |
| # for those of use who don't like typing in command line bjam options all day long |
| include $(home)/moses-environment.jam ; |
| } |
| include $(TOP)/jam-files/check-environment.jam ; # get resource locations |
| # from environment variables |
| include $(TOP)/jam-files/xmlrpc-c.jam ; # xmlrpc-c stuff for the server |
| # include $(TOP)/jam-files/curlpp.jam ; # curlpp stuff for bias lookup (MMT only) |
| |
| # exit "done" : 0 ; |
| |
| max-order = [ option.get "max-kenlm-order" : 6 : 6 ] ; |
| if ! [ option.get "max-kenlm-order" ] |
| { |
| # some classes in Moses pull in header files from KenLM, so this needs to be |
| # defined here, not in moses/lm/Jamfile |
| option.set "max-kenlm-order" : 6 ; |
| requirements += <define>KENLM_MAX_ORDER=$(max-order) ; |
| } |
| # exit "all done" : 0 ; |
| |
| boost 104400 ; |
| external-lib z ; |
| |
| #lib dl : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ; |
| #requirements += <library>dl ; |
| requirements += <cxxflags>-std=c++0x ; |
| |
| # Allow moses to report the git commit hash of the version used for compilation |
| moses_githash = [ _shell "git describe --dirty" ] ; |
| requirements += <define>MOSES_VERSION_ID=\\\"$(moses_githash)\\\" ; |
| |
| 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 "filter-warnings" : : "yes" ] { |
| # given the low coding standards in Moses, we may want to filter out |
| # warnings about poor coding practice that no-one is ever going to fix |
| # anyway ... |
| requirements += <cxxflags>-Wno-deprecated ; |
| requirements += <cxxflags>-Wno-reorder ; |
| requirements += <cxxflags>-Wno-sign-compare ; |
| requirements += <cxxflags>-Wno-unused-but-set-variable ; |
| requirements += <cxxflags>-Wno-unused-result ; |
| requirements += <cxxflags>-Wno-unused-variable ; |
| requirements += <cxxflags>-Wno-comment ; |
| requirements += <cxxflags>-Wno-strict-aliasing ; |
| requirements += <cxxflags>-Wno-overloaded-virtual ; |
| } |
| |
| if [ option.get "debug-build" : : "yes" ] { |
| requirements += <cxxflags>-Og ; |
| echo "Building with -Og to enable easier profiling and debugging. Only available on gcc 4.8+." ; |
| } |
| |
| if [ option.get "with-address-sanitizer" : : "yes" ] { |
| requirements += <cxxflags>-fsanitize=address ; |
| requirements += <cxxflags>-fno-omit-frame-pointer ; |
| requirements += <linkflags>-fsanitize=address ; |
| echo "Building with AddressSanitizer to enable debugging of memory errors. Only available on gcc 4.8+." ; |
| } |
| |
| 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 ; |
| } |
| |
| mmt = [ option.get "mmt" ] ; |
| if $(mmt) { |
| requirements += <define>MMT ; |
| requirements += <include>$(mmt) ; |
| mmt_githash = [ _shell "cd $(mmt) && git describe --dirty" ] ; |
| requirements += <define>MMT_VERSION_ID=\\\"$(mmt_githash)\\\" ; |
| } |
| |
| 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-oxlm" ] { |
| external-lib gomp ; |
| requirements += <library>boost_serialization ; |
| requirements += <library>gomp ; |
| } |
| |
| if [ option.get "with-cmph" : : "yes" ] { |
| requirements += <define>HAVE_CMPH ; |
| } |
| |
| if [ option.get "with-icu" : : "yes" ] |
| { |
| external-lib icuuc ; |
| external-lib icuio ; |
| external-lib icui18n ; |
| requirements += <library>icuuc/<link>shared ; |
| requirements += <library>icuio/<link>shared ; |
| requirements += <library>icui18n/<link>shared ; |
| requirements += <cxxflags>-fPIC ; |
| requirements += <address-model>64 ; |
| |
| } |
|
|
| |
| external-lib boost_serialization ; |
| requirements += <library>boost_serialization/<runtime-link>static ; |
|
|
| if [ option.get "with-vw" ] { |
| requirements += <define>HAVE_VW ; |
| } |
| |
| project : default-build |
| <threading>multi |
| <warnings>on |
| <debug-symbols>off |
| <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 |
| <library>boost_program_options |
| <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 phrase-extract/syntax-common search moses moses/LM mert moses-cmd scripts regression-testing ; |
| # contrib/mira |
| |
| if [ option.get "with-mm-extras" : : "yes" ] |
| { |
| alias mm-extras : |
| moses/TranslationModel/UG//bitext-find |
| moses/TranslationModel/UG//ptable-describe-features |
| moses/TranslationModel/UG//count-ptable-features |
| moses/TranslationModel/UG//ptable-sigtest-filter |
| moses/TranslationModel/UG//ptable-lookup |
| moses/TranslationModel/UG//ptable-lookup-corpus |
| moses/TranslationModel/UG//check-coverage |
| moses/TranslationModel/UG/mm//mtt-demo1 |
| moses/TranslationModel/UG/mm//mtt-dump |
| moses/TranslationModel/UG/mm//mam2symal |
| moses/TranslationModel/UG/mm//mam_verify |
| 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-extras ; |
| } |
|
|
| if [ option.get "with-mm" : : "yes" ] |
| { |
| alias mm : |
| moses/TranslationModel/UG/mm//mtt-build |
| moses/TranslationModel/UG/mm//symal2mam |
| moses/TranslationModel/UG/mm//mmlex-build |
| ; |
| } |
| else |
| { |
| alias mm ; |
| } |
|
|
| if [ option.get "with-rephraser" : : "yes" ] |
| { |
| alias rephraser : |
| contrib/rephraser//paraphrase |
| ; |
| } |
| else |
| { |
| alias rephraser ; |
| } |
|
|
| alias programs : |
| lm//programs |
| 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 |
| phrase-extract//extract-mixed-syntax |
| phrase-extract//score-stsg |
| phrase-extract//filter-rule-table |
| phrase-extract//postprocess-egret-forests |
| biconcor |
| |
| contrib/server//mosesserver |
| mm |
| mm-extras |
| rephraser |
| contrib/c++tokenizer//tokenizer |
| contrib/expected-bleu-training//train-expected-bleu |
| contrib/expected-bleu-training//prepare-expected-bleu-training |
|
|
| probingpt//programs |
| moses2//programs |
| ; |
|
|
|
|
| install-bin-libs programs ; |
| install-headers headers-base : [ path.glob-tree biconcor contrib lm mert misc 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 ; |
| } |
| |
| #local temp = [ _shell "bash source ./s.sh" ] ; |
| local temp = [ _shell "mkdir -p $(PREFIX)/bin" ] ; |
| local temp = [ _shell "rm -f $(PREFIX)/bin/moses_chart" ] ; |
| local temp = [ _shell "cd $(PREFIX)/bin && ln -sf moses moses_chart" ] ; |
| local temp = [ _shell "cd $(PREFIX)/bin && ln -sf CreateProbingPT CreateProbingPT2" ] ; |
| |
| |