]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check if Tpetra is usable
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 9 Feb 2019 23:53:53 +0000 (00:53 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 20 Feb 2019 12:46:19 +0000 (13:46 +0100)
cmake/configure/configure_2_trilinos.cmake

index eca8862a0a409104835b79168827204f24aab412..9b3c86139577dc32e07db991cf62c0a2b3840abf 100644 (file)
@@ -158,6 +158,41 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
       ENDFOREACH()
     ENDIF()
 
+    IF(${DEAL_II_TRILINOS_WITH_TPETRA})
+      #
+      # Check if Tpetra is usable in fact.
+      #
+      LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS})
+      ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
+      LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${Trilinos_LIBRARIES}")
+      CHECK_CXX_SOURCE_COMPILES(
+        "
+        #include <Tpetra_Vector.hpp>
+        int
+        main()
+        {
+          using LO       = int;
+          using GO       = unsigned int;
+          using Node     = Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial>;
+          using map_type = Tpetra::Map<LO, GO, Node>;
+          Teuchos::RCP<const map_type>         dummy_map = Teuchos::rcp(new map_type());
+          Tpetra::Vector<double, LO, GO, Node> dummy_vector(dummy_map);
+          (void)dummy_vector;
+          return 0;
+        }
+        "
+        TRILINOS_TPETRA_IS_FUNCTIONAL
+        )
+      RESET_CMAKE_REQUIRED()
+      IF(NOT TRILINOS_TPETRA_IS_FUNCTIONAL)
+        MESSAGE(
+          STATUS
+          "Tpetra was found but is not usable! Disabling Tpetra support."
+          )
+        SET(DEAL_II_TRILINOS_WITH_TPETRA OFF)
+      ENDIF()
+    ENDIF()
+
     IF(${DEAL_II_TRILINOS_WITH_SACADO})
       #
       # Look for Sacado_config.h - we'll query it to determine C++11 support:

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.