-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
25 lines (21 loc) · 666 Bytes
/
setup.py
File metadata and controls
25 lines (21 loc) · 666 Bytes
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
from distutils.core import setup
from distutils.extension import Extension
import glob
import platform
FILES = glob.glob('util/*.cc') + glob.glob('lm/*.cc') + glob.glob('util/double-conversion/*.cc')
FILES = [fn for fn in FILES if not (fn.endswith('main.cc') or fn.endswith('test.cc'))]
LIBS = ['z', 'stdc++']
if platform.system() != 'Darwin':
LIBS.append('rt')
ext_modules = [
Extension(name='kenlm',
sources=FILES + ['python/kenlm.cpp'],
language='C++',
include_dirs=['.'],
libraries=LIBS,
extra_compile_args=['-O3', '-DNDEBUG', '-DKENLM_MAX_ORDER=6'])
]
setup(
name='kenlm',
ext_modules=ext_modules
)