From d65efa85410a5233940c784eef76432b482572a4 Mon Sep 17 00:00:00 2001 From: "Palicki, Stefan" Date: Wed, 18 Dec 2024 09:30:36 -0800 Subject: [PATCH] build: cmake: unsupported compilers cleanup --- README.md | 8 ++++---- cmake/OpenMP.cmake | 7 ------- cmake/SDL.cmake | 10 +++------- cmake/coverage.cmake | 6 +----- cmake/host_compiler_id.cmake | 8 ++++---- cmake/platform.cmake | 11 ----------- 6 files changed, 12 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 53d522ff639..0dce2c04b7d 100644 --- a/README.md +++ b/README.md @@ -296,8 +296,8 @@ Runtime-specific dependencies: ### Validated Configurations CPU engine was validated on RedHat\* Enterprise Linux 8 with -* GNU Compiler Collection 5.4, 6.1, 7.2, 8.1, 9.1, 11.1, 11.3 -* Clang\* 7.1, 8.0, 9.0, 14.0.6 +* GNU Compiler Collection 8.5, 9.5, 11.1, 11.3 +* Clang\* 11.0, 14.0.6 * [Intel oneAPI DPC++/C++ Compiler] 2024.0 on Windows Server\* 2019 with @@ -315,8 +315,8 @@ on Ubuntu 20.04 AArch64 with available at the time of release GPU engine was validated on Ubuntu\* 22.04 with -* GNU Compiler Collection 7.2, 8.1, and 9.1 -* Clang 7.1, 8.0, 9.0 +* GNU Compiler Collection 8.5, and 9.5 +* Clang 11.0 * [Intel oneAPI DPC++/C++ Compiler] 2024.0 * [Intel Software for General Purpose GPU capabilities] latest stable version available at the time of release diff --git a/cmake/OpenMP.cmake b/cmake/OpenMP.cmake index c2088a3fddb..66319b4e52d 100644 --- a/cmake/OpenMP.cmake +++ b/cmake/OpenMP.cmake @@ -52,13 +52,6 @@ if(NOT OpenMP_CXX_FOUND AND MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "(Clang|Intel # The ICX driver doesn't link OpenMP library even if `/Qopenmp` # was specified. set(OpenMP_FLAGS "/Qopenmp -Xclang --dependent-lib=libiomp5md") - else() - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0") - # version < 10 can't pass cl-style `/openmp` flag - set(OpenMP_FLAGS "-Xclang -fopenmp") - # ... and requires explicit linking against omp library - set(OpenMP_CXX_LIBRARIES "libomp.lib") - endif() endif() set(OpenMP_C_FLAGS ${OpenMP_FLAGS}) set(OpenMP_CXX_FLAGS ${OpenMP_FLAGS}) diff --git a/cmake/SDL.cmake b/cmake/SDL.cmake index 2581bc7fda5..83c9b47b284 100644 --- a/cmake/SDL.cmake +++ b/cmake/SDL.cmake @@ -31,13 +31,9 @@ macro(sdl_unix_common_ccxx_flags var) endmacro() macro(sdl_gnu_common_ccxx_flags var gnu_version) - if(${gnu_version} VERSION_LESS 4.9) - append(${var} "-fstack-protector-all") - else() - append(${var} "-fstack-protector-strong") - if(NOT (${gnu_version} VERSION_LESS 8.0) AND (DNNL_TARGET_ARCH STREQUAL "X64")) - append(${var} "-fcf-protection=full") - endif() + append(${var} "-fstack-protector-strong") + if(DNNL_TARGET_ARCH STREQUAL "X64") + append(${var} "-fcf-protection=full") endif() endmacro() diff --git a/cmake/coverage.cmake b/cmake/coverage.cmake index d8ca80bb66d..cb057f7861b 100644 --- a/cmake/coverage.cmake +++ b/cmake/coverage.cmake @@ -36,11 +36,7 @@ if("${DNNL_CODE_COVERAGE}" STREQUAL "GCOV") message(FATAL_ERROR "GCOV not found in path") endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") - if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) - message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") - endif() - elseif(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang|GNU") message(FATAL_ERROR "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}") endif() diff --git a/cmake/host_compiler_id.cmake b/cmake/host_compiler_id.cmake index 2a74d703c4f..08acda979c7 100644 --- a/cmake/host_compiler_id.cmake +++ b/cmake/host_compiler_id.cmake @@ -98,13 +98,13 @@ message(STATUS "Host compiler version: ${DPCPP_HOST_COMPILER_MAJOR_VER}.${DPCPP_ # Check the version of the provided host compiler. if(DPCPP_HOST_COMPILER_KIND STREQUAL "GNU") - if((DPCPP_HOST_COMPILER_MAJOR_VER LESS 7) OR (DPCPP_HOST_COMPILER_MAJOR_VER EQUAL 7 AND DPCPP_HOST_COMPILER_MINOR_VER LESS 4)) - message(FATAL_ERROR "The minimum version of ${DPCPP_HOST_COMPILER_KIND} host compiler is 7.4.") + if(DPCPP_HOST_COMPILER_MAJOR_VER LESS 8) + message(FATAL_ERROR "The minimum version of ${DPCPP_HOST_COMPILER_KIND} host compiler is 8.0.") endif() endif() if(DPCPP_HOST_COMPILER_KIND STREQUAL "CLANG") - if(DPCPP_HOST_COMPILER_MAJOR_VER LESS 8) - message(FATAL_ERROR "The minimum version of ${DPCPP_HOST_COMPILER_KIND} host compiler is 8.0.") + if(DPCPP_HOST_COMPILER_MAJOR_VER LESS 11) + message(FATAL_ERROR "The minimum version of ${DPCPP_HOST_COMPILER_KIND} host compiler is 11.0.") endif() endif() diff --git a/cmake/platform.cmake b/cmake/platform.cmake index 618008c7db2..1822a5185f9 100644 --- a/cmake/platform.cmake +++ b/cmake/platform.cmake @@ -358,12 +358,6 @@ elseif(UNIX OR MINGW) append(CMAKE_CCXX_FLAGS "-Wno-ignored-attributes") endif() - # XXX: Suppress an erroneous warning of nested lambda visibility - # exceeding that of the containing class (GCC Bugzilla - Bug 80947). - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) - append(CMAKE_CCXX_FLAGS "-Wno-attributes") - endif() - if(DNNL_TARGET_ARCH STREQUAL "AARCH64") if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") set(DEF_ARCH_OPT_FLAGS "-O3") @@ -482,10 +476,5 @@ if (DNNL_TARGET_ARCH STREQUAL "RV64") message(STATUS "DNNL_RISCV_USE_RVV_INTRINSICS: ${DNNL_RISCV_USE_RVV_INTRINSICS}") endif() -# Old compiler versions do not support warnings available on newer compilers. -if(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0.0) - append(CMAKE_CCXX_FLAGS "-Wno-unknown-warning-option") -endif() - append(CMAKE_C_FLAGS "${CMAKE_CCXX_FLAGS}") append(CMAKE_CXX_FLAGS "${CMAKE_CCXX_FLAGS}")