-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
88 lines (80 loc) · 2.54 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import glob
import os
import torch
from setuptools import find_packages, setup
from torch.utils.cpp_extension import (
CUDA_HOME,
BuildExtension,
CppExtension,
CUDAExtension,
)
def get_extensions():
"""Refer to torchvision."""
main_file = [os.path.join("src", "pybind.cpp")]
source_cuda = glob.glob(os.path.join("src", "*.cu"))
sources = main_file
extension = CppExtension
define_macros = []
extra_compile_args = {}
if (torch.cuda.is_available() and (CUDA_HOME is not None)) or os.getenv(
"FORCE_CUDA", "0"
) == "1":
extension = CUDAExtension
sources += source_cuda
define_macros += [("WITH_CUDA", None)]
nvcc_flags = os.getenv("NVCC_FLAGS", "")
if nvcc_flags == "":
nvcc_flags = ["-O3"]
else:
nvcc_flags = nvcc_flags.split(" ")
extra_compile_args = {
"cxx": ["-O3"],
"nvcc": nvcc_flags,
}
sources = [s for s in sources]
include_dirs = ["src"]
print("sources:", sources)
ext_modules = [
extension(
"diso._C",
sources,
include_dirs=include_dirs,
define_macros=define_macros,
extra_compile_args=extra_compile_args,
)
]
return ext_modules
setup(
name="diso",
version="0.1.4",
author_email="xiwei@ucsd.edu",
keywords="differentiable iso-surface extraction",
description="Differentiable Iso-Surface Extraction Package",
classifiers=[
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Other Audience",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Framework :: Robot Framework :: Tool",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
],
license="CC BY-NC 4.0",
packages=find_packages(exclude=["tests"]),
python_requires=">=3.6",
install_requires=["trimesh"],
ext_modules=get_extensions(),
cmdclass={
"build_ext": BuildExtension.with_options(no_python_abi_suffix=True),
},
zip_safe=False
)