]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: The tests for SSE2 and AVX depend on certain cpu instruction sets...
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 5 Apr 2013 09:09:52 +0000 (09:09 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 5 Apr 2013 09:09:52 +0000 (09:09 +0000)
  - therefore, run these tests with the full set of compiler flags
  - rerun them if the flags change

git-svn-id: https://svn.dealii.org/trunk@29199 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_01_cpu_features.cmake

index 0a554300cc50547ee4045c42052fba56a935c0f4..81ac8f6a2e881dbb225592464985ae47ce66f4f8 100644 (file)
@@ -42,6 +42,27 @@ TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN)
 
 
 IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+
+  #
+  # These tests depend on certain cpu instruction sets being enabled, so
+  # use the user supplied compiler flags for the tests as well:
+  #
+  SET(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS_SAVED}")
+
+
+  #
+  # Take care that the following tests are rerun if CMAKE_REQUIRED_FLAGS
+  # changes..
+  #
+  IF(NOT "${CMAKE_REQUIRED_FLAGS}" STREQUAL "${DEAL_II_CHECK_CPU_FEATURES_SAVED}")
+    UNSET(DEAL_II_HAVE_SSE2 CACHE)
+    UNSET(DEAL_II_HAVE_AVX CACHE)
+  ENDIF()
+  SET(DEAL_II_CHECK_CPU_FEATURES_SAVED
+    "${CMAKE_REQUIRED_FLAGS}" CACHE INTERNAL "" FORCE
+    )
+
+
   #
   # Check whether the compiler allows for vectorization and that
   # vectorization actually works on the given CPU. For this test, we use
@@ -114,8 +135,9 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
     }
     "
     DEAL_II_HAVE_AVX)
-ENDIF()
 
+  SET(CMAKE_REQUIRED_FLAGS "")
+ENDIF()
 
 IF(DEAL_II_HAVE_SSE2)
   IF(DEAL_II_HAVE_AVX)
@@ -126,3 +148,4 @@ IF(DEAL_II_HAVE_SSE2)
 ELSE()
   SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 0)
 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.