-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed as duplicate of#150149
Labels
module: buildBuild system issuesBuild system issuestriagedThis 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
Error message
-- Found SYCL: (found version "20250200")
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
CMake Error at third_party/protobuf/cmake/CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
-- Configuring incomplete, errors occurred!
-- Building version 2.7.0a0+git504bc92
Root cause
CMake 4.0.0 is released to pypi.org today (March 28, 2025), but it is not compatible with cmake_minimum_required defined in many third_party project's CMakeLists.txt, such as protobuf.
https://github.com/protocolbuffers/protobuf/blob/d1eca4e4b421cd2997495c4b4e65cea6be4e9b8a/cmake/CMakeLists.txt
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
Changed in version 4.0: Compatibility with versions of CMake older than 3.5 is removed.
Calls to cmake_minimum_required(VERSION) or cmake_policy(VERSION) that do not specify at least 3.5 as their policy version (optionally via ...<max>) will produce an error in CMake 4.0 and above.
Workaround
Stick to CMake 3.31
python -m pip install cmake==3.31
Versions
PyTorch: main branch
CMake: 4.0.0
Goldas99 and Lucky-Lance
Metadata
Metadata
Assignees
Labels
module: buildBuild system issuesBuild system issuestriagedThis 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