From a970a46eb99fee72f997f917825732838202b310 Mon Sep 17 00:00:00 2001 From: Chaojie Wang Date: Fri, 17 May 2024 19:02:37 -0700 Subject: [PATCH] pytorch 2.x requires cxx 17 to compile --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6aec091..0da36a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -cmake_minimum_required(VERSION 3.0) -project(torchscatter) -set(CMAKE_CXX_STANDARD 14) +cmake_minimum_required(VERSION 3.18) +project(torchscatter LANGUAGES CXX CUDA) +set(CMAKE_CXX_STANDARD 17) set(TORCHSCATTER_VERSION 2.1.2) option(WITH_CUDA "Enable CUDA support" OFF) @@ -11,6 +11,8 @@ if(WITH_CUDA) add_definitions(-D__CUDA_NO_HALF_OPERATORS__) add_definitions(-DWITH_CUDA) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr") + set(CMAKE_CUDA_STANDARD 17) + set(CMAKE_CUDA_STANDARD_REQUIRED ON) endif() if (WITH_PYTHON)