summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2013-11-10 01:23:56 -0500
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2013-11-10 01:23:56 -0500
commite974e1dd835bd7995dca720bba1ce0ab09f6fe54 (patch)
tree635eaf10f248132a93b0589c8a87e00a011f9819
parent4bdb3451dc6c005a5356844435c098bb14dae6a8 (diff)
small fixes
-rw-r--r--decoder/ff_external.cc2
-rw-r--r--python/cdec/sa/compile.py13
2 files changed, 8 insertions, 7 deletions
diff --git a/decoder/ff_external.cc b/decoder/ff_external.cc
index dea0e20f..6ee4b2cf 100644
--- a/decoder/ff_external.cc
+++ b/decoder/ff_external.cc
@@ -19,7 +19,7 @@ ExternalFeature::ExternalFeature(const string& param) {
cerr << "External requires a path to a dynamic library!\n";
abort();
}
- lib_handle = dlopen(file.c_str(), RTLD_LAZY);
+ lib_handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_GLOBAL);
if (!lib_handle) {
cerr << "dlopen reports: " << dlerror() << endl;
cerr << "Did you provide a full path to the dynamic library?\n";
diff --git a/python/cdec/sa/compile.py b/python/cdec/sa/compile.py
index d4cd8387..caa93f8b 100644
--- a/python/cdec/sa/compile.py
+++ b/python/cdec/sa/compile.py
@@ -75,6 +75,13 @@ def main():
a_bin = os.path.join(args.output, 'a.bin')
lex_bin = os.path.join(args.output, 'lex.bin')
+ config = cdec.configobj.ConfigObj(args.config, unrepr=True)
+ config['f_sa_file'] = os.path.abspath(f_sa_bin)
+ config['e_file'] = os.path.abspath(e_bin)
+ config['a_file'] = os.path.abspath(a_bin)
+ config['lex_file'] = os.path.abspath(lex_bin)
+ config['precompute_file'] = os.path.abspath(precomp_bin)
+
start_time = monitor_cpu()
logger.info('Compiling source suffix array')
if args.bitext:
@@ -116,12 +123,6 @@ def main():
logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time)
# Write configuration
- config = cdec.configobj.ConfigObj(args.config, unrepr=True)
- config['f_sa_file'] = os.path.abspath(f_sa_bin)
- config['e_file'] = os.path.abspath(e_bin)
- config['a_file'] = os.path.abspath(a_bin)
- config['lex_file'] = os.path.abspath(lex_bin)
- config['precompute_file'] = os.path.abspath(precomp_bin)
for name, value in zip(param_names, params):
config[name] = value
config.write()