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
commit1db70a45d59946560fbd5db6487b55a8674ef973 (patch)
tree172585dafe4d1462f22d8200e733d52dddb55b1e /python/setup.py.in
parent4dd5216d3afa9ab72b150e250a3c30a5f223ce53 (diff)
parent6bbf03ac46bd57400aa9e65a321a304a234af935 (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'}
+)