From: Matthias Maier Date: Thu, 24 May 2018 02:49:19 +0000 (-0500) Subject: CMake: Fix openmpi detection for Clang X-Git-Tag: v9.1.0-rc1~1091^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6658%2Fhead;p=dealii.git CMake: Fix openmpi detection for Clang Well, now that Clang has reached the version range of XCode, this cludge obviously doesn't work any more. (Remember both compiler call themselves "clang", but Apple insists on a different versioning scheme *sigh*). Simply remove the version constaints for Clang. If someone hits an issue with XCode. Well update your compiler to any version younger than 2 years, thanks. --- diff --git a/cmake/checks/check_01_cpu_features.cmake b/cmake/checks/check_01_cpu_features.cmake index 1082e13b54..1dcd693d35 100644 --- a/cmake/checks/check_01_cpu_features.cmake +++ b/cmake/checks/check_01_cpu_features.cmake @@ -216,36 +216,26 @@ ENDIF() # -# OpenMP 4.0 can be used for vectorization (supported by gcc-4.9.1 and -# later). Only the vectorization instructions -# are allowed, the threading must be done through TBB. +# OpenMP 4.0 can be used for vectorization. Only the vectorization +# instructions are allowed, the threading must be done through TBB. # -# Pick up the correct candidate keyword for the current compiler: -SET(_keyword "") +# +# Choosing the right compiler flag is a bit of a mess: +# IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "15" ) + IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "15" ) SET(_keyword "qopenmp") - ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "14" ) + ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "14" ) SET(_keyword "openmp") ENDIF() - ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # clang-3.6.1 or newer, or XCode version 6.3, or newer. - IF( ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.6" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" ) - OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.2") - SET(_keyword "openmp") - ENDIF() - + SET(_keyword "openmp") ELSE() SET(_keyword "fopenmp") - ENDIF() -IF(NOT "${_keyword}" STREQUAL "") - CHECK_CXX_COMPILER_FLAG("-${_keyword}-simd" DEAL_II_HAVE_OPENMP_SIMD) -ENDIF() +CHECK_CXX_COMPILER_FLAG("-${_keyword}-simd" DEAL_II_HAVE_OPENMP_SIMD) SET(DEAL_II_OPENMP_SIMD_PRAGMA " ") IF(DEAL_II_HAVE_OPENMP_SIMD)