summaryrefslogtreecommitdiff
path: root/python/setup.py
blob: cc8b289dad8a452af279093f774a5a80ec70500e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os

INC = ['..', 'src/', '../decoder', '../utils', '../mteval']
LIB = ['../decoder', '../utils', '../mteval', '../training', '../klm/lm', '../klm/util']

BOOST_ROOT = os.getenv('BOOST_ROOT')
if BOOST_ROOT:
    INC.append(os.path.join(BOOST_ROOT, 'include/'))
    LIB.append(os.path.join(BOOST_ROOT, 'lib/'))

ext_modules = [
    Extension(name='_cdec',
        sources=['src/_cdec.pyx'],
        language='C++', 
        include_dirs=INC,
        library_dirs=LIB,
        libraries=['boost_program_options-mt', 'z',
                   'cdec', 'utils', 'mteval', 'training', 'klm', 'klm_util'],
        extra_compile_args=['-DHAVE_CONFIG_H']),
]

setup(
    name='cdec',
    cmdclass={'build_ext': build_ext},
    ext_modules=ext_modules,
    packages=['cdec', 'cdec.scfg']
)