-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Open
Labels
module: buildBuild system issuesBuild system issuesmodule: cpp-extensionsRelated to torch.utils.cpp_extensionRelated to torch.utils.cpp_extensionmodule: windowsWindows support for PyTorchWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
When using CMake 4.1, simply calling find_package(Torch CONFIG REQUIRED)
results in the error below:
...
CMake Error at C:/Users/miriam/OneDrive/Desktop/libtorch-2.8.0/share/cmake/Caffe2/Caffe2Targets.cmake:126 (set_target_properties):
Error evaluating generator expression:
$<TARGET_PROPERTY:torch,INTERFACE_LINK_LIBRARIES>
$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on
target property which is transitive over the link libraries, creating a
recursion.
Call Stack (most recent call first):
C:/Users/miriam/OneDrive/Desktop/libtorch-2.8.0/share/cmake/Caffe2/Caffe2Config.cmake:121 (include)
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (_find_package)
C:/Users/miriam/OneDrive/Desktop/libtorch-2.8.0/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (_find_package)
train/CMakeLists.txt:3 (find_package)
...
The root cause is this PR from CMake: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10391
Can someone please fix this?
Versions
libtorch-2.8.0
CMake 4.1
cc @malfet @seemethere @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @zou3519
Metadata
Metadata
Assignees
Labels
module: buildBuild system issuesBuild system issuesmodule: cpp-extensionsRelated to torch.utils.cpp_extensionRelated to torch.utils.cpp_extensionmodule: windowsWindows support for PyTorchWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Type
Projects
Status
No status