Skip to content

Commit bd10ea4

Browse files
Revert "Use 3.27 as the minimum CMake version (pytorch#153153)"
This reverts commit ad26ec6. Reverted pytorch#153153 on behalf of https://github.com/cyyever due to It still breaks windows debug builds ([comment](pytorch#153153 (comment)))
1 parent 43390d8 commit bd10ea4

File tree

14 files changed

+27
-65
lines changed

14 files changed

+27
-65
lines changed

.ci/manywheel/build_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then
3131
# Comment out nvidia repositories to prevent them from getting apt-get updated, see https://github.com/pytorch/pytorch/issues/74968
3232
# shellcheck disable=SC2046
3333
sed -i 's/.*nvidia.*/# &/' $(find /etc/apt/ -type f -name "*.list")
34+
3435
retry apt-get update
3536
retry apt-get -y install zip openssl
3637
else
@@ -97,7 +98,6 @@ if [[ -z "$PYTORCH_ROOT" ]]; then
9798
exit 1
9899
fi
99100
pushd "$PYTORCH_ROOT"
100-
retry pip install -q cmake
101101
python setup.py clean
102102
retry pip install -qr requirements.txt
103103
case ${DESIRED_PYTHON} in

.ci/manywheel/build_libtorch.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ if [[ -z "$PYTORCH_ROOT" ]]; then
9292
exit 1
9393
fi
9494
pushd "$PYTORCH_ROOT"
95-
retry pip install -q cmake
9695
python setup.py clean
9796
retry pip install -qr requirements.txt
9897
retry pip install -q numpy==2.0.1

.ci/pytorch/windows/arm64/build_libtorch.bat

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
:: environment variables
44
set CMAKE_BUILD_TYPE=%BUILD_TYPE%
5-
:: set CMAKE_C_COMPILER_LAUNCHER=sccache
6-
:: set CMAKE_CXX_COMPILER_LAUNCHER=sccache
5+
set CMAKE_C_COMPILER_LAUNCHER=sccache
6+
set CMAKE_CXX_COMPILER_LAUNCHER=sccache
77
set libuv_ROOT=%DEPENDENCIES_DIR%\libuv\install
88
set MSSdk=1
99
if defined PYTORCH_BUILD_VERSION (
@@ -43,10 +43,9 @@ pip install -r requirements.txt
4343
set DISTUTILS_USE_SDK=1
4444

4545
:: start sccache server and reset sccache stats
46-
:: disable sccache because of debug file bug
47-
:: sccache --start-server
48-
:: sccache --zero-stats
49-
:: sccache --show-stats
46+
sccache --start-server
47+
sccache --zero-stats
48+
sccache --show-stats
5049

5150
:: Prepare the environment
5251
mkdir libtorch
@@ -99,4 +98,4 @@ rmdir /s /q libtorch
9998
if %errorlevel% neq 0 (
10099
echo "Failed on build_libtorch. (exitcode = %errorlevel%)"
101100
exit /b 1
102-
)
101+
)

.github/requirements/pip-requirements-macOS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
boto3==1.35.42
2-
cmake==3.27.*
2+
cmake==3.25.*
33
expecttest==0.3.0
44
fbscribelogger==0.1.7
55
filelock==3.6.0

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
22
# cmake_policy(SET CMP0022 NEW) cmake_policy(SET CMP0023 NEW)
33

44
# Use compiler ID "AppleClang" instead of "Clang" for XCode. Not setting this
55
# sometimes makes XCode C compiler gets detected as "Clang", even when the C++
66
# one is detected as "AppleClang".
77
cmake_policy(SET CMP0010 NEW)
88
cmake_policy(SET CMP0025 NEW)
9-
cmake_policy(SET CMP0126 OLD)
109

1110
# Enables CMake to set LTO on compilers other than Intel.
1211
cmake_policy(SET CMP0069 NEW)

aten/src/ATen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
22
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
33

44
if(NOT MSVC)

aten/src/ATen/native/quantized/cpu/qnnpack/deps/clog/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
7+
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
88

99
include(GNUInstallDirs)
1010

c10/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
22
project(c10 CXX)
33

44
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")

cmake/ProtoBuf.cmake

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,54 +34,22 @@ macro(custom_protobuf_find)
3434
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
3535

3636
if(MSVC)
37-
foreach(
38-
flag_var
39-
CMAKE_C_FLAGS
40-
CMAKE_C_FLAGS_DEBUG
41-
CMAKE_C_FLAGS_RELEASE
42-
CMAKE_C_FLAGS_MINSIZEREL
43-
CMAKE_C_FLAGS_RELWITHDEBINFO
44-
CMAKE_CXX_FLAGS
45-
CMAKE_CXX_FLAGS_DEBUG
46-
CMAKE_CXX_FLAGS_RELEASE
47-
CMAKE_CXX_FLAGS_MINSIZEREL
48-
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
49-
# Replace /Zi and /ZI with /Z7
50-
if(MSVC_Z7_OVERRIDE)
51-
if(${flag_var} MATCHES "/Z[iI]")
52-
string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
53-
endif()
54-
if(${flag_var} MATCHES "[-]Zi")
55-
string(REGEX REPLACE "[-Zi]" "/Z7" ${flag_var} "${${flag_var}}")
56-
endif()
57-
endif(MSVC_Z7_OVERRIDE)
58-
endforeach(flag_var)
59-
6037
foreach(flag_var
6138
CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL
6239
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL)
6340
if(${flag_var} MATCHES "/Z[iI7]")
6441
string(REGEX REPLACE "/Z[iI7]" "" ${flag_var} "${${flag_var}}")
6542
endif()
6643
endforeach(flag_var)
67-
68-
foreach(
69-
flag_var
70-
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
71-
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
72-
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
73-
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
74-
CMAKE_SHARED_LINKER_FLAGS_DEBUG
75-
CMAKE_STATIC_LINKER_FLAGS_DEBUG
76-
CMAKE_EXE_LINKER_FLAGS_DEBUG
77-
CMAKE_MODULE_LINKER_FLAGS_DEBUG)
78-
# Switch off incremental linking in debug/relwithdebinfo builds
79-
if(${flag_var} MATCHES "/INCREMENTAL" AND NOT ${flag_var} MATCHES
80-
"/INCREMENTAL:NO")
81-
string(REGEX REPLACE "/INCREMENTAL" "/INCREMENTAL:NO" ${flag_var}
82-
"${${flag_var}}")
83-
endif()
84-
endforeach(flag_var)
44+
if(MSVC_Z7_OVERRIDE)
45+
foreach(flag_var
46+
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO
47+
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO)
48+
if(${flag_var} MATCHES "/Z[iI]")
49+
string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
50+
endif()
51+
endforeach(flag_var)
52+
endif(MSVC_Z7_OVERRIDE)
8553
endif(MSVC)
8654

8755
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.0")

test/edge/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.18)
1+
cmake_minimum_required(VERSION 3.15)
22

33
set(TORCH_ROOT ${CMAKE_CURRENT_LIST_DIR}/../..)
44
set(TEST_ROOT ${TORCH_ROOT}/test/edge)

0 commit comments

Comments
 (0)