From f0d6fc9909425760be85c6ec40a01bc9544a1e3b Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Thu, 9 Nov 2023 20:43:23 -0800 Subject: [PATCH] Update CXX compiler from 14 to 17 Similar to https://github.com/pytorch/examples/pull/678 --- cpp/autograd/CMakeLists.txt | 4 ++-- cpp/dcgan/CMakeLists.txt | 2 +- cpp/mnist/CMakeLists.txt | 2 +- cpp/regression/CMakeLists.txt | 4 ++-- cpp/transfer-learning/CMakeLists.txt | 4 ++-- fx/native_interpreter/CMakeLists.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cpp/autograd/CMakeLists.txt b/cpp/autograd/CMakeLists.txt index 332c51ab09..ab89f45681 100644 --- a/cpp/autograd/CMakeLists.txt +++ b/cpp/autograd/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.1) project(autograd) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) find_package(Torch REQUIRED) diff --git a/cpp/dcgan/CMakeLists.txt b/cpp/dcgan/CMakeLists.txt index ee85d73768..b874676b49 100644 --- a/cpp/dcgan/CMakeLists.txt +++ b/cpp/dcgan/CMakeLists.txt @@ -17,7 +17,7 @@ endif() add_executable(dcgan dcgan.cpp) target_link_libraries(dcgan "${TORCH_LIBRARIES}") -set_property(TARGET dcgan PROPERTY CXX_STANDARD 14) +set_property(TARGET dcgan PROPERTY CXX_STANDARD 17) if (MSVC) file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll") diff --git a/cpp/mnist/CMakeLists.txt b/cpp/mnist/CMakeLists.txt index 425a732a97..e525b71bc4 100644 --- a/cpp/mnist/CMakeLists.txt +++ b/cpp/mnist/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) project(mnist) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) find_package(Torch REQUIRED) diff --git a/cpp/regression/CMakeLists.txt b/cpp/regression/CMakeLists.txt index ad959c6436..feaf3bd4b3 100644 --- a/cpp/regression/CMakeLists.txt +++ b/cpp/regression/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.1) project(regression) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) find_package(Torch REQUIRED) diff --git a/cpp/transfer-learning/CMakeLists.txt b/cpp/transfer-learning/CMakeLists.txt index 7a3bd74a27..0bb2888878 100644 --- a/cpp/transfer-learning/CMakeLists.txt +++ b/cpp/transfer-learning/CMakeLists.txt @@ -14,5 +14,5 @@ target_link_libraries(example "${TORCH_LIBRARIES}") target_link_libraries(classify ${OpenCV_LIBS}) target_link_libraries(classify "${TORCH_LIBRARIES}") -set_property(TARGET classify PROPERTY CXX_STANDARD 14) -set_property(TARGET example PROPERTY CXX_STANDARD 14) +set_property(TARGET classify PROPERTY CXX_STANDARD 17) +set_property(TARGET example PROPERTY CXX_STANDARD 17) diff --git a/fx/native_interpreter/CMakeLists.txt b/fx/native_interpreter/CMakeLists.txt index 6ca3dfc12b..9f0209d491 100644 --- a/fx/native_interpreter/CMakeLists.txt +++ b/fx/native_interpreter/CMakeLists.txt @@ -5,6 +5,6 @@ find_package(Torch REQUIRED) # Define our library target add_library(interpreter SHARED interpreter.cpp) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) # Link against LibTorch target_link_libraries(interpreter "${TORCH_LIBRARIES}")