summarylogtreecommitdiffstats
path: root/setup-py_extensions_relative_paths.patch
blob: 733a6b56853bf6699a3b707ab70e6be749a17215 (plain)
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
diff --git a/setup.py b/setup.py
index 357073a..f49daa8 100755
--- a/setup.py
+++ b/setup.py
@@ -44,14 +44,14 @@ def get_extensions():
         return []
 
     this_dir = os.path.dirname(os.path.abspath(__file__))
-    extensions_dir = os.path.join(this_dir, "pytorch3d", "csrc")
+    extensions_dir = os.path.join("pytorch3d", "csrc")
     sources = glob.glob(os.path.join(extensions_dir, "**", "*.cpp"), recursive=True)
     source_cuda = glob.glob(os.path.join(extensions_dir, "**", "*.cu"), recursive=True)
     extension = CppExtension
 
     extra_compile_args = {"cxx": ["-std=c++17"]}
     define_macros = [("GLOG_USE_GLOG_EXPORT", None)]
-    include_dirs = [extensions_dir]
+    include_dirs = [os.path.join(this_dir, extensions_dir)]
 
     force_cuda = os.getenv("FORCE_CUDA", "0") == "1"
     force_no_cuda = os.getenv("PYTORCH3D_FORCE_NO_CUDA", "0") == "1"
@@ -111,8 +111,6 @@ def get_extensions():
 
         extra_compile_args["nvcc"] = nvcc_args
 
-    sources = [os.path.join(extensions_dir, s) for s in sources]
-
     ext_modules = [
         extension(
             "pytorch3d._C",