Merge pull request #170792 from grindhold/elmerfix

elmerfem: make elmerfem-9.0 run properly
This commit is contained in:
Sandro 2022-05-09 12:00:52 +02:00 committed by GitHub
commit c1daf2ae36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 170 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:
{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, pkg-config, libGL, libGLU, opencascade, libsForQt5, vtkWithQt5}:
stdenv.mkDerivation rec {
pname = "elmerfem";
@ -13,19 +13,44 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ];
nativeBuildInputs = [ cmake gfortran pkg-config git ];
buildInputs = [ mpi blas liblapack qt4 qwt6_qt4 ];
nativeBuildInputs = [
cmake
gfortran
pkg-config
libsForQt5.wrapQtAppsHook
];
buildInputs = [
mpi
blas
liblapack
libsForQt5.qtbase
libsForQt5.qtscript
libsForQt5.qwt
libGL
libGLU
opencascade
vtkWithQt5
];
preConfigure = ''
patchShebangs ./
'';
patches = [
./patches/0001-fix-import-of-QPainterPath.patch
./patches/0002-fem-rename-loopvars-to-avoid-redefinition.patch
./patches/0003-ignore-qwt_compat.patch
];
storepath = placeholder "out";
cmakeFlags = [
"-DELMER_INSTALL_LIB_DIR=${storepath}/lib"
"-DWITH_OpenMP:BOOLEAN=TRUE"
"-DWITH_MPI:BOOLEAN=TRUE"
"-DWITH_QT5:BOOLEAN=TRUE"
"-DWITH_OCC:BOOLEAN=TRUE"
"-DWITH_VTK:BOOLEAN=TRUE"
"-DWITH_ELMERGUI:BOOLEAN=TRUE"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"

View File

@ -0,0 +1,24 @@
From 87885de957aa3f891fe963503c94685675c24f49 Mon Sep 17 00:00:00 2001
From: grindhold <grindhold@gmx.net>
Date: Wed, 27 Apr 2022 19:16:42 +0200
Subject: [PATCH] fix import of QPainterPath
---
ElmerGUI/Application/twod/renderarea.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/ElmerGUI/Application/twod/renderarea.cpp b/ElmerGUI/Application/twod/renderarea.cpp
index 4c2515c5..65128ea9 100644
--- a/ElmerGUI/Application/twod/renderarea.cpp
+++ b/ElmerGUI/Application/twod/renderarea.cpp
@@ -38,6 +38,7 @@
* *
*****************************************************************************/
#include <QPainter>
+#include <QPainterPath>
#include <QMouseEvent>
#include <QFile>
#include <QTextStream>
--
2.33.3

View File

@ -0,0 +1,82 @@
From 06634e5fd46a27dca11b87d4a38e9ead561de3d5 Mon Sep 17 00:00:00 2001
From: grindhold <grindhold@gmx.net>
Date: Thu, 28 Apr 2022 15:47:07 +0200
Subject: [PATCH] fem: rename loopvars to avoid redefinition
---
fem/src/modules/DCRComplexSolve.F90 | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/fem/src/modules/DCRComplexSolve.F90 b/fem/src/modules/DCRComplexSolve.F90
index 469214ee..268591fd 100644
--- a/fem/src/modules/DCRComplexSolve.F90
+++ b/fem/src/modules/DCRComplexSolve.F90
@@ -502,14 +502,14 @@ CONTAINS
IF ( SIZE(Hwrk,1) == 1 ) THEN
- DO i=1,MIN(3,SIZE(Hwrk,2))
- Tensor( i,1:n ) = Hwrk( 1,1,1:n )
+ DO k=1,MIN(3,SIZE(Hwrk,2))
+ Tensor( k,1:n ) = Hwrk( 1,1,1:n )
END DO
ELSE
- DO i=1,MIN(3,SIZE(Hwrk,1))
- Tensor( i,1:n ) = Hwrk( i,1,1:n )
+ DO k=1,MIN(3,SIZE(Hwrk,1))
+ Tensor( k,1:n ) = Hwrk( k,1,1:n )
END DO
END IF
@@ -1391,21 +1391,21 @@ contains
IF ( SIZE(Hwrk,1) == 1 ) THEN
- DO i=1,MIN(3,SIZE(Hwrk,2))
- Tensor( i,i,1:n ) = Hwrk( 1,1,1:n )
+ DO k=1,MIN(3,SIZE(Hwrk,2))
+ Tensor( k,k,1:n ) = Hwrk( 1,1,1:n )
END DO
ELSE IF ( SIZE(Hwrk,2) == 1 ) THEN
- DO i=1,MIN(3,SIZE(Hwrk,1))
- Tensor(i,i,1:n) = Hwrk(i,1,1:n)
+ DO k=1,MIN(3,SIZE(Hwrk,1))
+ Tensor(k,k,1:n) = Hwrk(k,1,1:n)
END DO
ELSE
- DO i=1,MIN(3,SIZE(Hwrk,1))
+ DO k=1,MIN(3,SIZE(Hwrk,1))
DO j=1,MIN(3,SIZE(Hwrk,2))
- Tensor( i,j,1:n ) = Hwrk(i,j,1:n)
+ Tensor( k,j,1:n ) = Hwrk(k,j,1:n)
END DO
END DO
@@ -1443,14 +1443,14 @@ contains
IF ( SIZE(Hwrk,1) == 1 ) THEN
- DO i=1,MIN(3,SIZE(Hwrk,2))
- Tensor( i,1:n ) = Hwrk( 1,1,1:n )
+ DO k=1,MIN(3,SIZE(Hwrk,2))
+ Tensor( k,1:n ) = Hwrk( 1,1,1:n )
END DO
ELSE
- DO i=1,MIN(3,SIZE(Hwrk,1))
- Tensor( i,1:n ) = Hwrk( i,1,1:n )
+ DO k=1,MIN(3,SIZE(Hwrk,1))
+ Tensor( k,1:n ) = Hwrk( k,1,1:n )
END DO
END IF
--
2.33.3

View File

@ -0,0 +1,36 @@
From 26601fec36a4978e805aad40e6d0cbf268c653d2 Mon Sep 17 00:00:00 2001
From: grindhold <grindhold@gmx.net>
Date: Thu, 28 Apr 2022 17:13:06 +0200
Subject: [PATCH] ignore qwt_compat
---
ElmerGUI/Application/src/convergenceview.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ElmerGUI/Application/src/convergenceview.h b/ElmerGUI/Application/src/convergenceview.h
index 377b644b..64250149 100755
--- a/ElmerGUI/Application/src/convergenceview.h
+++ b/ElmerGUI/Application/src/convergenceview.h
@@ -52,7 +52,7 @@
#include <qwt_plot_grid.h>
#include <qwt_legend.h>
/*#include <qwt_data.h> <-- deprecated in Qwt6, using qwt_compat.h instead*/
-#include <qwt_compat.h>
+/*#include <qwt_compat.h>*/
#include <qwt_text.h>
#include <qwt_scale_engine.h>
@@ -76,8 +76,8 @@ public:
private:
int d_count;
- QwtArray<double> d_x;
- QwtArray<double> d_y;
+ QVector<double> d_x;
+ QVector<double> d_y;
};
class Curve
--
2.33.3