From 97ade6713ad1dbe37359282882265416aa1d5d67 Mon Sep 17 00:00:00 2001
From: Markus Blatt <markus@dr-blatt.de>
Date: Thu, 10 Oct 2024 14:47:24 +0200
Subject: [PATCH] Fixes compilation with SuperLU 7 by forcing backwards
 compatibility

SuperLU 7.0.0 now uses singlecomplex instead of complex and by default
does not add a typedef to make singlecomplex available as type
complex. The latter was used in previous versions.

As we need to support several versions of SuperLU we force adding such
a typedef by defining SUPERLU_TYPEDEF_COMPLEX
---
 dune/istl/superlufunctions.hh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dune/istl/superlufunctions.hh b/dune/istl/superlufunctions.hh
index 53cc9c567..36b33f79b 100644
--- a/dune/istl/superlufunctions.hh
+++ b/dune/istl/superlufunctions.hh
@@ -58,6 +58,11 @@ extern "C" {
 #endif
 
 #if __has_include("slu_cdefs.h")
+#ifndef SUPERLU_TYPEDEF_COMPLEX
+// For now let's keep backwards compatible and let
+// complex be a typedef of doublecomplex
+#define SUPERLU_TYPEDEF_COMPLEX
+#endif
 #include "slu_scomplex.h"
 
 extern "C" {
-- 
GitLab