From 569bee058047abe6f05d08713c3e22c1236ab54d Mon Sep 17 00:00:00 2001 From: Reza Housseini 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 ;;; Copyright © 2022 Sharlatan Hellseher ;;; Copyright © 2022 jgart +;;; Copyright © 2023 Reza Housseini ;;; ;;; 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 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 ;;; Copyright © 2021 Bonface Munyoki Kilyungi ;;; Copyright © 2022 Gabriel Wicki +;;; Copyright © 2023 Reza Housseini ;;; ;;; 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\"") + "")))))) (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 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 +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 +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 +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 +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 +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 +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 +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 +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 +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</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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo 'gnuplot not found - skipping graph creation' >&2 + exit 1 + fi + +-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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo 'gnuplot not found - skipping graph creation' >&2 + exit 1 + fi + +-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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo 'gnuplot not found - skipping graph creation' >&2 + exit 1 + fi + +-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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo "gnuplot not found - skipping graph creation" >&2 + exit 1 + fi + +-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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo "gnuplot not found - skipping graph creation" >&2 + exit 1 + fi + +-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< /dev/null 2>&1 ++if ! which $GNUPLOT > /dev/null 2>&1 + then + echo "gnuplot not found - skipping graph creation" >&2 + exit 1 + fi + +-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< ../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< /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< 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< /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< /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< /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< /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< /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< /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< /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< /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< +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 "." 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 +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 +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 +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 ;;; Copyright © 2022 Eric Bavier ;;; Copyright © 2022 Liliana Marie Prikler +;;; Copyright © 2023 Reza Housseini ;;; ;;; 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 , which is where glibc >= 2.28 provides - ;; 'major' and 'minor'. - (substitute* "src/OSspecific/POSIX/fileStat.C" - (("#include ") - "#include \n#include \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