summaryrefslogtreecommitdiff
path: root/python/setup.py.in
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-11-05 15:29:46 +0100
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-11-05 15:29:46 +0100
commit6f29f345dc06c1a1033475eac1d1340781d1d603 (patch)
tree6fa4cdd7aefd7d54c9585c2c6274db61bb8b159a /python/setup.py.in
parentb510da2e562c695c90d565eb295c749569c59be8 (diff)
parentc615c37501fa8576584a510a9d2bfe2fdd5bace7 (diff)
merge upstream/master
Diffstat (limited to 'python/setup.py.in')
-rw-r--r--python/setup.py.in33
1 files changed, 33 insertions, 0 deletions
diff --git a/python/setup.py.in b/python/setup.py.in
new file mode 100644
index 00000000..f191ef8b
--- /dev/null
+++ b/python/setup.py.in
@@ -0,0 +1,33 @@
+from distutils.core import setup
+from distutils.extension import Extension
+import re
+
+INC = ['..', 'src/', '../decoder', '../utils', '../mteval']
+LIB = ['../decoder', '../utils', '../mteval', '../training', '../klm/lm', '../klm/util', '../klm/search']
+
+# Set automatically by configure
+LIBS = re.findall('-l([^\s]+)', '@LIBS@')
+CPPFLAGS = re.findall('-[^\s]+', '@CPPFLAGS@')
+LDFLAGS = re.findall('-[^\s]+', '@LDFLAGS@')
+# Make sure linker flags go only to the linker
+LDFLAGS = [opt.replace('-R', '-Wl,-rpath,') for opt in LDFLAGS]
+
+ext_modules = [
+ Extension(name='cdec._cdec',
+ sources=['src/_cdec.cpp'],
+ include_dirs=INC,
+ library_dirs=LIB,
+ libraries=LIBS + ['z', 'cdec', 'utils', 'mteval', 'training', 'klm', 'klm_util', 'ksearch'],
+ extra_compile_args=CPPFLAGS,
+ extra_link_args=LDFLAGS),
+ Extension(name='cdec.sa._sa',
+ sources=['src/sa/_sa.c', 'src/sa/strmap.cc'])
+]
+
+setup(
+ name='cdec',
+ ext_modules=ext_modules,
+ requires=['configobj'],
+ packages=['cdec', 'cdec.sa'],
+ package_dir={'': 'pkg'}
+)