]> https://gitweb.dealii.org/ - dealii.git/commitdiff
intel and openmp-simd 988/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 2 Jun 2015 17:36:41 +0000 (13:36 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 2 Jun 2015 18:47:26 +0000 (14:47 -0400)
- Intel 13 does not support -openmp-simd and generates a bogus warning
(confusing it with -o). Do not try to check for it.
- Intel 15 renamed the flag to -qopenmp-simd (see
https://software.intel.com/en-us/node/522965)

cmake/checks/check_01_cpu_features.cmake

index 6d7c466f82bce7e77d30264546453cc4782180a0..eb2aa3a0b5a94fd2ecfd8639f00b1afe04832060 100644 (file)
@@ -221,7 +221,12 @@ ENDIF()
 
 IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
   IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-    CHECK_CXX_COMPILER_FLAG("-openmp-simd" DEAL_II_HAVE_OPENMP_SIMD)
+    # there is no openmp-simd support in Intel 13 and the flag got renamed in 15+
+    IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "15")
+      CHECK_CXX_COMPILER_FLAG("-qopenmp-simd" DEAL_II_HAVE_OPENMP_SIMD)
+    ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "14")
+      CHECK_CXX_COMPILER_FLAG("-openmp-simd" DEAL_II_HAVE_OPENMP_SIMD)
+    ENDIF()
   ELSE()
     CHECK_CXX_COMPILER_FLAG("-fopenmp-simd" DEAL_II_HAVE_OPENMP_SIMD)
   ENDIF()
@@ -229,8 +234,13 @@ ENDIF()
 
 IF(DEAL_II_HAVE_OPENMP_SIMD)
   IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-    ADD_FLAGS(DEAL_II_CXX_FLAGS "-openmp-simd")
-    ADD_FLAGS(DEAL_II_LINKER_FLAGS "-openmp")
+    IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "15")
+      ADD_FLAGS(DEAL_II_CXX_FLAGS "-qopenmp-simd")
+      ADD_FLAGS(DEAL_II_LINKER_FLAGS "-qopenmp")
+    ELSE()
+      ADD_FLAGS(DEAL_II_CXX_FLAGS "-openmp-simd")
+      ADD_FLAGS(DEAL_II_LINKER_FLAGS "-openmp")
+    ENDIF()
   ELSE()
     ADD_FLAGS(DEAL_II_CXX_FLAGS "-fopenmp-simd")
   ENDIF()

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.