From e3493ad85d52761187b9267709505ddb2f749465 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de>
Date: Wed, 1 Mar 2023 13:37:51 +0000
Subject: [PATCH] [ci] temporary fix for conflicts with opm cmake setup

---
 .gitlab-ci/default.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/.gitlab-ci/default.yml b/.gitlab-ci/default.yml
index 80c8675dc0..7248d1eab9 100644
--- a/.gitlab-ci/default.yml
+++ b/.gitlab-ci/default.yml
@@ -219,6 +219,21 @@ test python:
         else
           echo "Detected changes in the Python bindings/Python code: considering all Python tests."
         fi
+
+        # WARNING: this is a hack, but probably requires an upstream fix in DUNE?
+        # The issue is that the JIT compilation setup fails with cmake errors when
+        # opm is present. Cmake complains that the SuperLU::SuperLU target is not found
+        # (and maybe also SuiteSparse). OPM has its own find modules for these two, and 
+        # (maybe) overwrites some compiler flags. Upstream fixes would be to either allow
+        # "deactivation" of certain python modules (here: opm), or fixing the incompatibility
+        # of the find modules (although this doesn't appear to be an issue in C++). For now,
+        # one fix is to overwrite the find modules in opm with those of dune before setting
+        # up the dune python environment.
+        if [[ -d /dune/modules/opm-common ]]; then
+          cp /dune/modules/dune-common/cmake/modules/FindSuiteSparse.cmake /dune/modules/opm-common/cmake/Modules/FindSuiteSparse.cmake
+          cp /dune/modules/dune-istl/cmake/modules/FindSuperLU.cmake /dune/modules/opm-common/cmake/Modules/FindSuperLU.cmake
+        fi
+
         source bin/testing/ci-setup-python-env.sh
         pushd build-cmake
           DUNE_LOG_LEVEL=DEBUG ctest --output-on-failure -L python
-- 
GitLab