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-30 12:53:13 +0400
committerKenneth Heafield <github@kheafield.com>2011-11-30 12:53:13 +0400
commit74512699232c31f2d37f3dfff0b63fd222e333c0 (patch)
treea7c3172d9c5de7ad9f891af7edc15e8a8d48d5bd /contrib
parent17f8ab23b7a724fb0ba5f90a723218918b1783ff (diff)
More error checking for moses server
Diffstat (limited to 'contrib')
-rw-r--r--contrib/server/Jamfile18
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/server/Jamfile b/contrib/server/Jamfile
index 2978dc4d6..b2f5b3f80 100644
--- a/contrib/server/Jamfile
+++ b/contrib/server/Jamfile
@@ -1,11 +1,15 @@
-#If you get compilation errors here, make sure you have xmlrpc-c installed properly. . .
+#If you get compilation errors here, make sure you have xmlrpc-c installed properly, including the abyss server option.
import option ;
+import path ;
with-xmlrpc-c = [ option.get "with-xmlrpc-c" ] ;
if $(with-xmlrpc-c) {
build-moses-server = true ;
shell-prefix = $(with-xmlrpc-c)/bin/ ;
+ if ! [ path.exists $(shell-prefix)xmlrpc-c-config ] {
+ exit Could not find $(shell-prefix)xmlrpc-c-config : 1 ;
+ }
} else {
if [ SHELL $(TOP)"/jam-files/test.sh -include xmlrpc-c/base.hpp -lxmlrpc_server_abyss++" ] = 0 {
build-moses-server = true ;
@@ -13,10 +17,18 @@ if $(with-xmlrpc-c) {
shell-prefix = "" ;
}
+rule shell_or_die ( cmd ) {
+ local ret = [ _shell $(cmd) : exit-status ] ;
+ if $(ret[2]) != 0 {
+ exit "Failed to run $(cmd)" : 1 ;
+ }
+ return $(ret[1]) ;
+}
+
if $(build-moses-server) = true
{
- xmlrpc-linkflags = [ _shell "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --libs" ] ;
- xmlrpc-cxxflags = [ _shell "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --cflags" ] ;
+ xmlrpc-linkflags = [ shell_or_die "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --libs" ] ;
+ xmlrpc-cxxflags = [ shell_or_die "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --cflags" ] ;
exe mosesserver : mosesserver.cpp ../../moses/src//moses ../../OnDiskPt/src//OnDiskPt : <linkflags>$(xmlrpc-linkflags) <cxxflags>$(xmlrpc-cxxflags) ;
} else {