]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Config.h.in: use PETSc/SLEPc macros to determine PETSc/SLEPc version 15770/head
authorStefano Zampini <stefano.zampini@gmail.com>
Wed, 19 Jul 2023 23:44:38 +0000 (01:44 +0200)
committerStefano Zampini <stefano.zampini@gmail.com>
Wed, 19 Jul 2023 23:53:57 +0000 (01:53 +0200)
This allows to use code in the development version

include/deal.II/base/config.h.in

index 6b3fcf06564a9054b091f48e8b74998aec97a99a..ae74303461d75c1944202f3378a94aed645f349a 100644 (file)
 /*
  * PETSc:
  *
- * Note: The following definitions will be set in petscconf.h and
- *       petscversion.h, so we don't repeat them here.
- *
- *  PETSC_VERSION_MAJOR
- *  PETSC_VERSION_MINOR
- *  PETSC_VERSION_SUBMINOR
- *  PETSC_VERSION_PATCH
- *  PETSC_VERSION_RELEASE
- *  PETSC_USE_COMPLEX
- */
-
-#define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
-  ((PETSC_VERSION_MAJOR * 10000 + \
-    PETSC_VERSION_MINOR * 100 + \
-    PETSC_VERSION_SUBMINOR) \
-    <  \
-    (major)*10000 + (minor)*100 + (subminor))
+ * Note: The following macros are defined in petscversion.h
+ *       so we don't repeat them here.
+ */
 
-#define DEAL_II_PETSC_VERSION_GTE(major,minor,subminor) \
-  ((PETSC_VERSION_MAJOR * 10000 + \
-    PETSC_VERSION_MINOR * 100 + \
-    PETSC_VERSION_SUBMINOR) \
-    >=  \
-    (major)*10000 + (minor)*100 + (subminor))
+#ifdef DEAL_II_WITH_PETSC
+#  define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
+    PETSC_VERSION_LT(major,minor,subminor)
+#  define DEAL_II_PETSC_VERSION_GTE(major,minor,subminor) \
+    PETSC_VERSION_GE(major,minor,subminor)
+#endif
 
 /*
- * SLEPC
- * see slepcversion.h
+ * SLEPC:
  */
-#define DEAL_II_SLEPC_VERSION_GTE(major,minor,subminor) \
-  ((SLEPC_VERSION_MAJOR * 10000 + \
-    SLEPC_VERSION_MINOR * 100 + \
-    SLEPC_VERSION_SUBMINOR) \
-    >=  \
-    (major)*10000 + (minor)*100 + (subminor))
+
+#ifdef DEAL_II_WITH_SLEPC
+#  define DEAL_II_SLEPC_VERSION_LT(major,minor,subminor) \
+    SLEPC_VERSION_LT(major,minor,subminor)
+#  define DEAL_II_SLEPC_VERSION_GTE(major,minor,subminor) \
+    SLEPC_VERSION_GE(major,minor,subminor)
+#endif
 
 /*
  * Trilinos:

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.