mosesdecoder/Jamroot
Barry Haddow 7b472960b1 Move projects from top level to contrib
server build probably broken
2011-11-23 14:48:50 +00:00

122 lines
3.5 KiB
Plaintext

#MOSES BUILD OPTIONS
#
#Language models
#--with-irstlm=/path/to/irstlm
#--with-srilm=/path/to/srilm
#--with-randlm=/path/to/randlm
#KenLM is always compiled.
#
#--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.
#
#--notrace compiles without TRACE macros
#
#--install=/path/to/install sets the install directory (default dist).
#--git appends the git revision to the install directory name.
#
# 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 linking (default static)
#
# debug-symbols=on|off include (default) or exclude debugging
# information also known as -g
#
#
#Controlling the build process:
#-a to build from scratch
#-j$NCPUS to compile in parallel
#--clean to clean
path-constant TOP : . ;
import option ;
import boost ;
boost.use-project ;
#If boost static libraries are not installed, use dynamic linking.
if [ SHELL $(TOP)"/jam-files/test.sh -static -lboost_program_options" ] != 0 {
force-boost-link = "<link>shared" ;
}
#Convenience rule for boost libraries. Defines library boost_$(name).
rule boost_lib ( name ) {
alias boost_$(name) : /boost//$(name) : $(force-boost-link) ;
}
boost_lib thread ;
boost_lib program_options ;
boost_lib unit_test_framework ;
#Link normally to a library, but sometimes static isn't installed so fall back to dynamic.
rule external_lib ( name ) {
if [ SHELL $(TOP)"/jam-files/test.sh -static -l"$(name) ] != 0 {
lib $(name) : : <link>shared ;
} else {
lib $(name) ;
}
}
external_lib z ;
#libSegFault prints a stack trace on segfault. Link against it if available.
if [ SHELL $(TOP)"/jam-files/test.sh -lSegFault" ] = 0 {
external_lib SegFault ;
segfault = <library>SegFault ;
}
trace = [ option.get "notrace" : <define>TRACE_ENABLE=1 ] ;
project : default-build
<threading>multi
<warnings>on
<debug-symbols>on
<variant>release
<link>static
;
project : requirements
<threading>multi:<define>WITH_THREADS
<threading>multi:<library>boost_thread
$(segfault)
<define>_FILE_OFFSET_BITS=64 <define>_LARGE_FILES
$(trace)
;
#Add directories here if you want their incidental targets too (i.e. tests).
build-project lm ;
build-project util ;
#Trigger instllation into legacy paths.
build-project moses-cmd/src ;
build-project moses-chart-cmd/src ;
install-location = [ option.get "install" : $(TOP)/dist ] ;
# Shell with trailing line removed http://lists.boost.org/boost-build/2007/08/17051.php
rule trim-nl ( str ) {
return [ MATCH "([^
]*)" : $(str) ] ;
}
rule _shell ( cmd ) {
return [ trim-nl [ SHELL $(cmd) ] ] ;
}
if [ option.get "git" : : "yes" ] {
install-tag = [ _shell "git rev-parse --verify HEAD |head -c 7" ] ;
install-location = $(install-location).$(install-tag) ;
}
install dist :
lm//query
lm//build_binary
moses-chart-cmd/src//moses_chart
moses-cmd/src//programs
CreateOnDisk/src//CreateOnDisk
mert//programs
contrib/server//mosesserver
misc//programs
: <location>$(install-location) <install-type>EXE <install-dependencies>on <link>shared:<dll-path>$(install-location) <link>shared:<install-type>LIB ;