cubvh icon indicating copy to clipboard operation
cubvh copied to clipboard

C++ standard version update

Open lcp29 opened this issue 1 year ago • 5 comments

A version of PyTorch (mine is torch2.1.2+cu121) requires C++ 17 for its compliation. Directly running

pip install .

results in the errors including:

      /home/******/miniconda3/envs/******/lib/python3.10/site-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++17 to compile PyTorch
         27 | #error You need C++17 to compile PyTorch
            |  ^~~~~
      In file included from /home/******/miniconda3/envs/******/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                       from /home/******/Projects/cubvh/include/cubvh/api.h:5,
                       from /home/******/Projects/cubvh/src/api.cu:3:
      /home/******/miniconda3/envs/******/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4:2: error: #error C++17 or later compatible compiler is required to use PyTorch.
          4 | #error C++17 or later compatible compiler is required to use PyTorch.
            |  ^~~~~

After the following patch applied cuBVH was installed successfully:

diff --git a/setup.py b/setup.py
index 10efae9..968d7a8 100644
--- a/setup.py
+++ b/setup.py
@@ -107,7 +107,7 @@ if os.name == "nt":
 		# won't try to activate a developer command prompt a second time.
 		os.environ["DISTUTILS_USE_SDK"] = "1"
 
-cpp_standard = 14
+cpp_standard = 17
 
 # Get CUDA version and make sure the targeted compute capability is compatible
 if os.system("nvcc --version") == 0:

and functioned as normal.

lcp29 avatar Jan 10 '24 11:01 lcp29