unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Strange error when adding module gnu/packages/engineering
@ 2023-01-04 14:38 Reza Housseini
  2023-01-05  2:34 ` Csepp
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Reza Housseini @ 2023-01-04 14:38 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 3095 bytes --]

Hello Guixers

I'm in the process of adding a package to guix. When starting the build 
with ./pre-inst-env guix build openfoam-org I get the error:

error: tcc: unbound variable
hint: Did you forget a `use-modules' form?

error: googletest: unbound variable
hint: Did you forget a `use-modules' form?

error: bzip2: unbound variable
hint: Did you forget a `use-modules' form?

error: binutils: unbound variable
hint: Did you forget a `use-modules' form?

error: gcc-4.9: unbound variable
hint: Did you forget a `use-modules' form?

error: gnutls: unbound variable
hint: Did you forget a `use-modules' form?

error: xz: unbound variable
hint: Did you forget a `use-modules' form?

error: gnu-make: unbound variable
hint: Did you forget a `use-modules' form?

error: binutils: unbound variable
hint: Did you forget a `use-modules' form?

error: ffmpeg-5: unbound variable
hint: Did you forget a `use-modules' form?

Throw to key `unbound-variable' with args `("resolve-interface" "no 
binding `~A' in module ~A" (shared-mime-info (gnu packages gnome)) #f)'.
Backtrace:
In guix/store.scm:
    661:37 19 (thunk)
    1300:8 18 (call-with-build-handler #<procedure 7f6461f32f90 at g…> …)
In guix/scripts/build.scm:
     587:2 17 (_)
In srfi/srfi-1.scm:
    673:15 16 (append-map _ _ . _)
    586:17 15 (map1 ((argument . "openfoam-org") (build-mode . 0) # …))
In guix/scripts/build.scm:
    607:31 14 (_ _)
In gnu/packages.scm:
     479:2 13 (%find-package "openfoam-org" "openfoam-org" #f)
     364:6 12 (find-best-packages-by-name _ _)
    294:56 11 (_ "openfoam-org" _)
In unknown file:
           10 (force #<promise #<procedure 7f646440e7e0 at gnu/packag…>)
In gnu/packages.scm:
    241:33  9 (fold-packages #<procedure 7f6460c77528 at gnu/package…> …)
In guix/discovery.scm:
    159:11  8 (all-modules _ #:warn _)
In srfi/srfi-1.scm:
    460:18  7 (fold #<procedure 7f6464472880 at guix/discovery.scm:1…> …)
In guix/discovery.scm:
    149:19  6 (_ _ ())
     116:5  5 (scheme-modules _ _ #:warn _)
In srfi/srfi-1.scm:
    691:23  4 (filter-map #<procedure 7f6464472720 at guix/discove…> . #)
In guix/discovery.scm:
    124:24  3 (_ . _)
In guix/ui.scm:
     321:2  2 (report-unbound-variable-error _ #:frame _)
In ice-9/boot-9.scm:
   1685:16  1 (raise-exception _ #:continuable? _)
   1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" 
(unbound-variable "resolve-interface" "no binding `~A' in module ~A" 
(shared-mime-info (gnu packages gnome)) #f))'.

when removing the module gnu/packages/engineering.scm from the 
use-modules list the error disappears but I can't obviously not build 
the package without this dependency (cgns).

The package builds fine otherwise (inside another channel).

What I am doing wrong here?

Cheers,
Reza

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-04 14:38 Strange error when adding module gnu/packages/engineering Reza Housseini
@ 2023-01-05  2:34 ` Csepp
  2023-01-06 12:13   ` Reza Housseini
  2023-01-05 16:02 ` Maxim Cournoyer
  2023-01-05 16:52 ` Julien Lepiller
  2 siblings, 1 reply; 12+ messages in thread
From: Csepp @ 2023-01-05  2:34 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix


Reza Housseini <reza.housseini@gmail.com> writes:

> [[PGP Signed Part:Undecided]]
> Hello Guixers
>
> I'm in the process of adding a package to guix. When starting the
> build with ./pre-inst-env guix build openfoam-org I get the error:
>
> error: tcc: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: googletest: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: bzip2: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: binutils: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gcc-4.9: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gnutls: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: xz: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gnu-make: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: binutils: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: ffmpeg-5: unbound variable
> hint: Did you forget a `use-modules' form?
>
> Throw to key `unbound-variable' with args `("resolve-interface" "no
> binding `~A' in module ~A" (shared-mime-info (gnu packages gnome))
> #f)'.
> Backtrace:
> In guix/store.scm:
>    661:37 19 (thunk)
>    1300:8 18 (call-with-build-handler #<procedure 7f6461f32f90 at g…> …)
> In guix/scripts/build.scm:
>     587:2 17 (_)
> In srfi/srfi-1.scm:
>    673:15 16 (append-map _ _ . _)
>    586:17 15 (map1 ((argument . "openfoam-org") (build-mode . 0) # …))
> In guix/scripts/build.scm:
>    607:31 14 (_ _)
> In gnu/packages.scm:
>     479:2 13 (%find-package "openfoam-org" "openfoam-org" #f)
>     364:6 12 (find-best-packages-by-name _ _)
>    294:56 11 (_ "openfoam-org" _)
> In unknown file:
>           10 (force #<promise #<procedure 7f646440e7e0 at gnu/packag…>)
> In gnu/packages.scm:
>    241:33  9 (fold-packages #<procedure 7f6460c77528 at gnu/package…> …)
> In guix/discovery.scm:
>    159:11  8 (all-modules _ #:warn _)
> In srfi/srfi-1.scm:
>    460:18  7 (fold #<procedure 7f6464472880 at guix/discovery.scm:1…> …)
> In guix/discovery.scm:
>    149:19  6 (_ _ ())
>     116:5  5 (scheme-modules _ _ #:warn _)
> In srfi/srfi-1.scm:
>    691:23  4 (filter-map #<procedure 7f6464472720 at guix/discove…> . #)
> In guix/discovery.scm:
>    124:24  3 (_ . _)
> In guix/ui.scm:
>     321:2  2 (report-unbound-variable-error _ #:frame _)
> In ice-9/boot-9.scm:
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> Throw to key `match-error' with args `("match" "no matching pattern"
> (unbound-variable "resolve-interface" "no binding `~A' in module ~A"
> (shared-mime-info (gnu packages gnome)) #f))'.
>
> when removing the module gnu/packages/engineering.scm from the
> use-modules list the error disappears but I can't obviously not build
> the package without this dependency (cgns).
>
> The package builds fine otherwise (inside another channel).
>
> What I am doing wrong here?
>
> Cheers,
> Reza

Just to rule out the obvious things:
did you perform a clean rebuild?
ie.: make clean, or git clean -fxd, the bootstrap, configure, make

Also could you send the patch containing your additions?

My guess is that the Guix feature that auto-suggests what module to
import when there is an unbound variable error is matching the list
caught from the exception but its patterns don't cover it.  Maybe it has
an extra element or something?

Also, getting the commit from git that yours builds on might be helpful.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-04 14:38 Strange error when adding module gnu/packages/engineering Reza Housseini
  2023-01-05  2:34 ` Csepp
@ 2023-01-05 16:02 ` Maxim Cournoyer
  2023-01-06 12:14   ` Reza Housseini
  2023-01-05 16:52 ` Julien Lepiller
  2 siblings, 1 reply; 12+ messages in thread
From: Maxim Cournoyer @ 2023-01-05 16:02 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix

Hello,

Reza Housseini <reza.housseini@gmail.com> writes:

> Hello Guixers
>
> I'm in the process of adding a package to guix. When starting the
> build with ./pre-inst-env guix build openfoam-org I get the error:
>
> error: tcc: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: googletest: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: bzip2: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: binutils: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gcc-4.9: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gnutls: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: xz: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: gnu-make: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: binutils: unbound variable
> hint: Did you forget a `use-modules' form?
>
> error: ffmpeg-5: unbound variable
> hint: Did you forget a `use-modules' form?

This looks like the kind of (misleading) error thrown when there are top
level dependency cycle problems.  These are not fun to debug.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-04 14:38 Strange error when adding module gnu/packages/engineering Reza Housseini
  2023-01-05  2:34 ` Csepp
  2023-01-05 16:02 ` Maxim Cournoyer
@ 2023-01-05 16:52 ` Julien Lepiller
  2023-01-06 12:15   ` Reza Housseini
  2 siblings, 1 reply; 12+ messages in thread
From: Julien Lepiller @ 2023-01-05 16:52 UTC (permalink / raw)
  To: help-guix, Reza Housseini

Hi Reza,

It's a bit hidden, but there's usually another error message on the line before the first unbound variable error. Hopefully, it should give you a better clue :)

