Spaces:
Sleeping
Sleeping
pablovela5620
commited on
Upload setup.py with huggingface_hub
Browse files
setup.py
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import os.path as osp
|
3 |
+
from setuptools import setup, find_packages
|
4 |
+
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
5 |
+
|
6 |
+
ROOT = osp.dirname(osp.abspath(__file__))
|
7 |
+
|
8 |
+
# Read the EIGEN_INCLUDE_DIR environment variable
|
9 |
+
eigen_include_dir = os.environ.get("EIGEN_INCLUDE_DIR")
|
10 |
+
if eigen_include_dir is None:
|
11 |
+
raise EnvironmentError(
|
12 |
+
"EIGEN_INCLUDE_DIR environment variable is not set. "
|
13 |
+
"Please set it to the path of Eigen's include directory."
|
14 |
+
)
|
15 |
+
|
16 |
+
|
17 |
+
setup(
|
18 |
+
name="mini_dpvo",
|
19 |
+
packages=find_packages(include=["mini_dpvo", "mini_dpvo.*"]),
|
20 |
+
package_data={
|
21 |
+
# Include all header files in the 'include' directories
|
22 |
+
"mini_dpvo.lietorch": ["include/*.h"],
|
23 |
+
},
|
24 |
+
ext_modules=[
|
25 |
+
CUDAExtension(
|
26 |
+
"cuda_corr",
|
27 |
+
sources=[
|
28 |
+
"mini_dpvo/altcorr/correlation.cpp",
|
29 |
+
"mini_dpvo/altcorr/correlation_kernel.cu",
|
30 |
+
],
|
31 |
+
extra_compile_args={
|
32 |
+
"cxx": ["-O3"],
|
33 |
+
"nvcc": ["-O3"],
|
34 |
+
},
|
35 |
+
),
|
36 |
+
CUDAExtension(
|
37 |
+
"cuda_ba",
|
38 |
+
sources=["mini_dpvo/fastba/ba.cpp", "mini_dpvo/fastba/ba_cuda.cu"],
|
39 |
+
extra_compile_args={
|
40 |
+
"cxx": ["-O3"],
|
41 |
+
"nvcc": ["-O3"],
|
42 |
+
},
|
43 |
+
),
|
44 |
+
CUDAExtension(
|
45 |
+
"lietorch_backends",
|
46 |
+
include_dirs=[
|
47 |
+
osp.join(ROOT, "mini_dpvo/lietorch/include"),
|
48 |
+
eigen_include_dir, # Use the environment variable here
|
49 |
+
# osp.join(ROOT, ".pixi/envs/default/include/eigen3"),
|
50 |
+
],
|
51 |
+
sources=[
|
52 |
+
"mini_dpvo/lietorch/src/lietorch.cpp",
|
53 |
+
"mini_dpvo/lietorch/src/lietorch_gpu.cu",
|
54 |
+
"mini_dpvo/lietorch/src/lietorch_cpu.cpp",
|
55 |
+
],
|
56 |
+
extra_compile_args={
|
57 |
+
"cxx": ["-O3"],
|
58 |
+
"nvcc": ["-O3"],
|
59 |
+
},
|
60 |
+
),
|
61 |
+
],
|
62 |
+
cmdclass={"build_ext": BuildExtension},
|
63 |
+
)
|