facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

std::optional pulsar build ERROR #1795

Closed git-xuefu closed 3 months ago

git-xuefu commented 6 months ago

D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\c10/util/Optional.h(554): note: 查看对正在编译的 别名 模板 实例化“c10::OptionalBase<std::vector<at::Tensor,std::allocator>>”的引用 D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\torch\csrc\api\include\torch/optim/lbfgs.h(50): note: 查看对正在编译的 类 模板 实例化“c10::optional<std::vector<at::Tensor,std::allocator>>”的引用 D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\c10/util/Optional.h(446): warning C4624: “c10::trivially_copyable_optimization_optional_base”: 已将析构函数隐式定义为“已删除” with [ T=std::vector<at::Tensor,std::allocator> ] D:\code\pytorch3d\pytorch3d\csrc./pulsar/global.h(56): warning C4068: 未知的杂注“clang” D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(47): error C2039: "optional": 不是 "std" 的成员 D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\c10/cuda/CUDAStream.h(244): note: 参见“std”的声明 D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(47): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(47): error C2143: 语法错误: 缺少“,”(在“<”的前面) D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(78): error C2039: "optional": 不是 "std" 的成员 D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\c10/cuda/CUDAStream.h(244): note: 参见“std”的声明 D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(78): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(78): error C2143: 语法错误: 缺少“,”(在“<”的前面) D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(118): error C2039: "optional": 不是 "std" 的成员 D:\anaconda\envs\Keypoint\lib\site-packages\torch\include\c10/cuda/CUDAStream.h(244): note: 参见“std”的声明 D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(118): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支 持默认 int D:\code\pytorch3d\pytorch3d\csrc./pulsar/pytorch/renderer.h(118): error C2143: 语法错误: 缺少“,”(在“<”的前面) error: command 'D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2

bottler commented 6 months ago

🤣 I can't read this, but I can guess what it says... 🤣

The latest commit https://github.com/facebookresearch/pytorch3d/commit/bd52f4a408b29dc6b4357b70c93fd7a9749ca820 on main has broken the ability to build pytorch3d with PyTorch older than 2.1 , because it relies on c10::optional being the same as std::optional. I imagine in the near future that change will either be reverted, or we will explicitly insist on newer pytorch. Meanwhile you can revert the change locally e.g. by git checkout 17117106e : the previous commit is https://github.com/facebookresearch/pytorch3d/commit/17117106e4dd8269c02271462539c9c4a5d0d5ec .

bottler commented 3 months ago

This got fixed.