diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-08-10 23:58:41 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-08-10 23:58:41 -0400 |
commit | b2f4aef72ed5eddca9d47a38cfd1e845bbad5ffb (patch) | |
tree | 1588172c46dea9cd12b9768edbae5a37ab683903 /python/setup.py | |
parent | 4a0a5980cf81ea0764911845c016bf314f535848 (diff) |
autogenerate setup.py
Diffstat (limited to 'python/setup.py')
-rw-r--r-- | python/setup.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/python/setup.py b/python/setup.py deleted file mode 100644 index 54510024..00000000 --- a/python/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -import sys -import re - -def fail(msg): - sys.stderr.write(msg) - sys.exit(1) - -INC = ['..', 'src/', '../decoder', '../utils', '../mteval'] -LIB = ['../decoder', '../utils', '../mteval', '../training', '../klm/lm', '../klm/util'] - -try: - with open('../config.status') as config: - config = config.read() - subs = dict(re.findall('s,@(\w+)@,\|#_!!_#\|(.*),g', config)) # sed - if not subs: - subs = dict(re.findall('S\["(\w+)"\]="(.*)"', config)) # awk - if not subs: - fail('Cannot parse config.status\n' - 'Please report this bug to the developers') - LIBS = re.findall('-l([^\s]+)', subs['LIBS']) - CPPFLAGS = re.findall('-[^R][^\s]+', subs['CPPFLAGS']) - LDFLAGS = re.findall('-[^\s]+', subs['LDFLAGS']) - LDFLAGS = [opt.replace('-R', '-Wl,-rpath,') for opt in LDFLAGS] -except IOError: - fail('Did you run ./configure? Cannot find config.status') -except KeyError as e: - fail('Cannot find option {0} in config.status'.format(e)) - -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'], - 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'} -) |