from distutils.core import setup from distutils.extension import Extension import re INC = ['..', 'cdec/', '../decoder', '../utils', '../mteval'] LIB = ['../decoder', '../utils', '../mteval', '../training/utils', '../klm/lm', '../klm/util', '../klm/util/double-conversion', '../klm/search'] # Set automatically by configure LIBS = re.findall('-l([^\s]+)', '@LIBS@') CPPFLAGS = re.findall('-[^\s]+', '@CPPFLAGS@ @CXXFLAGS@') LDFLAGS = re.findall('-[^\s]+', '@LDFLAGS@') ext_modules = [ Extension(name='cdec._cdec', sources=['cdec/_cdec.cpp'], include_dirs=INC, library_dirs=LIB, libraries=['cdec', 'utils', 'mteval', 'training_utils', 'klm', 'klm_util', 'klm_util_double', 'ksearch'] + LIBS, extra_compile_args=CPPFLAGS, extra_link_args=LDFLAGS), Extension(name='cdec.sa._sa', sources=['cdec/sa/_sa.cpp', 'cdec/sa/strmap.cc'], extra_compile_args=CPPFLAGS) ] setup( name='cdec', ext_modules=ext_modules, packages=['cdec', 'cdec.sa'] )