-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
47 lines (36 loc) · 1.26 KB
/
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
38
39
40
41
42
43
44
45
46
47
import os.path as osp
from glob import glob
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
extension_dir = "vision3d/csrc"
def get_sources():
sources = []
sources += glob(osp.join(extension_dir, "cpu", "*", "*.cpp"))
sources += glob(osp.join(extension_dir, "cuda", "*", "*.cpp"))
sources += glob(osp.join(extension_dir, "cuda", "*", "*.cu"))
sources += glob(osp.join(extension_dir, "pybind.cpp"))
return sources
def get_include_dirs():
include_dirs = []
include_dirs.append(osp.abspath(osp.join(extension_dir, "external", "eigen3")))
include_dirs.append(osp.abspath(osp.join(extension_dir, "external", "nanoflann")))
include_dirs.append(osp.abspath(osp.join(extension_dir, "common")))
return include_dirs
def get_requirements():
with open("requirements.txt", "r") as f:
lines = f.readlines()
requirements = [line.strip() for line in lines]
return requirements
setup(
name="vision3d",
version="2.0.1",
install_requires=get_requirements(),
ext_modules=[
CUDAExtension(
name="vision3d.ext",
sources=get_sources(),
include_dirs=get_include_dirs(),
),
],
cmdclass={"build_ext": BuildExtension},
)