]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Fix openmpi detection for Clang 6658/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 24 May 2018 02:49:19 +0000 (21:49 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 24 May 2018 15:36:24 +0000 (10:36 -0500)
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.

cmake/checks/check_01_cpu_features.cmake

index 1082e13b5438317b10a7a110fbca929c569e3f94..1dcd693d35d19b8b31f8e5a5497e1f60483e6cd9 100644 (file)
@@ -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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.