-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
34 lines (31 loc) · 946 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
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
import glob
# build clib
_ext_src_root = "fairnr/clib"
_ext_sources = glob.glob("{}/src/*.cpp".format(_ext_src_root)) + glob.glob(
"{}/src/*.cu".format(_ext_src_root)
)
_ext_headers = glob.glob("{}/include/*".format(_ext_src_root))
setup(
name='fairnr',
ext_modules=[
CUDAExtension(
name='fairnr.clib._ext',
sources=_ext_sources,
extra_compile_args={
"cxx": ["-O2", "-I{}".format("{}/include".format(_ext_src_root))],
"nvcc": ["-O2", "-I{}".format("{}/include".format(_ext_src_root))],
},
)
],
cmdclass={
'build_ext': BuildExtension
},
entry_points={
'console_scripts': [
'fairnr-render = fairnr_cli.render:cli_main',
'fairnr-train = fairseq_cli.train:cli_main'
],
},
)