Le 4 janvier 2023 15:38:45 GMT+01:00, Reza Housseini <reza.housseini@gmail.com> a écrit :
>Hello Guixers
>
>I'm in the process of adding a package to guix. When starting the build with ./pre-inst-env guix build openfoam-org I get the error:
>
>error: tcc: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: googletest: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: bzip2: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: binutils: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: gcc-4.9: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: gnutls: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: xz: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: gnu-make: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: binutils: unbound variable
>hint: Did you forget a `use-modules' form?
>
>error: ffmpeg-5: unbound variable
>hint: Did you forget a `use-modules' form?
>
>Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages gnome)) #f)'.
>Backtrace:
>In guix/store.scm:
>   661:37 19 (thunk)
>   1300:8 18 (call-with-build-handler #<procedure 7f6461f32f90 at g…> …)
>In guix/scripts/build.scm:
>    587:2 17 (_)
>In srfi/srfi-1.scm:
>   673:15 16 (append-map _ _ . _)
>   586:17 15 (map1 ((argument . "openfoam-org") (build-mode . 0) # …))
>In guix/scripts/build.scm:
>   607:31 14 (_ _)
>In gnu/packages.scm:
>    479:2 13 (%find-package "openfoam-org" "openfoam-org" #f)
>    364:6 12 (find-best-packages-by-name _ _)
>   294:56 11 (_ "openfoam-org" _)
>In unknown file:
>          10 (force #<promise #<procedure 7f646440e7e0 at gnu/packag…>)
>In gnu/packages.scm:
>   241:33  9 (fold-packages #<procedure 7f6460c77528 at gnu/package…> …)
>In guix/discovery.scm:
>   159:11  8 (all-modules _ #:warn _)
>In srfi/srfi-1.scm:
>   460:18  7 (fold #<procedure 7f6464472880 at guix/discovery.scm:1…> …)
>In guix/discovery.scm:
>   149:19  6 (_ _ ())
>    116:5  5 (scheme-modules _ _ #:warn _)
>In srfi/srfi-1.scm:
>   691:23  4 (filter-map #<procedure 7f6464472720 at guix/discove…> . #)
>In guix/discovery.scm:
>   124:24  3 (_ . _)
>In guix/ui.scm:
>    321:2  2 (report-unbound-variable-error _ #:frame _)
>In ice-9/boot-9.scm:
>  1685:16  1 (raise-exception _ #:continuable? _)
>  1685:16  0 (raise-exception _ #:continuable? _)
>
>ice-9/boot-9.scm:1685:16: In procedure raise-exception:
>Throw to key `match-error' with args `("match" "no matching pattern" (unbound-variable "resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages gnome)) #f))'.
>
>when removing the module gnu/packages/engineering.scm from the use-modules list the error disappears but I can't obviously not build the package without this dependency (cgns).
>
>The package builds fine otherwise (inside another channel).
>
>What I am doing wrong here?
>
>Cheers,
>Reza
>
>-- 
>Reza Housseini
>
>This message is signed with my GnuPG key:
>
>    C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-05  2:34 ` Csepp
@ 2023-01-06 12:13   ` Reza Housseini
  0 siblings, 0 replies; 12+ messages in thread
From: Reza Housseini @ 2023-01-06 12:13 UTC (permalink / raw)
  To: Csepp; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 717 bytes --]

> Just to rule out the obvious things:
> did you perform a clean rebuild?
> ie.: make clean, or git clean -fxd, the bootstrap, configure, make
> 
> Also could you send the patch containing your additions?
> 
> My guess is that the Guix feature that auto-suggests what module to
> import when there is an unbound variable error is matching the list
> caught from the exception but its patterns don't cover it.  Maybe it has
> an extra element or something?
> 
> Also, getting the commit from git that yours builds on might be helpful.

Thanks for the advice, will try it out!

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-05 16:02 ` Maxim Cournoyer
@ 2023-01-06 12:14   ` Reza Housseini
  2023-01-06 17:42     ` Maxim Cournoyer
  0 siblings, 1 reply; 12+ messages in thread
From: Reza Housseini @ 2023-01-06 12:14 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 334 bytes --]

> This looks like the kind of (misleading) error thrown when there are top
> level dependency cycle problems.  These are not fun to debug.

I thought maybe this is the problem, any advice how to debug?

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-05 16:52 ` Julien Lepiller
@ 2023-01-06 12:15   ` Reza Housseini
  0 siblings, 0 replies; 12+ messages in thread
From: Reza Housseini @ 2023-01-06 12:15 UTC (permalink / raw)
  To: Julien Lepiller, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 489 bytes --]


> It's a bit hidden, but there's usually another error message on the line 
> before the first unbound variable error. Hopefully, it should give you a 
> better clue :)

There is no other error above, this is all I got...
I had a missing include and indeed it showed up before all the unbound 
values, but in this case there is no other error message.

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-06 12:14   ` Reza Housseini
@ 2023-01-06 17:42     ` Maxim Cournoyer
  2023-01-07  9:05       ` reza.housseini
                         ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Maxim Cournoyer @ 2023-01-06 17:42 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix

Hi,

Reza Housseini <reza.housseini@gmail.com> writes:

>> This looks like the kind of (misleading) error thrown when there are top
>> level dependency cycle problems.  These are not fun to debug.
>
> I thought maybe this is the problem, any advice how to debug?

Thinking more about it, since this a new module, there shouldn't be any
recursive dependency problem.

Probably you are missing some #:use-module at the top of your new
module.  I'd start minimal and see what works, and evaluate the package
at the REPL for more accurate messages perhaps.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-06 17:42     ` Maxim Cournoyer
@ 2023-01-07  9:05       ` reza.housseini
  2023-01-08 20:20       ` Reza Housseini
  2023-03-22 20:36       ` Reza Housseini
  2 siblings, 0 replies; 12+ messages in thread
From: reza.housseini @ 2023-01-07  9:05 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix



>Thinking more about it, since this a new module, there shouldn't be any
>recursive dependency problem.
>
>Probably you are missing some #:use-module at the top of your new
>module.  I'd start minimal and see what works, and evaluate the package
>at the REPL for more accurate messages perhaps.
>

This package was building in a separate channel all fine. Porting it to guix this strange error appeared. Commentig out the module engineering gets rid of the error, but then I'm missing the dependency cgns to build the package. 
OK will try the repl if this gives me more informative error messages, at the moment I a bit stuck...


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-06 17:42     ` Maxim Cournoyer
  2023-01-07  9:05       ` reza.housseini
@ 2023-01-08 20:20       ` Reza Housseini
  2023-03-22 20:36       ` Reza Housseini
  2 siblings, 0 replies; 12+ messages in thread
From: Reza Housseini @ 2023-01-08 20:20 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 713 bytes --]

> Probably you are missing some #:use-module at the top of your new
> module.  I'd start minimal and see what works, and evaluate the package
> at the REPL for more accurate messages perhaps.

Really strange, I started a guix repl and did

,use (guix)
,use (gnu packages simulation)
,build openfoam-org

and everything works, but when I do

./pre-inst-env guix build openfoam-org

the build fails with the aforementioned error. Any idea what the problem 
is here? Could anybody try this on their side, the patch is attached to 
this email.

Thanks and kind regards,

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52


[-- Attachment #1.1.2: openfoam-org-10.20221128.patch --]
[-- Type: text/x-patch, Size: 89433 bytes --]

From 569bee058047abe6f05d08713c3e22c1236ab54d Mon Sep 17 00:00:00 2001
From: Reza Housseini <reza.housseini@gmail.com>
Date: Tue, 3 Jan 2023 16:59:59 +0100
Subject: [PATCH 1/3] gnu: Add ftest.

---
 gnu/packages/check.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index aaa41777dc..808ad9ab4c 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -41,6 +41,7 @@
 ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2023 Reza Housseini <reza@housseini.me>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -63,6 +64,7 @@ (define-module (gnu packages check)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -87,6 +89,7 @@ (define-module (gnu packages check)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
@@ -3455,3 +3458,32 @@ (define-public python-pytest-regressions
 tables by saving expected data in a data directory (courtesy of pytest-datadir)
 that can be used to verify that future runs produce the same data.")
     (license license:expat)))
+
+(define-public ftest
+  (package
+    (name "ftest")
+    (version "bf75576064fce2e07f52cd63a3e410f12358728b")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/nemtrif/ftest")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "01yjhjnlq2gci8hkc6favwj0axq7y1vvnradsgcffby6h09x00b4"))))
+    (build-system copy-build-system)
+    (native-inputs (list cmake-minimal))
+    (arguments
+     `(#:install-plan '(("ftest.h" "include/ftest/"))
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'check
+                    (lambda _
+                      (with-directory-excursion "tests"
+                        (invoke "cmake" ".")
+                        (invoke "make")
+                        (invoke "ctest")))))))
+    (home-page "https://github.com/nemtrif/ftest")
+    (synopsis "Simple and limited unit-test framework for C++")
+    (description "A simple and limited unit-test framework for C++")
+    (license license:asl2.0)))
-- 
2.38.1


From a3be903bb10e726940d57ae43a3e22072f73c3bd Mon Sep 17 00:00:00 2001
From: Reza Housseini <reza.housseini@gmail.com>
Date: Tue, 3 Jan 2023 21:50:33 +0100
Subject: [PATCH 2/3] gnu: utfcpp: Update to 3.2.3.

---
 gnu/packages/textutils.scm | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 151add964e..0a4a9e61ff 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com>
 ;;; Copyright © 2022 Gabriel Wicki <gabriel@erlikon.ch>
+;;; Copyright © 2023 Reza Housseini <reza@housseini.me>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,6 +58,7 @@ (define-module (gnu packages textutils)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages golang)
@@ -672,30 +674,31 @@ (define-public catdoc
 (define-public utfcpp
   (package
     (name "utfcpp")
-    (version "2.3.5")
+    (version "3.2.3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/nemtrif/utfcpp")
-                     (commit (string-append "v" version))))
+                    (url "https://github.com/nemtrif/utfcpp")
+                    (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1gr98d826z6wa58r1s5i7rz7q2x3r31v7zj0pjjlrc7gfxwklr4s"))))
+                "00hzh39iddbc6nxg13813qd6d55g2kccwjf5dr96wykfhway9wbr"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          ;; delete bundled dependencies
+                          (delete-file-recursively "extern")
+                          (substitute* (list "tests/apitests.cpp"
+                                             "tests/noexceptionstests.cpp"
+                                             "tests/test_cpp11.cpp"
+                                             "tests/test_cpp17.cpp")
+                            (("\"\\.\\./extern/ftest/ftest.h\"")
+                             "<ftest/ftest.h>"))))))
     (build-system cmake-build-system)
+    (native-inputs (list ftest))
     (arguments
-     `(#:out-of-source? #f
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'install              ; no install target
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (include (string-append out "/include"))
-                    (doc (string-append out "/share/doc/" ,name)))
-               (copy-recursively "source" include)
-               (install-file "README.md" doc)
-               #t))))))
-    (home-page "https://github.com/nemtrif/utfcpp")
+     `(#:build-type "Release"))
+    (home-page "https://utfcpp.sourceforge.net")
     (synopsis "Portable C++ library for handling UTF-8")
     (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
 in a portable way.")
-- 
2.38.1


From 20f64b715f24cd2ef8d8a97efc7b892d4dda8cb9 Mon Sep 17 00:00:00 2001
From: Reza Housseini <reza.housseini@gmail.com>
Date: Sun, 8 Jan 2023 21:16:49 +0100
Subject: [PATCH 3/3] gnu: Replace openfoam with openfoam-org.

---
 .../patches/openfoam-org-10-cleanup.patch     | 1601 +++++++++++++++++
 gnu/packages/simulation.scm                   |  372 ++--
 2 files changed, 1858 insertions(+), 115 deletions(-)
 create mode 100644 gnu/packages/patches/openfoam-org-10-cleanup.patch

diff --git a/gnu/packages/patches/openfoam-org-10-cleanup.patch b/gnu/packages/patches/openfoam-org-10-cleanup.patch
new file mode 100644
index 0000000000..6eb657bfb8
--- /dev/null
+++ b/gnu/packages/patches/openfoam-org-10-cleanup.patch
@@ -0,0 +1,1601 @@
+From a1958c27fd69c20916065e848c9526a29192590e Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:15:22 +0100
+Subject: [PATCH 01/13] chore: fix CGAL and Boost dependencies
+
+---
+ etc/config.sh/CGAL | 19 ++-----------------
+ 1 file changed, 2 insertions(+), 17 deletions(-)
+
+diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL
+index 0fec802a0..d80278bcb 100644
+--- a/etc/config.sh/CGAL
++++ b/etc/config.sh/CGAL
+@@ -39,22 +39,7 @@
+ #
+ #------------------------------------------------------------------------------
+ 
+-boost_version=boost-system
+-#boost_version=boost-1.55.0
+-#boost_version=boost-1.72.0
+-
+-cgal_version=cgal-system
+-#cgal_version=CGAL-4.10
+-#cgal_version=CGAL-5.0.2
+-
+-if [ "$boost_version" != "boost-system" ]
+-then
+-    export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/$boost_version
+-fi
+-
+-if [ "$cgal_version" != "cgal-system" ]
+-then
+-    export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/$cgal_version
+-fi
++export CGAL_ARCH_PATH=$CGAL_ROOT
++export BOOST_ARCH_PATH=$BOOST_ROOT
+ 
+ #------------------------------------------------------------------------------
+-- 
+2.38.1
+
+
+From 06a6f8587daf3e81d3b55c3b47e1606de5a3d1d2 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:15:44 +0100
+Subject: [PATCH 02/13] chore: fix gperftools dependecy
+
+---
+ etc/config.sh/gperftools | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/etc/config.sh/gperftools b/etc/config.sh/gperftools
+index f9cdb8533..41aea7802 100644
+--- a/etc/config.sh/gperftools
++++ b/etc/config.sh/gperftools
+@@ -29,13 +29,6 @@
+ #
+ #------------------------------------------------------------------------------
+ 
+-version=svn
+-gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
+-
+-GPERFTOOLS_VERSION=gperftools-$version
+-GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
+-
+-export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH
+-export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH
++export GPERFTOOLS_ARCH_PATH=$GPERFTOOLS_ROOT
+ 
+ #------------------------------------------------------------------------------
+-- 
+2.38.1
+
+
+From ca42aa17d1a9cf75dd197886351012d8d52b7b54 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:16:13 +0100
+Subject: [PATCH 03/13] chore: fix metis dependency
+
+---
+ etc/config.sh/metis | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/etc/config.sh/metis b/etc/config.sh/metis
+index 40ef6aa0f..d04d5ea32 100644
+--- a/etc/config.sh/metis
++++ b/etc/config.sh/metis
+@@ -34,7 +34,7 @@
+ #
+ #------------------------------------------------------------------------------
+ 
+-export METIS_VERSION=metis-5.1.0
+-export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
++export METIS_VERSION=metis-$METISVERSION
++export METIS_ARCH_PATH=$METIS_ROOT
+ 
+ #------------------------------------------------------------------------------
+-- 
+2.38.1
+
+
+From 6c4801f8274391c2926ee6792dc3f8fbd3d67c73 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:17:08 +0100
+Subject: [PATCH 04/13] chore: fix mpi dependency
+
+---
+ etc/config.sh/mpi                             | 233 +-----------------
+ .../decompose/ptscotchDecomp/Make/options     |   2 +-
+ 2 files changed, 11 insertions(+), 224 deletions(-)
+
+diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi
+index b368cc51a..79efff92d 100644
+--- a/etc/config.sh/mpi
++++ b/etc/config.sh/mpi
+@@ -30,234 +30,21 @@
+ #
+ #------------------------------------------------------------------------------
+ 
+-unset MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
++export FOAM_MPI=openmpi-$OPENMPIVERSION
++# Optional configuration tweaks:
++_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
+ 
+-case "$WM_MPLIB" in
+-SYSTEMOPENMPI)
+-    # Use the system installed openmpi, get library directory via mpicc
+-    export FOAM_MPI=openmpi-system
++export MPI_ARCH_PATH=$OPENMPI_ROOT
+ 
+-    # Undefine OPAL_PREFIX if set to one of the paths on foamOldDirs
+-    if [ -z "$($foamClean "$OPAL_PREFIX" "$foamOldDirs")" ]
+-    then
+-        unset OPAL_PREFIX
+-    fi
++# Tell OpenMPI where to find its install directory
++export OPAL_PREFIX=$MPI_ARCH_PATH
+ 
+-    libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
++_foamAddPath    $MPI_ARCH_PATH/bin
+ 
+-    # Bit of a hack: strip off 'lib' and hope this is the path to openmpi
+-    # include files and libraries.
+-    export MPI_ARCH_PATH="${libDir%/*}"
++# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
++_foamAddLib     $MPI_ARCH_PATH/lib
+ 
+-    _foamAddLib     $libDir
+-    unset libDir
+-    ;;
+-
+-OPENMPI)
+-    export FOAM_MPI=openmpi-2.1.1
+-    # Optional configuration tweaks:
+-    _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
+-
+-    export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
+-
+-    # Tell OpenMPI where to find its install directory
+-    export OPAL_PREFIX=$MPI_ARCH_PATH
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-
+-    # 64-bit on OpenSuSE 12.1 uses lib64 others use lib
+-    _foamAddLib     $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
+-    _foamAddLib     $MPI_ARCH_PATH/lib
+-
+-    _foamAddMan     $MPI_ARCH_PATH/share/man
+-    ;;
+-
+-SYSTEMMPI)
+-    export FOAM_MPI=mpi-system
+-
+-    if [ -z "$MPI_ROOT" ]
+-    then
+-        echo 1>&2
+-        echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-        echo "    Please set the environment variable MPI_ROOT to point to" \
+-             " the base folder for the system MPI in use." 1>&2
+-        echo "    Example:" 1>&2
+-        echo 1>&2
+-        echo "        export MPI_ROOT=/opt/mpi" 1>&2
+-        echo 1>&2
+-    else
+-        export MPI_ARCH_PATH=$MPI_ROOT
+-
+-        if [ -z "$MPI_ARCH_FLAGS" ]
+-        then
+-            echo 1>&2
+-            echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-            echo "    MPI_ARCH_FLAGS is not set. Example:" 1>&2
+-            echo 1>&2
+-            echo "        export MPI_ARCH_FLAGS=\"-DOMPI_SKIP_MPICXX\"" 1>&2
+-            echo 1>&2
+-        fi
+-
+-        if [ -z "$MPI_ARCH_INC" ]
+-        then
+-            echo 1>&2
+-            echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-            echo "    MPI_ARCH_INC is not set. Example:" 1>&2
+-            echo 1>&2
+-            echo "        export MPI_ARCH_INC=\"-isystem \$MPI_ROOT/include\"" 1>&2
+-            echo 1>&2
+-        fi
+-
+-        if [ -z "$MPI_ARCH_LIBS" ]
+-        then
+-            echo 1>&2
+-            echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-            echo "    MPI_ARCH_LIBS is not set. Example:" 1>&2
+-            echo 1>&2
+-            echo "        export MPI_ARCH_LIBS=\"-L\$MPI_ROOT/lib -lmpi\"" 1>&2
+-            echo 1>&2
+-        fi
+-    fi
+-    ;;
+-
+-MPICH)
+-    export FOAM_MPI=mpich2-1.1.1p1
+-    export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI
+-    export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-
+-    # 64-bit on OpenSuSE 12.1 uses lib64 others use lib
+-    _foamAddLib     $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
+-    _foamAddLib     $MPI_ARCH_PATH/lib
+-
+-    _foamAddMan     $MPI_ARCH_PATH/share/man
+-    ;;
+-
+-MPICH-GM)
+-    export FOAM_MPI=mpich-gm
+-    export MPI_ARCH_PATH=/opt/mpi
+-    export MPICH_PATH=$MPI_ARCH_PATH
+-    export GM_LIB_PATH=/opt/gm/lib64
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-
+-    # 64-bit on OpenSuSE 12.1 uses lib64 others use lib
+-    _foamAddLib     $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
+-    _foamAddLib     $MPI_ARCH_PATH/lib
+-
+-    _foamAddLib     $GM_LIB_PATH
+-    ;;
+-
+-MV2MPI)
+-    export FOAM_MPI=mvapich2
+-    libDir=`mpicc -show -cc= | sed -e 's/.*-L\([^ ]*\).*/\1/'`
+-    export MPI_ARCH_PATH="${libDir%/*}"
+-    _foamAddLib $libDir
+-    unset libDir
+-    ;;
+-
+-HPMPI)
+-    export FOAM_MPI=hpmpi
+-    export MPI_HOME=/opt/hpmpi
+-    export MPI_ARCH_PATH=$MPI_HOME
+-
+-    _foamAddPath $MPI_ARCH_PATH/bin
+-
+-    case `uname -m` in
+-    i686)
+-        _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
+-        ;;
+-
+-    x86_64)
+-        _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
+-        ;;
+-    *)
+-        echo Unknown processor type `uname -m` 1>&2
+-        ;;
+-    esac
+-    ;;
+-
+-MPI)
+-    export FOAM_MPI=mpi
+-    export MPI_ARCH_PATH=/opt/mpi
+-    ;;
+-
+-FJMPI)
+-    export FOAM_MPI=fjmpi
+-    export MPI_ARCH_PATH=/opt/FJSVmpi2
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-    _foamAddLib     $MPI_ARCH_PATH/lib/sparcv9
+-    _foamAddLib     /opt/FSUNf90/lib/sparcv9
+-    _foamAddLib     /opt/FJSVpnidt/lib
+-    ;;
+-
+-QSMPI)
+-    export FOAM_MPI=qsmpi
+-    export MPI_ARCH_PATH=/usr/lib/mpi
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-    _foamAddLib     $MPI_ARCH_PATH/lib
+-    ;;
+-
+-SGIMPI)
+-    # No trailing slash
+-    [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"
+-
+-    export FOAM_MPI="${MPI_ROOT##*/}"
+-    export MPI_ARCH_PATH=$MPI_ROOT
+-
+-    if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
+-    then
+-        echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-        echo "    MPI_ROOT not a valid mpt installation directory or ending" \
+-             " in a '/'." 1>&2
+-        echo "    Please set MPI_ROOT to the mpt installation directory." 1>&2
+-        echo "    MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
+-    fi
+-
+-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
+-    then
+-        echo "Using SGI MPT:" 1>&2
+-        echo "    MPI_ROOT : $MPI_ROOT" 1>&2
+-        echo "    FOAM_MPI : $FOAM_MPI" 1>&2
+-    fi
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin
+-    _foamAddLib     $MPI_ARCH_PATH/lib
+-    ;;
+-
+-INTELMPI)
+-    # No trailing slash
+-    [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"
+-
+-    export FOAM_MPI="${MPI_ROOT##*/}"
+-    export MPI_ARCH_PATH=$MPI_ROOT
+-
+-    if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
+-    then
+-        echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
+-        echo "    MPI_ROOT not a valid mpt installation directory or ending" \
+-             " in a '/'." 1>&2
+-        echo "    Please set MPI_ROOT to the mpt installation directory." 1>&2
+-        echo "    MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
+-    fi
+-
+-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
+-    then
+-        echo "Using INTEL MPI:" 1>&2
+-        echo "    MPI_ROOT : $MPI_ROOT" 1>&2
+-        echo "    FOAM_MPI : $FOAM_MPI" 1>&2
+-    fi
+-
+-    _foamAddPath    $MPI_ARCH_PATH/bin64
+-    _foamAddLib     $MPI_ARCH_PATH/lib/release
+-    ;;
+-*)
+-    export FOAM_MPI=dummy
+-    ;;
+-esac
++_foamAddMan     $MPI_ARCH_PATH/share/man
+ 
+ # Add (non-dummy) MPI implementation
+ # Dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
+diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
+index 2af0fddac..00eb03bff 100644
+--- a/src/parallel/decompose/ptscotchDecomp/Make/options
++++ b/src/parallel/decompose/ptscotchDecomp/Make/options
+@@ -10,7 +10,7 @@ EXE_INC = \
+ 
+ LIB_LIBS = \
+     -L$(SCOTCH_ARCH_PATH)/lib \
+-    -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \
++    -L$(MPI_ARCH_PATH)/lib \
+     -lptscotch \
+     -lptscotcherrexit \
+     -lscotch \
+-- 
+2.38.1
+
+
+From 6eef353c56ee4086389f4631cc83f24d34a1587c Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:19:45 +0100
+Subject: [PATCH 05/13] chore: fix scotch dependency
+
+---
+ etc/config.sh/scotch                               | 4 ++--
+ src/parallel/decompose/ptscotchDecomp/Make/options | 1 -
+ src/parallel/decompose/scotchDecomp/Make/options   | 2 --
+ 3 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/etc/config.sh/scotch b/etc/config.sh/scotch
+index a345a2d00..39266deda 100644
+--- a/etc/config.sh/scotch
++++ b/etc/config.sh/scotch
+@@ -37,7 +37,7 @@
+ #
+ #------------------------------------------------------------------------------
+ 
+-export SCOTCH_VERSION=scotch_6.0.9
+-export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
++export SCOTCH_VERSION=scotch_$PT_SCOTCH32VERSION
++export SCOTCH_ARCH_PATH=$PT_SCOTCH32_ROOT
+ 
+ #------------------------------------------------------------------------------
+diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
+index 00eb03bff..993f9f2aa 100644
+--- a/src/parallel/decompose/ptscotchDecomp/Make/options
++++ b/src/parallel/decompose/ptscotchDecomp/Make/options
+@@ -5,7 +5,6 @@ EXE_INC = \
+     -I$(FOAM_SRC)/Pstream/mpi/lnInclude \
+     -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
+     -I$(SCOTCH_ARCH_PATH)/include \
+-    -I/usr/include/scotch \
+     -I../decompositionMethods/lnInclude
+ 
+ LIB_LIBS = \
+diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options
+index 038f88d5f..f57b8ee14 100644
+--- a/src/parallel/decompose/scotchDecomp/Make/options
++++ b/src/parallel/decompose/scotchDecomp/Make/options
+@@ -6,12 +6,10 @@
+ EXE_INC = \
+     $(PFLAGS) $(PINC) \
+     -I$(SCOTCH_ARCH_PATH)/include \
+-    -I/usr/include/scotch \
+     -I../decompositionMethods/lnInclude
+ 
+ LIB_LIBS = \
+     -L$(SCOTCH_ARCH_PATH)/lib \
+-    -L$(FOAM_EXT_LIBBIN) \
+     -lscotch \
+     -lscotcherrexit \
+     -lrt
+-- 
+2.38.1
+
+
+From 564e1c51f496666e057c28a6c3eb4512e9adf8b4 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:20:49 +0100
+Subject: [PATCH 06/13] chore: fix GMP and MPFR dependency
+
+---
+ etc/config.sh/settings   | 3 +++
+ wmake/rules/General/CGAL | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/etc/config.sh/settings b/etc/config.sh/settings
+index d48896bac..3067d4608 100644
+--- a/etc/config.sh/settings
++++ b/etc/config.sh/settings
+@@ -290,6 +290,9 @@ OpenFOAM | ThirdParty)
+     ;;
+ system)
+     # Use system compiler
++    # Use system GMP and MPFR packages
++    export GMP_ARCH_PATH=$GMP_ROOT
++    export MPFR_ARCH_PATH=$MPFR_ROOT
+     ;;
+ *)
+     echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2
+diff --git a/wmake/rules/General/CGAL b/wmake/rules/General/CGAL
+index 4c574c283..1c6d3b55d 100644
+--- a/wmake/rules/General/CGAL
++++ b/wmake/rules/General/CGAL
+@@ -8,7 +8,7 @@ CGAL_INC = \
+     $(if $(CGAL_ARCH_PATH),-I$(CGAL_ARCH_PATH)/include,-I/usr/include)
+ 
+ CGAL_LIBS = \
+-    $(if $(GMP_ARCH_PATH),-L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH),) \
++    $(if $(GMP_ARCH_PATH),-L$(GMP_ARCH_PATH)/lib,) \
+     -lgmp \
+-    $(if $(MPFR_ARCH_PATH),-L$(MPFR_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH),) \
++    $(if $(MPFR_ARCH_PATH),-L$(MPFR_ARCH_PATH)/lib,) \
+     -lmpfr
+-- 
+2.38.1
+
+
+From 579f94cfac2867d9875b2254d122e465ccc5d6b0 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:21:32 +0100
+Subject: [PATCH 07/13] build: add LDFLAGS environment variable to compile step
+
+---
+ wmake/rules/linux64Gcc/c++ | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++
+index 9ba6ce377..3ced6c9fb 100644
+--- a/wmake/rules/linux64Gcc/c++
++++ b/wmake/rules/linux64Gcc/c++
+@@ -22,8 +22,8 @@ cpptoo      = $(Ctoo)
+ 
+ LINK_LIBS   = $(c++DBUG)
+ 
+-LINKLIBSO   = $(CC) $(c++FLAGS) -fuse-ld=bfd -shared \
++LINKLIBSO   = $(CC) $(c++FLAGS) $(LDFLAGS) -fuse-ld=bfd -shared \
+               -Xlinker --add-needed -Xlinker --no-as-needed
+ 
+-LINKEXE     = $(CC) $(c++FLAGS) -fuse-ld=bfd \
++LINKEXE     = $(CC) $(c++FLAGS) $(LDFLAGS) -fuse-ld=bfd \
+               -Xlinker --add-needed -Xlinker --no-as-needed
+-- 
+2.38.1
+
+
+From e5007b8b65c459c256dcb1700453ba608bc111fe Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:22:25 +0100
+Subject: [PATCH 08/13] fix: wrong symbolic link path
+
+---
+ tutorials/mesh/snappyHexMesh/iglooWithFridges | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridges b/tutorials/mesh/snappyHexMesh/iglooWithFridges
+index 3d18de2c2..ef42b45b3 120000
+--- a/tutorials/mesh/snappyHexMesh/iglooWithFridges
++++ b/tutorials/mesh/snappyHexMesh/iglooWithFridges
+@@ -1 +1 @@
+-../../heatTransfer/buoyantSimpleFoam/iglooWithFridges
+\ No newline at end of file
++../../heatTransfer/buoyantFoam/iglooWithFridges
+\ No newline at end of file
+-- 
+2.38.1
+
+
+From 448f3b83c782c6f28a8b028793f10a178e10db73 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:23:47 +0100
+Subject: [PATCH 09/13] chore: fix gnuplot dependency
+
+---
+ applications/test/Distribution2/createGraphs                | 2 +-
+ .../test/rigidBodyDynamics/Test-rigidBodyDynamics.C         | 2 +-
+ bin/foamMonitor                                             | 4 ++--
+ bin/tools/HookFunctions                                     | 2 +-
+ etc/bashrc                                                  | 2 ++
+ .../graph/writers/gnuplotGraph/gnuplotGraph.H               | 2 +-
+ src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H  | 2 +-
+ .../waterAndIsopropanolEvaporation/Allrun                   | 2 +-
+ .../interfaceComposition/waterEvaporation/Allrun            | 2 +-
+ .../populationBalance/binaryBreakup/validation/createGraphs | 4 ++--
+ .../populationBalance/breakup/validation/createGraphs       | 4 ++--
+ .../populationBalance/coalescence/validation/createGraphs   | 4 ++--
+ .../populationBalance/drift/validation/createGraphs         | 4 ++--
+ .../isothermalGrowth/validation/createGraphs                | 4 ++--
+ .../populationBalance/negativeDrift/validation/createGraphs | 4 ++--
+ .../validation/createGraphs                                 | 4 ++--
+ .../multiphaseEulerFoam/thermal/waterEvaporation/Allrun     | 2 +-
+ tutorials/combustion/chemFoam/gri/validation/createGraph    | 4 ++--
+ tutorials/combustion/chemFoam/h2/validation/createGraph     | 4 ++--
+ tutorials/combustion/chemFoam/ic8h18/validation/createGraph | 4 ++--
+ .../combustion/chemFoam/ic8h18_TDAC/validation/createGraph  | 4 ++--
+ tutorials/combustion/chemFoam/nc7h16/validation/createGraph | 4 ++--
+ .../rhoPimpleFoam/laminar/helmholtzResonance/Allrun         | 2 +-
+ .../buoyantFoam/buoyantCavity/validation/createGraphs       | 6 +++---
+ .../boundaryFoam/boundaryWallFunctionsProfile/Allrun        | 4 ++--
+ .../incompressible/pimpleFoam/RAS/ballValve/createGraphs    | 4 ++--
+ .../pimpleFoam/laminar/nonConformalChannel/Allrun           | 2 +-
+ .../laminar/planarPoiseuille/validation/createGraph         | 4 ++--
+ .../incompressible/simpleFoam/T3A/validation/createGraphs   | 4 ++--
+ .../simpleFoam/roomResidenceTime/validation/Allrun          | 2 +-
+ .../RAS/Grossetete/validation/createGraphs                  | 4 ++--
+ .../RAS/bubblePipe/validation/createGraphs                  | 6 +++---
+ .../RAS/pipeBend/validation/createGraphs                    | 6 +++---
+ .../RAS/wallBoiling/validation/createGraphs                 | 4 ++--
+ .../RAS/wallBoilingIATE/validation/createGraphs             | 4 ++--
+ .../RAS/wallBoilingPolydisperse/validation/createGraphs     | 4 ++--
+ .../validation/createGraphs                                 | 4 ++--
+ .../laminar/titaniaSynthesis/validation/createGraphs        | 6 +++---
+ .../laminar/titaniaSynthesisSurface/validation/createGraphs | 6 +++---
+ 39 files changed, 72 insertions(+), 70 deletions(-)
+
+diff --git a/applications/test/Distribution2/createGraphs b/applications/test/Distribution2/createGraphs
+index bbcb522f0..58b9c0388 100755
+--- a/applications/test/Distribution2/createGraphs
++++ b/applications/test/Distribution2/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,15"
+     set output 'comparison.eps'
+     set multiplot layout 2, 1
+diff --git a/applications/test/rigidBodyDynamics/Test-rigidBodyDynamics.C b/applications/test/rigidBodyDynamics/Test-rigidBodyDynamics.C
+index c13edfe73..1b2dbe689 100644
+--- a/applications/test/rigidBodyDynamics/Test-rigidBodyDynamics.C
++++ b/applications/test/rigidBodyDynamics/Test-rigidBodyDynamics.C
+@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
+     }
+     dataFile<< endl;
+     animationFile
+-        << "#!/usr/bin/env gnuplot" << endl << endl
++        << "$GNUPLOT" << endl << endl
+         << "$data << end" << endl;
+ 
+     // Run the RBD simulation
+diff --git a/bin/foamMonitor b/bin/foamMonitor
+index 32b62d792..def3d902a 100755
+--- a/bin/foamMonitor
++++ b/bin/foamMonitor
+@@ -98,7 +98,7 @@ title="Data Monitoring"
+ size=""
+ gpterminal='x11 1 font "helvetica,17" linewidth 1.5 persist noraise'
+ 
+-command -v gnuplot >/dev/null 2>&1 || error "Gnuplot not installed"
++command -v $GNUPLOT >/dev/null 2>&1 || error "Gnuplot not installed"
+ 
+ # parse options
+ while [ "$#" -gt 0 ]
+@@ -197,7 +197,7 @@ done
+ plotFileFooter >> "$gp_file"
+ 
+ touch "$file"
+-gnuplot "$gp_file" &
++$GNUPLOT "$gp_file" &
+ pid=$!
+ 
+ while true
+diff --git a/bin/tools/HookFunctions b/bin/tools/HookFunctions
+index 47af55043..193e4fc03 100644
+--- a/bin/tools/HookFunctions
++++ b/bin/tools/HookFunctions
+@@ -391,7 +391,7 @@ checkBanner() # scope, files...
+                         errorMessages+=("$file")
+                     fi
+                     ;;
+-                (''|awk|csh|gnuplot|sed|sh)
++                (''|awk|csh|$GNUPLOT|sed|sh)
+                     if ! git show $scopeShow"$file" | pcregrep -q -M "$scriptBanner"
+                     then
+                         ((++errorCount))
+diff --git a/etc/bashrc b/etc/bashrc
+index 663993951..c93e47974 100644
+--- a/etc/bashrc
++++ b/etc/bashrc
+@@ -229,3 +229,5 @@ unset cleaned foamClean foamOldDirs
+ [ "$BASH" ] && . $WM_PROJECT_DIR/etc/config.sh/bash_completion
+ 
+ #------------------------------------------------------------------------------
++
++export GNUPLOT=gnuplot
+diff --git a/src/randomProcesses/graph/writers/gnuplotGraph/gnuplotGraph.H b/src/randomProcesses/graph/writers/gnuplotGraph/gnuplotGraph.H
+index 9c2df4377..95d940285 100644
+--- a/src/randomProcesses/graph/writers/gnuplotGraph/gnuplotGraph.H
++++ b/src/randomProcesses/graph/writers/gnuplotGraph/gnuplotGraph.H
+@@ -54,7 +54,7 @@ class gnuplotGraph
+ public:
+ 
+     //- Runtime type information
+-    TypeName("gnuplot");
++    TypeName("$GNUPLOT");
+ 
+     //- FileName extension  for this graph format
+     static const word ext_;
+diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H
+index b8e031085..f358f869d 100644
+--- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H
++++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H
+@@ -53,7 +53,7 @@ class gnuplotSetWriter
+ public:
+ 
+     //- Runtime type information
+-    TypeName("gnuplot");
++    TypeName("$GNUPLOT");
+ 
+ 
+     // Constructors
+diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun
+index 9dfacf68e..19e8a825a 100755
+--- a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun
++++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun
+@@ -31,7 +31,7 @@ do
+     done
+ done
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ 
+ set terminal eps enhanced size 5.83,8.27
+ set output 'postProcessing.eps'
+diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun
+index 9641b9c49..377009f46 100755
+--- a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun
++++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun
+@@ -64,7 +64,7 @@ do
+     done
+ done
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ 
+ set terminal eps enhanced size 5.83,8.27
+ set output 'postProcessing.eps'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/binaryBreakup/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/binaryBreakup/validation/createGraphs
+index 673b293c7..7bfee48c3 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/binaryBreakup/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/binaryBreakup/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../numberDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/breakup/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/breakup/validation/createGraphs
+index 673b293c7..7bfee48c3 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/breakup/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/breakup/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../numberDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/coalescence/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/coalescence/validation/createGraphs
+index 2f9808388..fba7ed5f7 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/coalescence/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/coalescence/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../numberDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs
+index ddb779992..b0c11ad36 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../numberDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/isothermalGrowth/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/isothermalGrowth/validation/createGraphs
+index 843ccf677..923932605 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/isothermalGrowth/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/isothermalGrowth/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../d.air_y.eps'
+ 
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/negativeDrift/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/negativeDrift/validation/createGraphs
+index bae86a939..6047f55d3 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/negativeDrift/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/negativeDrift/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../numberDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/simultaneousCoalescenceAndBreakup/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/simultaneousCoalescenceAndBreakup/validation/createGraphs
+index da0e70401..7840728f5 100755
+--- a/test/multiphase/multiphaseEulerFoam/populationBalance/simultaneousCoalescenceAndBreakup/validation/createGraphs
++++ b/test/multiphase/multiphaseEulerFoam/populationBalance/simultaneousCoalescenceAndBreakup/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output '../probabilityDensity.eps'
+     set decimalsign '.'
+diff --git a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/Allrun b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/Allrun
+index 432ac9f2b..3a789aef0 100755
+--- a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/Allrun
++++ b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/Allrun
+@@ -38,7 +38,7 @@ do
+     done
+ done
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ 
+ set terminal eps enhanced size 5.83,8.27
+ set output 'postProcessing.eps'
+diff --git a/tutorials/combustion/chemFoam/gri/validation/createGraph b/tutorials/combustion/chemFoam/gri/validation/createGraph
+index d0fb9cc01..f3a350f24 100755
+--- a/tutorials/combustion/chemFoam/gri/validation/createGraph
++++ b/tutorials/combustion/chemFoam/gri/validation/createGraph
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helveicta,20"
+     set output "OF_vs_CHEMKINII.eps"
+     set xlabel "Time / [s]" font "Helveicta,24"
+diff --git a/tutorials/combustion/chemFoam/h2/validation/createGraph b/tutorials/combustion/chemFoam/h2/validation/createGraph
+index bbb36218f..0fc008261 100755
+--- a/tutorials/combustion/chemFoam/h2/validation/createGraph
++++ b/tutorials/combustion/chemFoam/h2/validation/createGraph
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output "OF_vs_CHEMKINII.eps"
+     set xlabel "Time / [s]" font "Helvetica,24"
+diff --git a/tutorials/combustion/chemFoam/ic8h18/validation/createGraph b/tutorials/combustion/chemFoam/ic8h18/validation/createGraph
+index 4606eac7d..43af24856 100755
+--- a/tutorials/combustion/chemFoam/ic8h18/validation/createGraph
++++ b/tutorials/combustion/chemFoam/ic8h18/validation/createGraph
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output "OF_vs_CHEMKINII.eps"
+     set xlabel "Time / [s]" font "Helvetica,24"
+diff --git a/tutorials/combustion/chemFoam/ic8h18_TDAC/validation/createGraph b/tutorials/combustion/chemFoam/ic8h18_TDAC/validation/createGraph
+index 901919282..218212998 100755
+--- a/tutorials/combustion/chemFoam/ic8h18_TDAC/validation/createGraph
++++ b/tutorials/combustion/chemFoam/ic8h18_TDAC/validation/createGraph
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output "OF_vs_CHEMKINII.eps"
+     set xlabel "Time / [s]" font "Helvetica,24"
+diff --git a/tutorials/combustion/chemFoam/nc7h16/validation/createGraph b/tutorials/combustion/chemFoam/nc7h16/validation/createGraph
+index b2f8a4d94..ad074b8e2 100755
+--- a/tutorials/combustion/chemFoam/nc7h16/validation/createGraph
++++ b/tutorials/combustion/chemFoam/nc7h16/validation/createGraph
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output "OF_vs_CHEMKINII.eps"
+     set xlabel "Time / [s]" font "Helvetica,24"
+diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
+index 6557c1075..5219a3efb 100755
+--- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
++++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
+@@ -31,7 +31,7 @@ run resolved
+ run modelled
+ 
+ # Plot a comparison of the pressure in the neck
+-cat << EOF | gnuplot -persist
++cat << EOF | $GNUPLOT -persist
+ 
+ set terminal postscript eps size 5,4 enhanced color
+ 
+diff --git a/tutorials/heatTransfer/buoyantFoam/buoyantCavity/validation/createGraphs b/tutorials/heatTransfer/buoyantFoam/buoyantCavity/validation/createGraphs
+index 625b87946..ba4cf4670 100755
+--- a/tutorials/heatTransfer/buoyantFoam/buoyantCavity/validation/createGraphs
++++ b/tutorials/heatTransfer/buoyantFoam/buoyantCavity/validation/createGraphs
+@@ -42,7 +42,7 @@ createEpsT()
+     OF=$2
+     EXPT=$3
+ 
+-    gnuplot<<EOF
++    $GNUPLOT<<EOF
+     set terminal postscript eps color enhanced
+     set output "OF_vs_EXPT_T$i.eps"
+     set xlabel "Channel width, x / [m]"
+@@ -66,7 +66,7 @@ createEpsU()
+     OF=$2
+     EXPT=$3
+ 
+-    gnuplot<<EOF
++    $GNUPLOT<<EOF
+     set terminal postscript eps color enhanced
+     set output "OF_vs_EXPT_U$i.eps"
+     set xlabel "Channel width, x / [m]"
+@@ -86,7 +86,7 @@ EOF
+ echo "createGraphs:"
+ 
+ # test if gnuplot exists on the system
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" >&2
+     exit 1
+diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun
+index 98d5a8635..4ff7fa9e9 100755
+--- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun
++++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun
+@@ -37,7 +37,7 @@ done
+ 
+ # create validation plot
+ # test if gnuplot exists on the system
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+@@ -46,7 +46,7 @@ fi
+ graphName="OF_vs_ANALYTICAL.eps"
+ 
+ echo "Creating graph of u+ vs y+ to $graphName"
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced
+     set output "$graphName"
+     set grid
+diff --git a/tutorials/incompressible/pimpleFoam/RAS/ballValve/createGraphs b/tutorials/incompressible/pimpleFoam/RAS/ballValve/createGraphs
+index 57e466f77..9f078e6d3 100755
+--- a/tutorials/incompressible/pimpleFoam/RAS/ballValve/createGraphs
++++ b/tutorials/incompressible/pimpleFoam/RAS/ballValve/createGraphs
+@@ -6,7 +6,7 @@ inletFlowRate=postProcessing/inletFlowRate/0/surfaceFieldValue.dat
+ lowerOutletFlowRate=postProcessing/lowerOutletFlowRate/0/surfaceFieldValue.dat
+ upperOutletFlowRate=postProcessing/upperOutletFlowRate/0/surfaceFieldValue.dat
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ set terminal postscript eps color enhanced
+ set output "flowRate.eps"
+ set xlabel "Time (s)"
+@@ -19,7 +19,7 @@ plot \
+     us 1:(\$2+\$4) w l t "Total Outlet"
+ EOF
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ set terminal postscript eps color enhanced
+ set output "error.eps"
+ set xlabel "Time (s)"
+diff --git a/tutorials/incompressible/pimpleFoam/laminar/nonConformalChannel/Allrun b/tutorials/incompressible/pimpleFoam/laminar/nonConformalChannel/Allrun
+index 970f45e67..e9524165e 100755
+--- a/tutorials/incompressible/pimpleFoam/laminar/nonConformalChannel/Allrun
++++ b/tutorials/incompressible/pimpleFoam/laminar/nonConformalChannel/Allrun
+@@ -33,7 +33,7 @@ outletFlowRateAMI=postProcessing/outletFlowRate.AMI/0/surfaceFieldValue.dat
+ inletFlowRateNonConformalCyclic=postProcessing/inletFlowRate.nonConformalCyclic/0/surfaceFieldValue.dat
+ outletFlowRateNonConformalCyclic=postProcessing/outletFlowRate.nonConformalCyclic/0/surfaceFieldValue.dat
+ 
+-gnuplot << EOF
++$GNUPLOT << EOF
+ set terminal postscript eps color enhanced
+ set output "error.eps"
+ set xlabel "Time (s)"
+diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/createGraph b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/createGraph
+index 53fee3647..06df26399 100755
+--- a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/createGraph
++++ b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/createGraph
+@@ -3,13 +3,13 @@
+ tail -n +4 ../postProcessing/probes/0/U  | \
+     tr -s " " | tr -d '(' | cut -d " " -f1-2 > ../Numerical.dat
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced "Helvetica,20"
+     set output "planarPoiseuille.eps"
+     set xlabel "Time / [s]" font "Helvetica,24"
+diff --git a/tutorials/incompressible/simpleFoam/T3A/validation/createGraphs b/tutorials/incompressible/simpleFoam/T3A/validation/createGraphs
+index e7a91615f..71b8d5f27 100755
+--- a/tutorials/incompressible/simpleFoam/T3A/validation/createGraphs
++++ b/tutorials/incompressible/simpleFoam/T3A/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo "gnuplot not found - skipping graph creation" >&2
+     exit 1
+@@ -8,7 +8,7 @@ fi
+ 
+ time=$(foamListTimes -case .. -latestTime)
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set term post enhanced color solid linewidth 2.0 20
+     set out "graphs.eps"
+     set encoding utf8
+diff --git a/tutorials/incompressible/simpleFoam/roomResidenceTime/validation/Allrun b/tutorials/incompressible/simpleFoam/roomResidenceTime/validation/Allrun
+index 9bf0240c8..914728a93 100755
+--- a/tutorials/incompressible/simpleFoam/roomResidenceTime/validation/Allrun
++++ b/tutorials/incompressible/simpleFoam/roomResidenceTime/validation/Allrun
+@@ -32,6 +32,6 @@ done < "ageValues"
+ paste positionsZ ageDimless2 > Pos2_OF
+ 
+ # ------ Plot the results
+-gnuplot plot*
++$GNUPLOT plot*
+ 
+ #------------------------------------------------------------------------------
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/validation/createGraphs
+index 69e308bbf..e768b6c84 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/validation/createGraphs
+@@ -1,12 +1,12 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+ fi
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+     set output '../void_fraction.eps'
+ 
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/validation/createGraphs
+index 354f3bbc1..7251cd4f8 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -10,7 +10,7 @@ time=$(foamListTimes -case .. -latestTime)
+ 
+ graphFile=../postProcessing/graph/$time/line.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+ 
+     set output '../void_fraction.eps'
+@@ -34,7 +34,7 @@ EOF
+ injectionFile=../postProcessing/probabilityDensity.injection/$time/probabilityDensity.injection.xy
+ outletFile=../postProcessing/probabilityDensity.outlet/$time/probabilityDensity.outlet.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+ 
+     set output '../volumeDensity.eps'
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/pipeBend/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/pipeBend/validation/createGraphs
+index 87f35b9ac..495a70746 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/pipeBend/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/pipeBend/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -15,7 +15,7 @@ afterBend7D=../postProcessing/probabilityDensity.afterBend_7d/$time/probabilityD
+ afterBend9D=../postProcessing/probabilityDensity.afterBend_9d/$time/probabilityDensity.afterBend_9d.xy
+ layerAverage=../postProcessing/graphCrossSection/$time/layerAverage.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+ 
+     set output '../volumeDensity.eps'
+@@ -31,7 +31,7 @@ gnuplot<<EOF
+          "$afterBend9D" u (\$1*1e6):(\$2) w histeps lw 3 lc rgb 'blue' t 'After bend: 9D'
+ EOF
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+ 
+     set output '../crossSectionAverageDiameter.eps'
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/validation/createGraphs
+index a33e21dec..21ae8273c 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -9,7 +9,7 @@ fi
+ graphFile=$(foamListTimes -latestTime)/line.xy
+ surfaceFile=$(cd postProcessing/inflow && ls -1tr */* | tail -n 1)
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+ 
+     set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
+     set output "./validation/$(basename "$PWD").eps"
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/validation/createGraphs
+index dcfceca79..d1ae68f9c 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -9,7 +9,7 @@ fi
+ graphFile=$(foamListTimes -latestTime)/line.xy
+ surfaceFile=$(cd postProcessing/inflow && ls -1tr */* | tail -n 1)
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+ 
+     set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
+     set output "./validation/$(basename "$PWD").eps"
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/validation/createGraphs
+index dcfceca79..d1ae68f9c 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -9,7 +9,7 @@ fi
+ graphFile=$(foamListTimes -latestTime)/line.xy
+ surfaceFile=$(cd postProcessing/inflow && ls -1tr */* | tail -n 1)
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+ 
+     set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
+     set output "./validation/$(basename "$PWD").eps"
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/validation/createGraphs
+index 82a2a0364..0e4870fdb 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -9,7 +9,7 @@ fi
+ graphFile=$(foamListTimes -latestTime)/line.xy
+ surfaceFile=$(cd postProcessing/inflow && ls -1tr */* | tail -n 1)
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+ 
+     set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
+     set output "./validation/$(basename "$PWD").eps"
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/validation/createGraphs
+index e93c7d850..16094a6a1 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -10,7 +10,7 @@ time=$(foamListTimes -case .. -latestTime)
+ 
+ graphFile=../postProcessing/graph/$time/line.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+     set output '../species.eps'
+ 
+@@ -29,7 +29,7 @@ EOF
+ 
+ resultFile=../postProcessing/numberDensity/$time/numberDensity.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+     set output '../sizeDistribution.eps'
+ 
+diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/validation/createGraphs b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/validation/createGraphs
+index e93c7d850..d9c4b668c 100755
+--- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/validation/createGraphs
++++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/validation/createGraphs
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+-if ! which gnuplot > /dev/null 2>&1
++if ! which $GNUPLOT > /dev/null 2>&1
+ then
+     echo 'gnuplot not found - skipping graph creation' >&2
+     exit 1
+@@ -10,7 +10,7 @@ time=$(foamListTimes -case .. -latestTime)
+ 
+ graphFile=../postProcessing/graph/$time/line.xy
+ 
+-gnuplot<<EOF
++$GNUPLOTt<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+     set output '../species.eps'
+ 
+@@ -29,7 +29,7 @@ EOF
+ 
+ resultFile=../postProcessing/numberDensity/$time/numberDensity.xy
+ 
+-gnuplot<<EOF
++$GNUPLOT<<EOF
+     set terminal postscript eps color enhanced font "Helvetica,20"
+     set output '../sizeDistribution.eps'
+ 
+-- 
+2.38.1
+
+
+From 384e1ace9024d375cb3de593598bc155270491af Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Wed, 30 Nov 2022 14:14:53 +0100
+Subject: [PATCH 10/13] chore: fix paraview dependency
+
+---
+ bin/paraFoam           |   9 +--
+ etc/config.sh/paraview | 142 +++++------------------------------------
+ 2 files changed, 18 insertions(+), 133 deletions(-)
+
+diff --git a/bin/paraFoam b/bin/paraFoam
+index 78911fdce..91b2681e8 100755
+--- a/bin/paraFoam
++++ b/bin/paraFoam
+@@ -63,9 +63,9 @@ error() {
+ pvExec () {
+     if [ "$ParaView_GL" = mesa ]
+     then
+-        LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_LIB_DIR/mesa paraview "$@"
++        LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_LIB_DIR/mesa $PARAVIEW "$@"
+     else
+-        paraview "$@"
++        $PARAVIEW "$@"
+     fi
+ }
+ 
+@@ -154,11 +154,6 @@ do
+     esac
+ done
+ 
+-# Check that reader module has been built
+-[ $requirePV -eq 1 ] && \
+-    ! [ -f "$PV_PLUGIN_PATH/libPVFoamReader_SM.so" ] && \
+-    noPVReader && exit 1
+-
+ # Check for --data=... argument
+ hasDataArg()
+ {
+diff --git a/etc/config.sh/paraview b/etc/config.sh/paraview
+index 97826c1ca..daa2719e8 100644
+--- a/etc/config.sh/paraview
++++ b/etc/config.sh/paraview
+@@ -33,137 +33,27 @@
+ #     are required for building plugins
+ #------------------------------------------------------------------------------
+ 
+-# Clean the PATH
+-cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
+-        "$ParaView_DIR \
+-         $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- \
+-         $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-" \
+-        ) \
+-        && PATH="$cleaned"
+-
+-# Determine the cmake to be used. Take the most recent.
+-unset CMAKE_HOME CMAKE_ROOT
+-for cmake in $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake-*
+-do
+-    if [ -d $cmake ]
+-    then
+-        if [ -z $CMAKE_HOME ] || \
+-            $WM_PROJECT_DIR/bin/tools/foamVersionCompare $CMAKE_HOME lt $cmake
+-        then
+-            export CMAKE_HOME=$cmake
+-            export CMAKE_ROOT=$cmake
+-        fi
+-    fi
+-done
+-if [ -n $CMAKE_HOME ]
+-then
+-    export PATH=$cmake/bin:$PATH
+-fi
+-
+ #- ParaView version, automatically determine major version
+-#export ParaView_VERSION=4.0.1
+-#export ParaView_VERSION=4.1.0
+-#export ParaView_VERSION=4.3.1
+-#export ParaView_VERSION=4.4.0
+-#export ParaView_VERSION=5.0.0
+-#export ParaView_VERSION=5.0.1
+-#export ParaView_VERSION=5.4.0
+-#export ParaView_VERSION=5.5.0
+-export ParaView_VERSION=5.6.3
+-export ParaView_MAJOR=detect
+-
+-#export ParaView_GL=system
+-export ParaView_GL=mesa
+-
+-# Evaluate command-line parameters for ParaView
+-_foamParaviewEval()
+-{
+-    while [ $# -gt 0 ]
+-    do
+-        case "$1" in
+-        ParaView*=*)
+-            # name=value  -> export name=value
+-            eval "export $1"
+-            ;;
+-        esac
+-        shift
+-    done
+-}
+-
+-# Evaluate command-line parameters
+-_foamParaviewEval $@
+-
+-# Set MAJOR version to correspond to VERSION
+-# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
+-case "$ParaView_VERSION" in
+-"$ParaView_MAJOR".* )
+-    # Version and major appear to correspond
+-    ;;
+-
+-[0-9]*)
+-    # Extract major from the version
+-    ParaView_MAJOR=$(echo $ParaView_VERSION | \
+-                   sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
+-    ;;
+-esac
+-export ParaView_VERSION ParaView_MAJOR
++export ParaView_MAJOR=$(echo $PARAVIEWVERSION | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
++export ParaView_VERSION=$ParaView_MAJOR
+ 
+ # Set the binary and source directories
+-export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
+-paraviewSrcDir=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
+-
+-# Set paths if binaries or source are present
+-if [ -d $ParaView_DIR -o -d $paraviewSrcDir ]
+-then
+-    export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
+-
+-    paraviewArch=
+-    if [ -d $ParaView_DIR/lib64 ]
+-    then
+-        paraviewArch=64
+-    fi
+-    paraviewLibSubDir=
+-    if $WM_PROJECT_DIR/bin/tools/foamVersionCompare $ParaView_VERSION lt 5.5.0
+-    then
+-        paraviewLibSubDir=/paraview-$ParaView_MAJOR
+-    fi
+-    export ParaView_LIB_DIR=$ParaView_DIR/lib$paraviewArch$paraviewLibSubDir
++export ParaView_DIR=$PARAVIEW_ROOT
++export PARAVIEW=$ParaView_DIR/bin/paraview
+ 
+-    export PATH=$ParaView_DIR/bin:$PATH
+-    export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
+-    export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
++# Set paths
++export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
++export ParaView_LIB_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR
++export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
++export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
+ 
+-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
+-    then
+-        echo "Using paraview"
+-        echo "    ParaView_DIR         : $ParaView_DIR"
+-        echo "    ParaView_LIB_DIR     : $ParaView_LIB_DIR"
+-        echo "    ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
+-        echo "    PV_PLUGIN_PATH       : $PV_PLUGIN_PATH"
+-    fi
+-
+-    # Add in python libraries if required
+-    paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
+-    if [ -r $paraviewPython ]
+-    then
+-        if [ "$PYTHONPATH" ]
+-        then
+-            export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
+-        else
+-            export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
+-        fi
+-    fi
+-
+-    # Alias paraview to launch with mesa if necessary
+-    if [ "$ParaView_GL" = mesa ]
+-    then
+-        alias paraview='LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_LIB_DIR/mesa paraview'
+-    fi
+-else
+-    unset PV_PLUGIN_PATH
++if [ "$FOAM_VERBOSE" -a "$PS1" ]
++then
++    echo "Using paraview"
++    echo "    ParaView_DIR         : $ParaView_DIR"
++    echo "    ParaView_LIB_DIR     : $ParaView_LIB_DIR"
++    echo "    ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
++    echo "    PV_PLUGIN_PATH       : $PV_PLUGIN_PATH"
+ fi
+ 
+-unset _foamParaviewEval
+-unset cleaned cmake paraviewInstDir paraviewPython
+-
+ #------------------------------------------------------------------------------
+-- 
+2.38.1
+
+
+From 5d21c7dd6a8d7c136cd27d2fc3a6d9705adb9f61 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Tue, 20 Dec 2022 12:17:17 +0100
+Subject: [PATCH 11/13] fix: add expand flag for foamDictionary call
+
+---
+ bin/tools/RunFunctions | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions
+index 1a040df6a..fc2af43be 100644
+--- a/bin/tools/RunFunctions
++++ b/bin/tools/RunFunctions
+@@ -41,12 +41,12 @@ isTest()
+ 
+ getNumberOfProcessors()
+ {
+-    foamDictionary -entry numberOfSubdomains -value system/decomposeParDict
++    foamDictionary -entry numberOfSubdomains -value -expand system/decomposeParDict
+ }
+ 
+ getApplication()
+ {
+-    foamDictionary -entry application -value system/controlDict
++    foamDictionary -entry application -value -expand system/controlDict
+ }
+ 
+ runApplication()
+-- 
+2.38.1
+
+
+From b85c08f749a4ceb1764d988b5b9d8c007e878358 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Sat, 24 Dec 2022 12:53:20 +0100
+Subject: [PATCH 12/13] fix: wait for spawned child processes to finish
+
+---
+ test/IO/fileHandler/Allrun | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/test/IO/fileHandler/Allrun b/test/IO/fileHandler/Allrun
+index bab6a20cf..ff1a94e2c 100755
+--- a/test/IO/fileHandler/Allrun
++++ b/test/IO/fileHandler/Allrun
+@@ -93,5 +93,7 @@ mkdir -p machineB/fileHandler
+     -roots "(\"$d/machineA\" \"$d/machineB\" \"$d/machineB\")"
+ )
+ 
++# wait for child processes to finish
++wait
+ 
+ #------------------------------------------------------------------------------
+-- 
+2.38.1
+
+
+From 79c2db679e3316a30e94ba219761d3a3a2fc7f00 Mon Sep 17 00:00:00 2001
+From: Reza Housseini <reza.housseini@gmail.com>
+Date: Sat, 24 Dec 2022 22:39:33 +0100
+Subject: [PATCH 13/13] test: make tests more verbose
+
+---
+ tutorials/Allrun | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tutorials/Allrun b/tutorials/Allrun
+index 8bd667576..17bf2c111 100755
+--- a/tutorials/Allrun
++++ b/tutorials/Allrun
+@@ -88,6 +88,9 @@ logReportDir()
+     for log in `echo $logs | xargs ls -rt`
+     do
+         logReport $log >> ../testLoopReport || retVal=1
++	if [ "$retVal" -ne "0" ]; then
++	    echo `cat $log`
++	fi
+     done
+     echo "" >> ../testLoopReport
+ 
+-- 
+2.38.1
+
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 256e404970..8b04d696da 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
+;;; Copyright © 2023 Reza Housseini <reza@housseini.me>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@ (define-module (gnu packages simulation)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
+  #:use-module (gnu packages engineering)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gettext)
@@ -40,21 +42,29 @@ (define-module (gnu packages simulation)
   #:use-module (gnu packages graphics)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages image-processing)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages pdf)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages ssh)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix download)
@@ -73,62 +83,98 @@ (define-module (gnu packages simulation)
   #:use-module (ice-9 regex)
   #:use-module (srfi srfi-1))
 
-(define-public openfoam
+(define-public openfoam-org
   (package
-    (name "openfoam")
-    (version "4.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "http://dl.openfoam.org/source/"
-             (string-map (lambda (x) (if (eq? x #\.) #\- x)) version)))
-       (file-name (string-append name "-" version ".tar.gz"))
-       (sha256
-        (base32 "0cgxh4h2hf50qbvvdg5miwc2nympb0nrv3md96vb3gbs9vk8vq9d"))
-       (patches (search-patches "openfoam-4.1-cleanup.patch"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           ;; Include <sys/sysmacros.h>, which is where glibc >= 2.28 provides
-           ;; 'major' and 'minor'.
-           (substitute* "src/OSspecific/POSIX/fileStat.C"
-             (("#include <unistd\\.h>")
-              "#include <unistd.h>\n#include <sys/sysmacros.h>\n"))
-           #t))))
+    (name "openfoam-org")
+    (version "10.20221128")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+                                  (version-major version) "/archive/"
+                                  (second (string-split version #\.))
+                                  ".tar.gz"))
+              (sha256
+               (base32
+                "0yd924nhck4jh9gf1wrdnk8svj38yicg4803q79nnjqhn6lcq8c5"))
+              (patches (search-patches "openfoam-org-10-cleanup.patch"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          ;; do not source bash_completion
+                          (substitute* "etc/bashrc"
+                            (("^.*bash_completion.*$" all)
+                             (string-append "#" all)))
+                          ;; set Gcc directly, somehow a bug in openfoam
+                          (substitute* "wmake/rules/General/general"
+                            (("^COMPILER_TYPE   = .*$")
+                             "COMPILER_TYPE   = Gcc\n"))))))
     (build-system gnu-build-system)
-    (inputs
-     `(("boost" ,boost)
-       ("cgal" ,cgal)
-       ("flex" ,flex)
-       ("git" ,git)
-       ("gmp" ,gmp)
-       ("libxt" ,libxt)
-       ("metis" ,metis)
-       ("mpfr" ,mpfr)
-       ("ncurses" ,ncurses)
-       ("readline" ,readline)
-       ("scotch" ,pt-scotch32)
-       ("zlib" ,zlib)))
-    (native-inputs
-     (list bison))
-    (propagated-inputs
-     (list gzip gnuplot openmpi))
-    (outputs '("debug"                  ;~60MB
+    (inputs (list boost
+                  cgal
+                  git
+                  gmp
+                  libxt
+                  metis
+                  mpfr
+                  ncurses
+                  readline
+                  pt-scotch32
+                  zlib
+                  gnuplot
+                  gzip
+                  openmpi
+                  paraview-5.9
+                  openssh))
+    (native-inputs (list bison
+                         flex
+                         ;; paraview plugin dependencies
+                         cmake-minimal
+                         vtk
+                         libxml2
+                         libogg
+                         libtheora
+                         ffmpeg
+                         gl2ps
+                         libpng
+                         libharu
+                         jsoncpp
+                         netcdf
+                         hdf5
+                         gdal
+                         libx11
+                         qtbase-5
+                         eigen
+                         glew
+                         python
+                         expat
+                         xz
+                         utfcpp
+                         lz4
+                         double-conversion
+                         libjpeg-turbo
+                         libtiff
+                         freetype
+                         pugixml
+                         cgns
+                         qtsvg-5
+                         qttools-5
+                         protobuf
+                         qtxmlpatterns))
+    (outputs '("debug" ;~60MB
                "out"))
     (arguments
-     `( ;; Executable files and shared libraries are located in the 'platforms'
+     `( ;Executable files and shared libraries are located in the 'platforms'
        ;; subdirectory.
-       #:strip-directories (list (string-append
-                                  "lib/OpenFOAM-" ,version
-                                  "/platforms/linux64GccDPInt32Opt/bin")
-                                 (string-append
-                                  "lib/OpenFOAM-" ,version
-                                  "/platforms/linux64GccDPInt32Opt/lib"))
-       #:tests? #f                                ; no tests to run
+       #:strip-directories (list (string-append "lib/OpenFOAM-"
+                                                ,(version-major version)
+                                                "/platforms/linux64GccDPInt32Opt/bin")
+                                 (string-append "lib/OpenFOAM-"
+                                                ,(version-major version)
+                                                "/platforms/linux64GccDPInt32Opt/lib"))
 
        #:modules ((ice-9 ftw)
                   (ice-9 regex)
+                  (ice-9 string-fun)
+                  (srfi srfi-1)
                   (guix build gnu-build-system)
                   (guix build utils))
 
@@ -138,70 +184,147 @@ (define-public openfoam
                       (chdir "..")
                       ;; Use 'OpenFOAM-version' convention to match the file
                       ;; name expectations in the build phase.
-                      (let ((unpack-dir (string-append
-                                         (getcwd) "/"
-                                         (list-ref (scandir (getcwd) (lambda (name)
-                                                                       (string-match "^OpenFOAM" name))) 0)))
-                            (build-dir (string-append
-                                        (getcwd) "/OpenFOAM-" ,version)))
-                        (rename-file unpack-dir build-dir) ; rename build directory
-                        (chdir (basename build-dir))) ; move to build directory
+                      (let ((unpack-dir (string-append (getcwd) "/OpenFOAM-"
+                                                       ,(string-replace-substring
+                                                         version "." "-")))
+                            (build-dir (string-append (getcwd) "/OpenFOAM-"
+                                                      ,(version-major version))))
+                        (rename-file unpack-dir build-dir) ;rename build directory
+                        (chdir (basename build-dir))) ;move to build directory
                       #t))
-                  (delete 'configure)             ; no configure phase
+                  (add-after 'rename-build-directory 'make-files-writable-for-tests
+                    (lambda _
+                      (for-each make-file-writable
+                                (find-files "test"))
+                      (for-each make-file-writable
+                                (find-files "tutorials")) #t))
+                  (add-after 'make-files-writable-for-tests 'patch-SHELL
+                    (lambda _
+                      (substitute* (list "wmake/src/Makefile"
+                                         "wmake/makefiles/general")
+                        (("/bin/sh")
+                         which "sh")) #t))
+                  (add-after 'patch-SHELL 'patch-HOME
+                    (lambda _
+                      (setenv "HOME" "/tmp") #t))
+                  (add-after 'patch-HOME 'patch-gzip
+                    (lambda _
+                      (substitute* "bin/tools/scanpackages"
+                        (("gzip")
+                         (assoc-ref %build-inputs "gzip"))) #t))
+                  (add-after 'patch-gzip 'patch-gnuplot
+                    (lambda _
+                      (substitute* "etc/bashrc"
+                        (("export GNUPLOT=gnuplot")
+                         (string-append "export GNUPLOT="
+                                        (assoc-ref %build-inputs "gnuplot")
+                                        "/bin/gnuplot"))) #t))
+                  (delete 'configure) ;no configure phase
                   (replace 'build
                     (lambda _
-                      (let ((libraries '("boost" "cgal" "gmp" "metis" "mpfr" "scotch")))
+                      (letrec* ((libraries '("boost" "cgal"
+                                             "gmp"
+                                             "metis"
+                                             "mpfr"
+                                             "pt-scotch32"
+                                             "openmpi"
+                                             "zlib"
+                                             "paraview"))
+                                (rpaths (fold-right (lambda (library rpaths)
+                                                      (string-append rpaths
+                                                                     "-rpath="
+                                                                     (assoc-ref
+                                                                      %build-inputs library)
+                                                                     "/lib,")) "" libraries)))
                         ;; set variables to define store paths
                         (for-each (lambda (library)
-                                    (setenv (string-append
-                                             (string-upcase library) "_ROOT")
-                                            (assoc-ref %build-inputs library))) libraries))
-                      ;; set variables to define package versions
-                      (setenv "SCOTCHVERSION" ,(package-version scotch))
-                      (setenv "METISVERSION" ,(package-version metis))
-                      ;; set variable to pass extra 'rpath' arguments to linker
-                      (setenv "LDFLAGS"
-                              (string-append
-                               "-Wl,"
-                               "-rpath=" %output "/lib/OpenFOAM-" ,version
-                               "/platforms/linux64GccDPInt32Opt/lib,"
-                               "-rpath=" %output "/lib/OpenFOAM-" ,version
-                               "/platforms/linux64GccDPInt32Opt/lib/dummy"))
+                                    (letrec* ((name (string-replace-substring (string-upcase
+                                                                               library)
+                                                                              "-" "_"))
+                                              (path (assoc-ref %build-inputs
+                                                               library)))
+                                      ;; set store path
+                                      (setenv (string-append name "_ROOT")
+                                              path))) libraries)
+                        ;; set package versions
+                        (setenv "PT_SCOTCH32VERSION"
+                                ,(package-version pt-scotch32))
+                        (setenv "METISVERSION"
+                                ,(package-version metis))
+                        (setenv "OPENMPIVERSION"
+                                ,(package-version openmpi))
+                        (setenv "PARAVIEWVERSION"
+                                ,(package-version paraview-5.9))
+                        ;; set variable to pass extra 'rpath' arguments to linker
+                        (setenv "LDFLAGS"
+                                (string-append "-Wl,"
+                                               rpaths
+                                               "-rpath="
+                                               %output
+                                               "/lib/OpenFOAM-"
+                                               ,(version-major version)
+                                               "/platforms/linux64GccDPInt32Opt/lib,"
+                                               "-rpath="
+                                               %output
+                                               "/lib/OpenFOAM-"
+                                               ,(version-major version)
+                                               "/platforms/linux64GccDPInt32Opt/lib/dummy,"
+                                               "-rpath="
+                                               %output
+                                               "/lib/OpenFOAM-"
+                                               ,(version-major version)
+                                               "/platforms/linux64GccDPInt32Opt/lib/paraview-"
+                                               ,(version-major+minor (package-version
+                                                                      paraview-5.9)))))
                       ;; compile OpenFOAM libraries and applications
-                      (zero? (system (format #f
-                                             "source ./etc/bashrc && ./Allwmake -j~a"
-                                             (parallel-job-count))))))
+                      (invoke "bash" "-c"
+                              (format #f
+                                      "source ./etc/bashrc && ./Allwmake -j~a"
+                                      (parallel-job-count)))))
                   (add-after 'build 'update-configuration-files
                     (lambda _
                       ;; record store paths and package versions in
                       ;; configuration files
                       (substitute* "etc/config.sh/CGAL"
-                        (("$BOOST_ROOT") (getenv "BOOST_ROOT")))
+                        (("\\$BOOST_ROOT")
+                         (getenv "BOOST_ROOT")))
                       (substitute* "etc/config.sh/CGAL"
-                        (("$CGAL_ROOT") (getenv "CGAL_ROOT")))
+                        (("\\$CGAL_ROOT")
+                         (getenv "CGAL_ROOT")))
                       (substitute* "etc/config.sh/metis"
-                        (("$METIS_ROOT") (getenv "METIS_ROOT")))
+                        (("\\$METIS_ROOT")
+                         (getenv "METIS_ROOT")))
                       (substitute* "etc/config.sh/metis"
-                        (("$METISVERSION") (getenv "METISVERSION")))
+                        (("\\$METISVERSION")
+                         (getenv "METISVERSION")))
                       (substitute* "etc/config.sh/scotch"
-                        (("$SCOTCH_ROOT") (getenv "SCOTCH_ROOT")))
+                        (("\\$PT_SCOTCH32_ROOT")
+                         (getenv "PT_SCOTCH32_ROOT")))
                       (substitute* "etc/config.sh/scotch"
-                        (("$SCOTCHVERSION") (getenv "SCOTCHVERSION")))
+                        (("\\$PT_SCOTCH32VERSION")
+                         (getenv "PT_SCOTCH32VERSION")))
                       (substitute* "etc/config.sh/settings"
-                        (("$GMP_ROOT") (getenv "GMP_ROOT")))
+                        (("\\$GMP_ROOT")
+                         (getenv "GMP_ROOT")))
                       (substitute* "etc/config.sh/settings"
-                        (("$MPFR_ROOT") (getenv "MPFR_ROOT")))
-                      ;; reset lockDir variable to refer to write-enabled
-                      ;; directory
-                      (substitute* "wmake/wmake"
-                        (("        lockDir=.*$")
-                         "        lockDir=$HOME/.$WM_PROJECT/.wmake\n"))
-                      (substitute* "wmake/wmakeScheduler"
-                        (("lockDir=.*$")
-                         "lockDir=$HOME/.$WM_PROJECT/.wmake\n"))
-                      (substitute* "wmake/wmakeSchedulerUptime"
-                        (("lockDir=.*$")
-                         "lockDir=$HOME/.$WM_PROJECT/.wmake\n"))
+                        (("\\$MPFR_ROOT")
+                         (getenv "MPFR_ROOT")))
+                      (substitute* "etc/config.sh/mpi"
+                        (("\\$OPENMPI_ROOT")
+                         (getenv "OPENMPI_ROOT")))
+                      (substitute* "etc/config.sh/mpi"
+                        (("\\$OPENMPIVERSION")
+                         (getenv "OPENMPIVERSION")))
+                      (substitute* "etc/config.sh/paraview"
+                        (("\\$PARAVIEWVERSION")
+                         (getenv "PARAVIEWVERSION")))
+                      (substitute* "etc/config.sh/paraview"
+                        (("\\$PARAVIEW_ROOT")
+                         (getenv "PARAVIEW_ROOT")))
+                      ;; enable sourcing of bash_completion again
+                      ;; gives error command "complete" not recognized?
+                      ;; (substitute* "etc/bashrc"
+                      ;; (("^#(.*bash_completion.*$)" _ cmd) cmd))
                       #t))
                   (add-after 'build 'cleanup
                     ;; Avoid unncessary, voluminous object and dep files.
@@ -210,38 +333,57 @@ (define-public openfoam
                        "platforms/linux64GccDPInt32Opt/src")
                       (delete-file-recursively
                        "platforms/linux64GccDPInt32OptSYSTEMOPENMPI")
-                      (for-each delete-file (find-files "." "\\.o$"))
+                      (for-each delete-file
+                                (find-files "." "\\.o$")) #t))
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (with-directory-excursion "test"
+                          (invoke "bash" "-c"
+                                  (format #f
+                                          "source ../etc/bashrc && ./Allrun -j~a"
+                                          (parallel-job-count)))))
+                      ;; too many tutorials are failing at the moment
+                      ;; (with-directory-excursion "tutorials"
+                      ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
                       #t))
                   (replace 'install
                     (lambda _
                       ;; use 'OpenFOAM-version' convention
-                      (let ((install-dir (string-append
-                                          %output "/lib/OpenFOAM-" ,version)))
-                        (mkdir-p install-dir)     ; create install directory
+                      (let ((install-dir (string-append %output
+                                                        "/share/OpenFOAM-"
+                                                        ,(version-major
+                                                          version))))
+                        (mkdir-p install-dir) ;create install directory
                         ;; move contents of build directory to install directory
                         (copy-recursively "." install-dir))))
                   (add-after 'install 'add-symbolic-link
                     (lambda _
                       ;; add symbolic link for standard 'bin' directory
-                      (symlink
-                       (string-append "./lib/OpenFOAM-" ,version
-                                      "/platforms/linux64GccDPInt32Opt/bin")
-                       (string-append %output "/bin"))
-                      #t)))))
+                      (symlink (string-append "./share/OpenFOAM-"
+                                              ,(version-major version)
+                                              "/platforms/linux64GccDPInt32Opt/bin")
+                               (string-append %output "/bin"))
+                      ;; add symbolic link for standard 'lib' directory
+                      (symlink (string-append "./share/OpenFOAM-"
+                                              ,(version-major version)
+                                              "/platforms/linux64GccDPInt32Opt/lib")
+                               (string-append %output "/lib")) #t)))))
     ;; Note:
-    ;;  Tutorial files are installed read-only in /gnu/store.
-    ;;  To allow write permissions on files copied from the store a
-    ;;  'chmod' step is needed before running the applications.  For
-    ;;  example, from a user's login:
-    ;;  $ source $GUIX_PROFILE/lib/OpenFOAM-4.1/etc/bashrc
-    ;;  $ mkdir -p $FOAM_RUN
-    ;;  $ cd $FOAM_RUN
-    ;;  $ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
-    ;;  $ cd pitzDaily
-    ;;  $ chmod -R u+w .
-    ;;  $ blockMesh
+    ;; Tutorial files are installed read-only in /gnu/store.
+    ;; To allow write permissions on files copied from the store a
+    ;; 'chmod' step is needed before running the applications.  For
+    ;; example, from a user's login:
+    ;; $ source $(dirname $(which blockMesh))/../../../etc/bashrc
+    ;; $ mkdir -p $FOAM_RUN
+    ;; $ cd $FOAM_RUN
+    ;; $ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
+    ;; $ cd pitzDaily
+    ;; $ chmod -R u+w .
+    ;; $ blockMesh
     (synopsis "Framework for numerical simulation of fluid flow")
-    (description "OpenFOAM provides a set of solvers and methods for tackling
+    (description
+     "OpenFOAM provides a set of solvers and methods for tackling
 problems in the field of Computational Fluid Dynamics (CFD).  It is written in
 C++.  Governing equations such as the Navier-Stokes equations can be solved in
 integral form.  Physical processes such as phase change, droplet transport and
-- 
2.38.1


[-- Attachment #1.1.3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-01-06 17:42     ` Maxim Cournoyer
  2023-01-07  9:05       ` reza.housseini
  2023-01-08 20:20       ` Reza Housseini
@ 2023-03-22 20:36       ` Reza Housseini
  2023-04-08 19:29         ` Maxim Cournoyer
  2 siblings, 1 reply; 12+ messages in thread
From: Reza Housseini @ 2023-03-22 20:36 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 761 bytes --]

> Thinking more about it, since this a new module, there shouldn't be any
> recursive dependency problem.
> 
> Probably you are missing some #:use-module at the top of your new
> module.  I'd start minimal and see what works, and evaluate the package
> at the REPL for more accurate messages perhaps.

I could boil it down a bit: when commenting out `#:use-module (gnu 
packages commencement)` in gnu/packages/engineering.scm the error 
vanishes but the freehdl package in module engineering does not build 
anymore (due to gcc-toolchain missing).
Is there a cycle inside module commencement? Seems really strange to me?

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Strange error when adding module gnu/packages/engineering
  2023-03-22 20:36       ` Reza Housseini
@ 2023-04-08 19:29         ` Maxim Cournoyer
  0 siblings, 0 replies; 12+ messages in thread
From: Maxim Cournoyer @ 2023-04-08 19:29 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix

Hi Reza,

Reza Housseini <reza.housseini@gmail.com> writes:

>> Thinking more about it, since this a new module, there shouldn't be any
>> recursive dependency problem.
>> Probably you are missing some #:use-module at the top of your new
>> module.  I'd start minimal and see what works, and evaluate the package
>> at the REPL for more accurate messages perhaps.
>
> I could boil it down a bit: when commenting out `#:use-module (gnu
> packages commencement)` in gnu/packages/engineering.scm the error
> vanishes but the freehdl package in module engineering does not build
> anymore (due to gcc-toolchain missing).
> Is there a cycle inside module commencement? Seems really strange to me?

That's a tell sign of a Guile module top-level circular dependency.  I
think the usual way to work around that is usually to resort to use (@
(gnu packages toolchain) gcc-toolchain) in place of the input, so that
importing it at the top level is not necessary (the evaluation of inputs
is delayed, eliminating the cycle).

I hope that helps,

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-04-08 19:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 14:38 Strange error when adding module gnu/packages/engineering Reza Housseini
2023-01-05  2:34 ` Csepp
2023-01-06 12:13   ` Reza Housseini
2023-01-05 16:02 ` Maxim Cournoyer
2023-01-06 12:14   ` Reza Housseini
2023-01-06 17:42     ` Maxim Cournoyer
2023-01-07  9:05       ` reza.housseini
2023-01-08 20:20       ` Reza Housseini
2023-03-22 20:36       ` Reza Housseini
2023-04-08 19:29         ` Maxim Cournoyer
2023-01-05 16:52 ` Julien Lepiller
2023-01-06 12:15   ` Reza Housseini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).