Skip to content

Commit

Permalink
[Dev] Change CXX standard to 17 (#6138) (#6151)
Browse files Browse the repository at this point in the history
Co-authored-by: Muhammed Fatih BALIN <[email protected]>
  • Loading branch information
Rhett-Ying and mfbalin authored Aug 14, 2023
1 parent b64940b commit d95058f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 3.5)
project(dgl C CXX)
message(STATUS "Start configuring project ${PROJECT_NAME}")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# cmake utils
include(cmake/util/Util.cmake)
include(cmake/util/MshadowUtil.cmake)
Expand Down Expand Up @@ -162,8 +165,6 @@ else(USE_CUDA)
add_library(dgl SHARED ${DGL_SRC})
endif(USE_CUDA)

set_property(TARGET dgl PROPERTY CXX_STANDARD 14)

# include directories
target_include_directories(dgl PRIVATE "include")
target_include_directories(dgl PRIVATE "third_party/dlpack/include")
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()
###### Borrowed from MSHADOW project

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++14" SUPPORT_CXX14)
check_cxx_compiler_flag("-std=c++17" SUPPORT_CXX17)

set(dgl_known_gpu_archs "35" "50" "60" "70")
set(dgl_cuda_arch_ptx "70")
Expand Down Expand Up @@ -248,7 +248,7 @@ macro(dgl_config_cuda out_variable)
list(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_ARCH})

# 2. flags in third_party/moderngpu
list(APPEND CUDA_NVCC_FLAGS "--expt-extended-lambda;-Wno-deprecated-declarations;-std=c++14")
list(APPEND CUDA_NVCC_FLAGS "--expt-extended-lambda;-Wno-deprecated-declarations;-std=c++17")

message(STATUS "CUDA_NVCC_FLAGS: ${CUDA_NVCC_FLAGS}")

Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def config_cython():
library_dirs=library_dirs,
libraries=libraries,
# Crashes without this flag with GCC 5.3.1
extra_compile_args=["-std=c++14"],
extra_compile_args=["-std=c++17"],
language="c++",
)
)
Expand Down

0 comments on commit d95058f

Please sign in to comment.