forked from parlance/ctcdecode
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
37 lines (32 loc) · 902 Bytes
/
setup.py
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
31
32
33
34
35
36
37
#!/usr/bin/env python
import os
import sys
from distutils.core import setup
from torch.utils.ffi import create_extension
sources = ['src/cpu_binding.cpp']
headers = ['src/cpu_binding.h']
ffi = create_extension(
name='ctc_decode',
language='c++',
headers=headers,
sources=sources,
with_cuda=False,
extra_compile_args=['-std=c++11', '-fPIC']
)
ffi = ffi.distutils_extension()
ffi.name = 'pytorch_ctc._ctc_decode'
setup(
name="pytorch_ctc",
version="0.1",
description="CTC Decoder for PyTorch based on TensorFlow's implementation",
url="https://github.com/ryanleary/pytorch-ctc-decode",
author="Ryan Leary",
author_email="ryanleary@gmail.com",
# Require cffi.
install_requires=["cffi>=1.0.0"],
setup_requires=["cffi>=1.0.0"],
# Exclude the build files.
packages=["pytorch_ctc"],
# Extensions to compile.
ext_modules=[ffi]
)