]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add DEAL_II_LAPACK_WITH_MKL macro which will be set if Intel MKL is being used
authorDenis Davydov <davydden@gmail.com>
Wed, 5 Dec 2018 17:33:07 +0000 (18:33 +0100)
committerDenis Davydov <davydden@gmail.com>
Wed, 5 Dec 2018 17:33:07 +0000 (18:33 +0100)
cmake/configure/configure_1_lapack.cmake
doc/news/changes/minor/20181205DenisDavydov-1 [new file with mode: 0644]
include/deal.II/base/config.h.in

index d9f682eebdee7481c540443524e4fdad5d2637fc..2eb4519a15db4eb7af794ea904e578eeb407354b 100644 (file)
@@ -77,6 +77,37 @@ MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    #
+    # See if we use Intel-MKL by compiling a small program
+    #
+    SET(CMAKE_REQUIRED_INCLUDES
+      ${LAPACK_INCLUDE_DIRS}
+      )
+    CHECK_CXX_SOURCE_COMPILES("
+    #include <mkl.h>
+    #include <vector>
+    int main(){
+      const int m = 5;
+      const int n = 2;
+      std::vector<double> A(m*n,0.);
+      std::vector<double> B(m*n,0.);
+      mkl_domatcopy('C', 'T', m, n, 1., A.data(), n, B.data(), m);
+      return 0;
+    }"
+    MKL_SYMBOL_CHECK)
+    IF(MKL_SYMBOL_CHECK)
+      MESSAGE(STATUS
+      "Use Intel MKL for BLAS/LAPACK."
+      )
+      SET(DEAL_II_LAPACK_WITH_MKL ON)
+    ELSE()
+      MESSAGE(STATUS
+      "Use other than Intel MKL implementation of BLAS/LAPACK (consult CMakeFiles/CMakeError.log for further information)."
+      )
+      SET(DEAL_II_LAPACK_WITH_MKL OFF)
+    ENDIF()
+
   ENDIF()
 ENDMACRO()
 
diff --git a/doc/news/changes/minor/20181205DenisDavydov-1 b/doc/news/changes/minor/20181205DenisDavydov-1
new file mode 100644 (file)
index 0000000..cd4052c
--- /dev/null
@@ -0,0 +1,3 @@
+New: Add DEAL_II_LAPACK_WITH_MKL macro which will be set if Intel MKL is being used.
+<br>
+(Denis Davydov, 2018/12/05)
index e9cace69778176bc85b0e1deb80410439782670d..325f61fedb04d4a16fcf728bb3b2f731d4b15216 100644 (file)
@@ -47,6 +47,7 @@
 #cmakedefine DEAL_II_WITH_HDF5
 #cmakedefine DEAL_II_WITH_LAPACK
 #cmakedefine LAPACK_WITH_64BIT_BLAS_INDICES
+#cmakedefine DEAL_II_LAPACK_WITH_MKL
 #cmakedefine DEAL_II_WITH_METIS
 #cmakedefine DEAL_II_WITH_MPI
 #cmakedefine DEAL_II_WITH_MUPARSER

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.