forked from kamo-naoyuki/python_kaldi_edit_distance
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
24 lines (19 loc) · 648 Bytes
/
setup.py
File metadata and controls
24 lines (19 loc) · 648 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
from setuptools import setup
from distutils.extension import Extension
from setuptools import Command
import os.path
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
ext = '.pyx' if USE_CYTHON else '.cpp'
cwd = os.path.abspath(os.path.dirname(__file__))
extensions =\
[Extension(name='kaldi_edit_distance._edit_distance',
sources=['kaldi_edit_distance/_edit_distance' + ext],
include_dirs=[],
extra_compile_args=['-O3'])]
if USE_CYTHON:
extensions = cythonize(extensions)
setup(name='kaldi_edit_distance', ext_modules=extensions)