-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
31 lines (27 loc) · 808 Bytes
/
setup.py
File metadata and controls
31 lines (27 loc) · 808 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
26
27
28
29
30
31
import os
import glob
from setuptools import setup
from torch.utils.cpp_extension import CppExtension, BuildExtension
current_dir = os.path.dirname(os.path.abspath(__file__))
c_sources = glob.glob(os.path.join(current_dir, "src/**/*.c"), recursive=True)
sources = ["bitsqueeze_pytorch.cpp"] + c_sources
# Define compile flags
extra_compile_args = ['-O3', '-fopenmp', '-fPIC']
extra_link_args = ['-fopenmp']
setup(
name='bitsqueeze',
ext_modules=[
CppExtension(
name='bitsqueeze',
sources=sources,
include_dirs=[
os.path.join(current_dir, "include"),
],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
],
cmdclass={
'build_ext': BuildExtension
}
)