[PATCH 0/3] Update openfoam and fix bugs

  • Open
  • quality assurance status badge
Details
4 participants
  • Attila Lendvai
  • Christopher Baines
  • Reza Housseini
  • reza
Owner
unassigned
Submitted by
reza
Severity
normal
R
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae02b1a04-440a9320-f59f-4304-bf10-01dfb00717ca-000000@eu-west-1.amazonses.com
This patch series fixes a bug in openfoam-org which expects the source folder
name to be in a specific format. It also uses now a factory function
openfoam-package to generate the openfoam-org and openfoam-com package because
the version string used in an inherited package is fixed to version of the
parent package. The factory function now cleans the source tree which is
incorporated into the package making the build reproducible.
The packages openfoam-org and openfoam-com were also update to version 11 and
2306 respectively.
Reza Housseini (3):
gnu: Add openfoam-package.
gnu: openfoam-org: Update to 11.
gnu: openfoam-com: Update to 2306.
gnu/packages/simulation.scm | 691 +++++++++++++++++++-----------------
1 file changed, 366 insertions(+), 325 deletions(-)
base-commit: b2c28de020483a52f0a4f118ea40da17c2c9e5a2
--
2.41.0
R
[PATCH 1/3] gnu: Add openfoam-package.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae02d5cf3-daa763af-7aa9-431f-8361-5a09dff2e565-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-package): Add factory function to
generate openfoam packages. Improve build tree clean up.
---
gnu/packages/simulation.scm | 295 ++++++++++++++++++++++++++++++++++++
1 file changed, 295 insertions(+)
Toggle diff (308 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 1dd6dc63f7..0d52434fac 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -431,6 +431,301 @@ (define-public openfoam-com
(synopsis "Framework for numerical simulation of fluid flow (from openfoam.com)")
(home-page "https://www.openfoam.com")))
+(define* (openfoam-package source version name home-page synopsis)
+ (let* ((install-path (string-append "share/OpenFOAM-" version))
+ (paraview-version (version-major+minor (package-version paraview)))
+ (pv-plugin-path
+ (string-append install-path
+ "/platforms/linux64GccDPInt32Opt/lib/paraview-"
+ paraview-version)))
+ (package
+ (name name)
+ (version version)
+ (source source)
+ (build-system gnu-build-system)
+ (native-search-paths
+ (list (search-path-specification
+ (variable "WM_PROJECT_DIR")
+ (files `(,install-path)))
+ ;; add PV_PLUGIN_PATH to LD_LIBRARY_PATH so paraview
+ ;; finds the OpenFOAM PV plugins
+ (search-path-specification
+ (variable "LD_LIBRARY_PATH")
+ (files `(,pv-plugin-path)))))
+ (inputs (list boost
+ cgal
+ git
+ gmp
+ libxt
+ metis
+ mpfr
+ ncurses
+ openmpi
+ openssh
+ paraview
+ pt-scotch32
+ readline
+ scotch
+ zlib))
+ (native-inputs (list bison
+ flex
+ ;; paraview plugin dependencies
+ cli11
+ cmake-minimal
+ cgns
+ curl
+ double-conversion
+ eigen
+ expat
+ ffmpeg
+ fmt
+ freetype
+ gdal
+ gl2ps
+ glew
+ gmsh
+ hdf5
+ jsoncpp
+ libjpeg-turbo
+ libogg
+ libpng
+ libharu
+ libtheora
+ libtiff
+ libx11
+ libxml2
+ lz4
+ netcdf
+ nlohmann-json
+ proj
+ protobuf
+ pugixml
+ python
+ python-mpi4py
+ qtbase-5
+ qtsvg-5
+ qttools-5
+ qtwebengine-5
+ qtxmlpatterns
+ utfcpp
+ vtk
+ xz))
+ (propagated-inputs (list gnuplot))
+ (outputs '("debug" ;~60MB
+ "out"))
+ (arguments
+ (list
+ ;; Executable files and shared libraries are located in the 'platforms'
+ ;; subdirectory.
+ #:strip-directories
+ #~(list (string-append "OpenFOAM-" #$version "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$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))
+
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'patch-HOME-path
+ (lambda _
+ (setenv "HOME" "/tmp") #t))
+ (add-before 'build 'patch-scotch
+ (lambda _
+ (substitute* "etc/config.sh/scotch"
+ (("^export SCOTCH_VERSION=scotch_.*$")
+ (string-append "export SCOTCH_VERSION=scotch_"
+ #$(package-version pt-scotch32) "\n"))
+ (("^export SCOTCH_ARCH_PATH=.*$")
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n")))
+ #t))
+ (add-before 'build 'patch-mpi
+ (lambda _
+ (let* ((mpi-version #$(package-version openmpi)))
+ ;; specify openmpi type
+ (substitute* "etc/bashrc"
+ (("WM_MPLIB=SYSTEMOPENMPI")
+ "WM_MPLIB=OPENMPI"))
+ (substitute* "etc/config.sh/mpi"
+ (("export FOAM_MPI=openmpi-.*$")
+ (string-append "export FOAM_MPI=openmpi-"
+ mpi-version "\n"))
+ (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n"))))
+ #t))
+ (add-before 'build 'patch-paraview
+ (lambda _
+ (substitute* "etc/config.sh/paraview"
+ (("^export ParaView_VERSION=.*$")
+ (string-append "export ParaView_VERSION="
+ #$(package-version paraview) "\n"))
+ (("^export ParaView_DIR=.*$")
+ (string-append "export ParaView_DIR=" #$paraview "\n"))
+ (("export ParaView_GL=mesa") "export ParaView_GL=system"))
+ #t))
+ (add-before 'build 'add-rpaths
+ (lambda _
+ (letrec* ((libraries '("boost"
+ "cgal"
+ "gmp"
+ "metis"
+ "mpfr"
+ "scotch"
+ "pt-scotch32"
+ "openmpi"
+ "zlib"
+ "paraview"))
+ (rpaths
+ (fold-right (lambda (lib rpaths)
+ (string-append rpaths
+ "-rpath="
+ (assoc-ref %build-inputs lib)
+ "/lib,")) "" libraries))
+ (openfoam-lib
+ (string-append #$output
+ "/share/OpenFOAM-" #$version
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (ldflags
+ (string-append "-Wl,"
+ rpaths
+ "-rpath="
+ openfoam-lib
+ ","
+ "-rpath="
+ openfoam-lib
+ "/dummy,"
+ "-rpath="
+ openfoam-lib
+ "/paraview-"
+ #$(version-major+minor (package-version
+ paraview)))))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
+ (string-append all " " ldflags)))) #t))
+ (add-before 'build 'add-vtk-include-path
+ (lambda _
+ (let* ((vtk-version #$(version-major+minor
+ (package-version vtk)))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
+ (vtk-inc-flag (string-append "-I" vtk-inc)))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\)" all)
+ (string-append all " " vtk-inc-flag " "))))
+ #t))
+ (delete 'configure) ;no configure phase
+ (replace 'build
+ (lambda _
+ ;; compile OpenFOAM libraries and applications
+ (invoke "bash" "-c"
+ (format #f
+ "source ./etc/bashrc && ./Allwmake -j~a"
+ (parallel-job-count)))))
+ (add-after 'build 'cleanup
+ ;; Avoid unnecessary, voluminous object and dep files.
+ (lambda _
+ (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32Opt/src"))
+ (when (file-exists?
+ "platforms/linux64GccDPInt32OptOPENMPI")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32OptOPENMPI"))
+ (for-each delete-file
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all")
+ #t))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (when (file-exists? "test")
+ (with-directory-excursion "test"
+ (invoke "bash" "-c"
+ (format #f
+ "source ../etc/bashrc && ./Allrun -j~a"
+ (parallel-job-count)))
+ ;; cleanup
+ (invoke "bash" "-c"
+ "source ../etc/bashrc && ./Allclean")))
+ ;; too many tutorials are failing
+ ;; (with-directory-excursion "tutorials"
+ ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
+ ) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") "")))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (mkdir-p install-path) ;create install directory
+ ;; move contents of build directory to install directory
+ (copy-recursively "." install-path))))
+ (add-after 'install 'add-symbolic-link
+ (lambda _
+ (let* ((bin (string-append #$output "/bin"))
+ (lib (string-append #$output "/lib"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-" #$version))
+ (build-bin (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/bin"))
+ (build-lib (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (foam-bin (string-append openfoam "/bin")))
+ ;; add symbolic links in standard 'bin' directory
+ (mkdir-p bin)
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append build-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir build-bin))
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append foam-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir foam-bin))
+ ;; add symbolic link for standard 'lib' directory
+ (symlink build-lib 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 $WM_PROJECT_DIR/etc/bashrc
+ ;; $ mkdir -p $FOAM_RUN
+ ;; $ cd $FOAM_RUN
+ ;; $ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
+ ;; $ cd pitzDaily
+ ;; $ chmod -R u+w .
+ ;; $ blockMesh
+ (synopsis synopsis)
+ (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
+chemical reaction can be modelled. Numerical methods are included to deal with
+sharp gradients, such as those encountered in flows with shock waves and flows
+with gas/liquid interfaces. Large problems may be split into smaller, connected
+problems for efficient solution on parallel systems.")
+ (license license:gpl3+)
+ (home-page home-page))))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
R
[PATCH 3/3] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae02d7aa4-d0e2bf8f-5c3c-40c8-bef4-1f6c8074bf96-000000@eu-west-1.amazonses.com
* gnu/packages/simulation (openfoam-com): Update to 2306. Use openfoam-package
factory function to create package.
---
gnu/packages/simulation.scm | 70 +++++++++++++++++++------------------
1 file changed, 36 insertions(+), 34 deletions(-)
Toggle diff (90 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 3db58813d3..7dd6bd3141 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -87,40 +87,6 @@ (define-module (gnu packages simulation)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
-(define-public openfoam-com
- ;; This is a fork of 'openfoam-org', maintained separately.
- (package
- (inherit openfoam-org)
- (name "openfoam-com")
- (version "2212")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://develop.openfoam.com"
- "/Development/openfoam/-/archive/OpenFOAM-v"
- version
- "/openfoam-OpenFOAM-v"
- version
- ".tar.gz"))
- (sha256
- (base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
- (modules '((guix build utils)))
- (snippet `(begin
- (substitute* "etc/bashrc"
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; patch shell paths
- (substitute* (list "src/OSspecific/POSIX/POSIX.C"
- "wmake/src/Makefile"
- "wmake/makefiles/general"
- "wmake/makefiles/info")
- (("/bin/sh")
- "sh"))))))
- (synopsis "Framework for numerical simulation of fluid flow (from openfoam.com)")
- (home-page "https://www.openfoam.com")))
-
(define* (openfoam-package source version name home-page synopsis)
(let* ((install-path (string-append "share/OpenFOAM-" version))
(paraview-version (version-major+minor (package-version paraview)))
@@ -470,6 +436,42 @@ (define-public openfoam-org
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
+(define-public openfoam-com
+ ;; This is a fork of 'openfoam-org', maintained separately.
+ (let* ((version "2306")
+ (name "openfoam-com")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://develop.openfoam.com"
+ "/Development/openfoam/-/archive/OpenFOAM-v"
+ version
+ "/openfoam-OpenFOAM-v"
+ version
+ ".tar.gz"))
+ (sha256 (base32
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ (substitute* "etc/bashrc"
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; patch shell paths
+ (substitute* (list
+ "src/OSspecific/POSIX/POSIX.C"
+ "wmake/src/Makefile"
+ "wmake/makefiles/general"
+ "wmake/makefiles/info")
+ (("/bin/sh")
+ "sh"))))))
+ (home-page "https://www.openfoam.com")
+ (synopsis
+ "Framework for numerical simulation of fluid flow (from openfoam.com)")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
R
[PATCH 2/3] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae02d6cd5-6d828014-3023-41e1-995a-2f43d483563f-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Use
openfoam-package factory function to create package.
---
gnu/packages/simulation.scm | 364 ++++++------------------------------
1 file changed, 54 insertions(+), 310 deletions(-)
Toggle diff (384 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 0d52434fac..3db58813d3 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -87,316 +87,6 @@ (define-module (gnu packages simulation)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
-(define-public openfoam-org
- (package
- (name "openfoam-org")
- (version "10.20230119")
- (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
- "1aw2vb5s7frg942ngd5x5x2dm67liyg6czff56qi567mshccpy46"))
- (modules '((guix build utils)))
- (snippet `(begin
- ;; patch shell paths
- (substitute* (list "wmake/src/Makefile"
- "wmake/makefiles/general")
- (("/bin/sh")
- "sh"))
- (substitute* "etc/bashrc"
- ;; only go back one folder level
- (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
- "$(dirname ${BASH_SOURCE:-$0})/..")
- ;; do not use openfoam folder convention
- (("^export WM_PROJECT_DIR=.*$")
- (string-append
- "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR\n"))
- ;; do not source bash_completion (gives error)
- (("^.*bash_completion.*$" all)
- (string-append "#" all))
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; add expand flag to RunFunctions
- (substitute* "bin/tools/RunFunctions"
- (("foamDictionary (.*)" all args)
- (string-append "foamDictionary -expand " args)))
- ;; disable failing test
- (substitute* "test/postProcessing/channel/Allrun"
- (("^.*getApplication.*$" all)
- (string-append "#" all "\n")))))))
- (build-system gnu-build-system)
- (inputs (list boost
- cgal
- git
- gmp
- libxt
- metis
- mpfr
- ncurses
- openmpi
- openssh
- paraview
- pt-scotch32
- readline
- zlib))
- (native-inputs (list bison
- flex
- ;; paraview plugin dependencies
- cli11
- cmake-minimal
- cgns
- curl
- double-conversion
- eigen
- expat
- ffmpeg
- fmt
- freetype
- gdal
- gl2ps
- glew
- gmsh
- hdf5
- jsoncpp
- libjpeg-turbo
- libogg
- libpng
- libharu
- libtheora
- libtiff
- libx11
- libxml2
- lz4
- netcdf
- nlohmann-json
- proj
- protobuf
- pugixml
- python
- python-mpi4py
- qtbase-5
- qtsvg-5
- qttools-5
- qtwebengine-5
- qtxmlpatterns
- utfcpp
- vtk
- xz))
- (propagated-inputs (list gnuplot))
- (outputs '("debug" ;~60MB
- "out"))
- (arguments
- (list
- ;; Executable files and shared libraries are located in the 'platforms'
- ;; subdirectory.
- #:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/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))
-
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'build 'patch-HOME-path
- (lambda _
- (setenv "HOME" "/tmp") #t))
- (add-before 'build 'patch-scotch
- (lambda _
- (substitute* "etc/config.sh/scotch"
- (("^export SCOTCH_VERSION=scotch_.*$")
- (string-append "export SCOTCH_VERSION=scotch_"
- #$(package-version pt-scotch32) "\n"))
- (("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
- (add-before 'build 'patch-mpi
- (lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
- ;; specify openmpi type
- (substitute* "etc/bashrc"
- (("WM_MPLIB=SYSTEMOPENMPI")
- "WM_MPLIB=OPENMPI"))
- (substitute* "etc/config.sh/mpi"
- (("export FOAM_MPI=openmpi-.*$")
- (string-append "export FOAM_MPI=openmpi-"
- mpi-version "\n"))
- (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
- (add-before 'build 'patch-paraview
- (lambda _
- (substitute* "etc/config.sh/paraview"
- (("^export ParaView_VERSION=.*$")
- (string-append "export ParaView_VERSION="
- #$(package-version paraview) "\n"))
- (("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
- (add-before 'build 'add-rpaths
- (lambda _
- (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))
- (openfoam-lib
- (string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
- (ldflags
- (string-append "-Wl,"
- rpaths
- "-rpath="
- openfoam-lib
- ","
- "-rpath="
- openfoam-lib
- "/dummy,"
- "-rpath="
- openfoam-lib
- "/paraview-"
- #$(version-major+minor (package-version
- paraview)))))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
- (string-append all " " ldflags)))) #t))
- (add-before 'build 'add-vtk-include-path
- (lambda _
- (let* ((vtk-version #$(version-major+minor
- (package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
- (vtk-inc-flag (string-append "-I" vtk-inc)))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
- (delete 'configure) ;no configure phase
- (replace 'build
- (lambda _
- ;; compile OpenFOAM libraries and applications
- (invoke "bash" "-c"
- (format #f
- "source ./etc/bashrc && ./Allwmake -j~a"
- (parallel-job-count)))))
- (add-after 'build 'cleanup
- ;; Avoid unnecessary, voluminous object and dep files.
- (lambda _
- (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
- (delete-file-recursively
- "platforms/linux64GccDPInt32Opt/src"))
- (when (file-exists?
- "platforms/linux64GccDPInt32OptOPENMPI")
- (delete-file-recursively
- "platforms/linux64GccDPInt32OptOPENMPI"))
- (for-each delete-file
- (find-files "." "\\.o$")) #t))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (when (file-exists? "test")
- (with-directory-excursion "test"
- (invoke "bash" "-c"
- (format #f
- "source ../etc/bashrc && ./Allrun -j~a"
- (parallel-job-count)))))
- ;; too many tutorials are failing
- ;; (with-directory-excursion "tutorials"
- ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
- ) #t))
- (replace 'install
- (lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (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 _
- (let* ((bin (string-append #$output "/bin"))
- (lib (string-append #$output "/lib"))
- (openfoam (string-append #$output
- "/share/OpenFOAM"))
- (build-bin (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/bin"))
- (build-lib (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/lib"))
- (foam-bin (string-append openfoam "/bin")))
- ;; add symbolic links in standard 'bin' directory
- (mkdir-p bin)
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append build-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir build-bin))
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append foam-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir foam-bin))
- ;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
- ;; 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 $(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
-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
-chemical reaction can be modelled. Numerical methods are included to deal with
-sharp gradients, such as those encountered in flows with shock waves and flows
-with gas/liquid interfaces. Large problems may be split into smaller, connected
-problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
-
-(define-public openfoam
- (deprecated-package "openfoam" openfoam-org))
-
(define-public openfoam-com
;; This is a fork of 'openfoam-org', maintained separately.
(package
@@ -726,6 +416,60 @@ (define* (openfoam-package source version name home-page synopsis)
(license license:gpl3+)
(home-page home-page))))
+(define-public openfoam-org
+ (let* ((version "11")
+ (name "openfoam-org")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
+ (sha256 (base32
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ ;; patch shell paths
+ (substitute* (list "wmake/src/Makefile"
+ "wmake/makefiles/general")
+ (("/bin/sh")
+ "sh"))
+ (substitute* "etc/bashrc"
+ ;; only go back one folder level
+ (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
+ "$(dirname ${BASH_SOURCE:-$0})/..")
+ ;; do not use openfoam folder convention
+ (("^export WM_PROJECT_DIR=.*$")
+ (string-append
+ "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR
+"))
+ ;; do not source bash_completion (gives error)
+ (("^.*bash_completion.*$" all)
+ (string-append "#" all))
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; add expand flag to RunFunctions
+ (substitute* "bin/tools/RunFunctions"
+ (("foamDictionary (.*)" all args)
+ (string-append "foamDictionary -expand "
+ args)))
+ ;; disable failing test
+ (substitute* "test/postProcessing/channel/Allrun"
+ (("^.*getApplication.*$" all)
+ (string-append "#" all "\n")))))))
+ (home-page "https://openfoam.org")
+ (synopsis "Framework for numerical simulation of fluid flow")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
+
+(define-public openfoam
+ (deprecated-package "openfoam" openfoam-org))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
R
[PATCH v2 0/3] Update openfoam
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae04ee67a-3494ed95-3baf-400c-bddc-dde69f0e3e41-000000@eu-west-1.amazonses.com
Forgot to rebase to master.

Reza Housseini (3):
gnu: Add openfoam-package.
gnu: openfoam-org: Update to 11.
gnu: openfoam-com: Update to 2306.

gnu/packages/simulation.scm | 709 +++++++++++++++++++-----------------
1 file changed, 366 insertions(+), 343 deletions(-)


base-commit: 1b0ec97bce2db93ec4159a13fb0a184f012df4fe
--
2.41.0
R
[PATCH v2 1/3] gnu: Add openfoam-package.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae04f07c5-bbef6aff-cee5-4376-a9c3-487aa062960a-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-package): Add factory function to
generate openfoam packages. Improve build tree clean up.
---
gnu/packages/simulation.scm | 295 ++++++++++++++++++++++++++++++++++++
1 file changed, 295 insertions(+)
Toggle diff (308 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..ab4f7c124f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -450,6 +450,301 @@ (define-public openfoam-com
(synopsis "Framework for numerical simulation of fluid flow (from openfoam.com)")
(home-page "https://www.openfoam.com")))
+(define* (openfoam-package source version name home-page synopsis)
+ (let* ((install-path (string-append "share/OpenFOAM-" version))
+ (paraview-version (version-major+minor (package-version paraview)))
+ (pv-plugin-path
+ (string-append install-path
+ "/platforms/linux64GccDPInt32Opt/lib/paraview-"
+ paraview-version)))
+ (package
+ (name name)
+ (version version)
+ (source source)
+ (build-system gnu-build-system)
+ (native-search-paths
+ (list (search-path-specification
+ (variable "WM_PROJECT_DIR")
+ (files `(,install-path)))
+ ;; add PV_PLUGIN_PATH to LD_LIBRARY_PATH so paraview
+ ;; finds the OpenFOAM PV plugins
+ (search-path-specification
+ (variable "LD_LIBRARY_PATH")
+ (files `(,pv-plugin-path)))))
+ (inputs (list boost
+ cgal
+ git
+ gmp
+ libxt
+ metis
+ mpfr
+ ncurses
+ openmpi
+ openssh
+ paraview
+ pt-scotch32
+ readline
+ scotch
+ zlib))
+ (native-inputs (list bison
+ flex
+ ;; paraview plugin dependencies
+ cli11
+ cmake-minimal
+ cgns
+ curl
+ double-conversion
+ eigen
+ expat
+ ffmpeg
+ fmt
+ freetype
+ gdal
+ gl2ps
+ glew
+ gmsh
+ hdf5
+ jsoncpp
+ libjpeg-turbo
+ libogg
+ libpng
+ libharu
+ libtheora
+ libtiff
+ libx11
+ libxml2
+ lz4
+ netcdf
+ nlohmann-json
+ proj
+ protobuf
+ pugixml
+ python
+ python-mpi4py
+ qtbase-5
+ qtsvg-5
+ qttools-5
+ qtwebengine-5
+ qtxmlpatterns
+ utfcpp
+ vtk
+ xz))
+ (propagated-inputs (list gnuplot))
+ (outputs '("debug" ;~60MB
+ "out"))
+ (arguments
+ (list
+ ;; Executable files and shared libraries are located in the 'platforms'
+ ;; subdirectory.
+ #:strip-directories
+ #~(list (string-append "OpenFOAM-" #$version "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$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))
+
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'patch-HOME-path
+ (lambda _
+ (setenv "HOME" "/tmp") #t))
+ (add-before 'build 'patch-scotch
+ (lambda _
+ (substitute* "etc/config.sh/scotch"
+ (("^export SCOTCH_VERSION=scotch_.*$")
+ (string-append "export SCOTCH_VERSION=scotch_"
+ #$(package-version pt-scotch32) "\n"))
+ (("^export SCOTCH_ARCH_PATH=.*$")
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n")))
+ #t))
+ (add-before 'build 'patch-mpi
+ (lambda _
+ (let* ((mpi-version #$(package-version openmpi)))
+ ;; specify openmpi type
+ (substitute* "etc/bashrc"
+ (("WM_MPLIB=SYSTEMOPENMPI")
+ "WM_MPLIB=OPENMPI"))
+ (substitute* "etc/config.sh/mpi"
+ (("export FOAM_MPI=openmpi-.*$")
+ (string-append "export FOAM_MPI=openmpi-"
+ mpi-version "\n"))
+ (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n"))))
+ #t))
+ (add-before 'build 'patch-paraview
+ (lambda _
+ (substitute* "etc/config.sh/paraview"
+ (("^export ParaView_VERSION=.*$")
+ (string-append "export ParaView_VERSION="
+ #$(package-version paraview) "\n"))
+ (("^export ParaView_DIR=.*$")
+ (string-append "export ParaView_DIR=" #$paraview "\n"))
+ (("export ParaView_GL=mesa") "export ParaView_GL=system"))
+ #t))
+ (add-before 'build 'add-rpaths
+ (lambda _
+ (letrec* ((libraries '("boost"
+ "cgal"
+ "gmp"
+ "metis"
+ "mpfr"
+ "scotch"
+ "pt-scotch32"
+ "openmpi"
+ "zlib"
+ "paraview"))
+ (rpaths
+ (fold-right (lambda (lib rpaths)
+ (string-append rpaths
+ "-rpath="
+ (assoc-ref %build-inputs lib)
+ "/lib,")) "" libraries))
+ (openfoam-lib
+ (string-append #$output
+ "/share/OpenFOAM-" #$version
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (ldflags
+ (string-append "-Wl,"
+ rpaths
+ "-rpath="
+ openfoam-lib
+ ","
+ "-rpath="
+ openfoam-lib
+ "/dummy,"
+ "-rpath="
+ openfoam-lib
+ "/paraview-"
+ #$(version-major+minor (package-version
+ paraview)))))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
+ (string-append all " " ldflags)))) #t))
+ (add-before 'build 'add-vtk-include-path
+ (lambda _
+ (let* ((vtk-version #$(version-major+minor
+ (package-version vtk)))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
+ (vtk-inc-flag (string-append "-I" vtk-inc)))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\)" all)
+ (string-append all " " vtk-inc-flag " "))))
+ #t))
+ (delete 'configure) ;no configure phase
+ (replace 'build
+ (lambda _
+ ;; compile OpenFOAM libraries and applications
+ (invoke "bash" "-c"
+ (format #f
+ "source ./etc/bashrc && ./Allwmake -j~a"
+ (parallel-job-count)))))
+ (add-after 'build 'cleanup
+ ;; Avoid unnecessary, voluminous object and dep files.
+ (lambda _
+ (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32Opt/src"))
+ (when (file-exists?
+ "platforms/linux64GccDPInt32OptOPENMPI")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32OptOPENMPI"))
+ (for-each delete-file
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all")
+ #t))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (when (file-exists? "test")
+ (with-directory-excursion "test"
+ (invoke "bash" "-c"
+ (format #f
+ "source ../etc/bashrc && ./Allrun -j~a"
+ (parallel-job-count)))
+ ;; cleanup
+ (invoke "bash" "-c"
+ "source ../etc/bashrc && ./Allclean")))
+ ;; too many tutorials are failing
+ ;; (with-directory-excursion "tutorials"
+ ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
+ ) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") "")))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (mkdir-p install-path) ;create install directory
+ ;; move contents of build directory to install directory
+ (copy-recursively "." install-path))))
+ (add-after 'install 'add-symbolic-link
+ (lambda _
+ (let* ((bin (string-append #$output "/bin"))
+ (lib (string-append #$output "/lib"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-" #$version))
+ (build-bin (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/bin"))
+ (build-lib (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (foam-bin (string-append openfoam "/bin")))
+ ;; add symbolic links in standard 'bin' directory
+ (mkdir-p bin)
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append build-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir build-bin))
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append foam-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir foam-bin))
+ ;; add symbolic link for standard 'lib' directory
+ (symlink build-lib 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 $WM_PROJECT_DIR/etc/bashrc
+ ;; $ mkdir -p $FOAM_RUN
+ ;; $ cd $FOAM_RUN
+ ;; $ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
+ ;; $ cd pitzDaily
+ ;; $ chmod -R u+w .
+ ;; $ blockMesh
+ (synopsis synopsis)
+ (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
+chemical reaction can be modelled. Numerical methods are included to deal with
+sharp gradients, such as those encountered in flows with shock waves and flows
+with gas/liquid interfaces. Large problems may be split into smaller, connected
+problems for efficient solution on parallel systems.")
+ (license license:gpl3+)
+ (home-page home-page))))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
R
[PATCH v2 2/3] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae04f1969-8ad09224-8477-4bfa-9a64-bc6caec1edef-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Use
openfoam-package factory function to create package.
---
gnu/packages/simulation.scm | 382 +++++-------------------------------
1 file changed, 54 insertions(+), 328 deletions(-)
Toggle diff (402 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index ab4f7c124f..4dc8c9e30e 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -88,334 +88,6 @@ (define-module (gnu packages simulation)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
-(define-public openfoam-org
- (package
- (name "openfoam-org")
- (version "10.20230119")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
- (sha256
- (base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
- (modules '((guix build utils)))
- (snippet `(begin
- ;; patch shell paths
- (substitute* (list "wmake/src/Makefile"
- "wmake/makefiles/general")
- (("/bin/sh")
- "sh"))
- (substitute* "etc/bashrc"
- ;; only go back one folder level
- (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
- "$(dirname ${BASH_SOURCE:-$0})/..")
- ;; do not use openfoam folder convention
- (("^export WM_PROJECT_DIR=.*$")
- (string-append
- "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR\n"))
- ;; do not source bash_completion (gives error)
- (("^.*bash_completion.*$" all)
- (string-append "#" all))
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; add expand flag to RunFunctions
- (substitute* "bin/tools/RunFunctions"
- (("foamDictionary (.*)" all args)
- (string-append "foamDictionary -expand " args)))
- ;; disable failing test
- (substitute* "test/postProcessing/channel/Allrun"
- (("^.*getApplication.*$" all)
- (string-append "#" all "\n")))))))
- (build-system gnu-build-system)
- (inputs (list boost
- cgal
- git
- gmp
- libxt
- metis
- mpfr
- ncurses
- openmpi
- openssh
- paraview
- pt-scotch32
- readline
- zlib))
- (native-inputs (list bison
- flex
- ;; paraview plugin dependencies
- cli11
- cmake-minimal
- cgns
- curl
- double-conversion
- eigen
- expat
- ffmpeg
- fmt
- freetype
- gdal
- gl2ps
- glew
- gmsh
- hdf5
- jsoncpp
- libjpeg-turbo
- libogg
- libpng
- libharu
- libtheora
- libtiff
- libx11
- libxml2
- lz4
- netcdf
- nlohmann-json
- proj
- protobuf
- pugixml
- python
- python-mpi4py
- qtbase-5
- qtsvg-5
- qttools-5
- qtwebengine-5
- qtxmlpatterns
- utfcpp
- vtk
- xz))
- (propagated-inputs (list gnuplot))
- (outputs '("debug" ;~60MB
- "out"))
- (arguments
- (list
- ;; Executable files and shared libraries are located in the 'platforms'
- ;; subdirectory.
- #:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/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))
-
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'build 'patch-HOME-path
- (lambda _
- (setenv "HOME" "/tmp")))
- (add-before 'build 'rename-self
- (lambda _
- ;; The script 'bin/foamEtcFile' derives the version name based
- ;; on the current directory name (!), so make sure to follow the
- ;; expected naming convention.
- (let ((here (canonicalize-path "."))
- (target #$(string-append
- "OpenFOAM-"
- (string-map (match-lambda
- (#\. #\-)
- (chr chr))
- (package-version this-package)))))
- (chdir "..")
- (format #t "renaming '~a' to '~a'~%"
- here target)
- (rename-file here target)
- (chdir target))))
- (add-before 'build 'patch-scotch
- (lambda _
- (substitute* "etc/config.sh/scotch"
- (("^export SCOTCH_VERSION=scotch_.*$")
- (string-append "export SCOTCH_VERSION=scotch_"
- #$(package-version pt-scotch32) "\n"))
- (("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
- (add-before 'build 'patch-mpi
- (lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
- ;; specify openmpi type
- (substitute* "etc/bashrc"
- (("WM_MPLIB=SYSTEMOPENMPI")
- "WM_MPLIB=OPENMPI"))
- (substitute* "etc/config.sh/mpi"
- (("export FOAM_MPI=openmpi-.*$")
- (string-append "export FOAM_MPI=openmpi-"
- mpi-version "\n"))
- (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
- (add-before 'build 'patch-paraview
- (lambda _
- (substitute* "etc/config.sh/paraview"
- (("^export ParaView_VERSION=.*$")
- (string-append "export ParaView_VERSION="
- #$(package-version paraview) "\n"))
- (("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
- (add-before 'build 'add-rpaths
- (lambda _
- (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))
- (openfoam-lib
- (string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
- (ldflags
- (string-append "-Wl,"
- rpaths
- "-rpath="
- openfoam-lib
- ","
- "-rpath="
- openfoam-lib
- "/dummy,"
- "-rpath="
- openfoam-lib
- "/paraview-"
- #$(version-major+minor (package-version
- paraview)))))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
- (string-append all " " ldflags)))) #t))
- (add-before 'build 'add-vtk-include-path
- (lambda _
- (let* ((vtk-version #$(version-major+minor
- (package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
- (vtk-inc-flag (string-append "-I" vtk-inc)))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
- (delete 'configure) ;no configure phase
- (replace 'build
- (lambda _
- ;; compile OpenFOAM libraries and applications
- (invoke "bash" "-c"
- (format #f
- "source ./etc/bashrc && ./Allwmake -j~a"
- (parallel-job-count)))))
- (add-after 'build 'cleanup
- ;; Avoid unnecessary, voluminous object and dep files.
- (lambda _
- (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
- (delete-file-recursively
- "platforms/linux64GccDPInt32Opt/src"))
- (when (file-exists?
- "platforms/linux64GccDPInt32OptOPENMPI")
- (delete-file-recursively
- "platforms/linux64GccDPInt32OptOPENMPI"))
- (for-each delete-file
- (find-files "." "\\.o$")) #t))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (when (file-exists? "test")
- (with-directory-excursion "test"
- (invoke "bash" "-c"
- (format #f
- "source ../etc/bashrc && ./Allrun -j~a"
- (parallel-job-count)))))
- ;; too many tutorials are failing
- ;; (with-directory-excursion "tutorials"
- ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
- ) #t))
- (replace 'install
- (lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (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 _
- (let* ((bin (string-append #$output "/bin"))
- (lib (string-append #$output "/lib"))
- (openfoam (string-append #$output
- "/share/OpenFOAM"))
- (build-bin (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/bin"))
- (build-lib (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/lib"))
- (foam-bin (string-append openfoam "/bin")))
- ;; add symbolic links in standard 'bin' directory
- (mkdir-p bin)
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append build-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir build-bin))
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append foam-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir foam-bin))
- ;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
- ;; 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 $(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
-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
-chemical reaction can be modelled. Numerical methods are included to deal with
-sharp gradients, such as those encountered in flows with shock waves and flows
-with gas/liquid interfaces. Large problems may be split into smaller, connected
-problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
-
-(define-public openfoam
- (deprecated-package "openfoam" openfoam-org))
-
(define-public openfoam-com
;; This is a fork of 'openfoam-org', maintained separately.
(package
@@ -745,6 +417,60 @@ (define* (openfoam-package source version name home-page synopsis)
(license license:gpl3+)
(home-page home-page))))
+(define-public openfoam-org
+ (let* ((version "11")
+ (name "openfoam-org")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
+ (sha256 (base32
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ ;; patch shell paths
+ (substitute* (list "wmake/src/Makefile"
+ "wmake/makefiles/general")
+ (("/bin/sh")
+ "sh"))
+ (substitute* "etc/bashrc"
+ ;; only go back one folder level
+ (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
+ "$(dirname ${BASH_SOURCE:-$0})/..")
+ ;; do not use openfoam folder convention
+ (("^export WM_PROJECT_DIR=.*$")
+ (string-append
+ "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR
+"))
+ ;; do not source bash_completion (gives error)
+ (("^.*bash_completion.*$" all)
+ (string-append "#" all))
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; add expand flag to RunFunctions
+ (substitute* "bin/tools/RunFunctions"
+ (("foamDictionary (.*)" all args)
+ (string-append "foamDictionary -expand "
+ args)))
+ ;; disable failing test
+ (substitute* "test/postProcessing/channel/Allrun"
+ (("^.*getApplication.*$" all)
+ (string-append "#" all "\n")))))))
+ (home-page "https://openfoam.org")
+ (synopsis "Framework for numerical simulation of fluid flow")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
+
+(define-public openfoam
+ (deprecated-package "openfoam" openfoam-org))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
R
[PATCH v2 3/3] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018ae04f2efe-cfe8b6be-e0a5-4996-a9b9-4da65ceb5dcd-000000@eu-west-1.amazonses.com
* gnu/packages/simulation (openfoam-com): Update to 2306. Use openfoam-package
factory function to create package.
---
gnu/packages/simulation.scm | 70 +++++++++++++++++++------------------
1 file changed, 36 insertions(+), 34 deletions(-)
Toggle diff (90 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 4dc8c9e30e..c712693e6e 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -88,40 +88,6 @@ (define-module (gnu packages simulation)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
-(define-public openfoam-com
- ;; This is a fork of 'openfoam-org', maintained separately.
- (package
- (inherit openfoam-org)
- (name "openfoam-com")
- (version "2212")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://develop.openfoam.com"
- "/Development/openfoam/-/archive/OpenFOAM-v"
- version
- "/openfoam-OpenFOAM-v"
- version
- ".tar.gz"))
- (sha256
- (base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
- (modules '((guix build utils)))
- (snippet `(begin
- (substitute* "etc/bashrc"
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; patch shell paths
- (substitute* (list "src/OSspecific/POSIX/POSIX.C"
- "wmake/src/Makefile"
- "wmake/makefiles/general"
- "wmake/makefiles/info")
- (("/bin/sh")
- "sh"))))))
- (synopsis "Framework for numerical simulation of fluid flow (from openfoam.com)")
- (home-page "https://www.openfoam.com")))
-
(define* (openfoam-package source version name home-page synopsis)
(let* ((install-path (string-append "share/OpenFOAM-" version))
(paraview-version (version-major+minor (package-version paraview)))
@@ -471,6 +437,42 @@ (define-public openfoam-org
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
+(define-public openfoam-com
+ ;; This is a fork of 'openfoam-org', maintained separately.
+ (let* ((version "2306")
+ (name "openfoam-com")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://develop.openfoam.com"
+ "/Development/openfoam/-/archive/OpenFOAM-v"
+ version
+ "/openfoam-OpenFOAM-v"
+ version
+ ".tar.gz"))
+ (sha256 (base32
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ (substitute* "etc/bashrc"
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; patch shell paths
+ (substitute* (list
+ "src/OSspecific/POSIX/POSIX.C"
+ "wmake/src/Makefile"
+ "wmake/makefiles/general"
+ "wmake/makefiles/info")
+ (("/bin/sh")
+ "sh"))))))
+ (home-page "https://www.openfoam.com")
+ (synopsis
+ "Framework for numerical simulation of fluid flow (from openfoam.com)")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
+
(define-public open-simulation-interface
(package
(name "open-simulation-interface")
--
2.41.0
C
C
Christopher Baines wrote on 6 Oct 2023 14:14
Re: Failed to build in QA
(name . reza.housseini@gmail.com)(address . reza.housseini@gmail.com)
87zg0weyde.fsf@cbaines.net
"reza.housseini@gmail.com" <reza.housseini@gmail.com> writes:

Toggle quote (28 lines)
> On October 5, 2023 10:49:06 AM GMT+02:00, Christopher Baines <mail@cbaines.net> wrote:
>>
>>"reza.housseini@gmail.com" <reza.housseini@gmail.com> writes:
>>
>>> I submitted an issue to guix. But QA refuses to build it [1]. I have
>>> no clue what the problem is, can anyone shed light on a possible
>>> resolution?
>>
>>You pretty much found the problem, the relevant line on the page you
>>linked to is:
>>
>>[ 6/ 50] loading... 24.0% of 25 filesbuilder for `/gnu/store/qhvpjfn3d9cwz5zxadblbnbqa92a8i27-guix-cli-core.drv' failed due to signal 11 (Segmentation fault)
>>
>>So the data service wasn't able to build Guix. This probably isn't due
>>to your changes, and it doesn't happen very often, so the thing to do
>>here is just retry.
>>
>>I've triggered QA to reapply the patches now (by deleting the
>>issue-66262 branch), so hopefully things will work better this time.
>>
>>Thanks,
>>
>>Chris
>
> Thanks very much, it seems to have worked, but now it's stuck with
> paraview undefined symbol, although the necessary module
> (gnu/packages/image-processing) is imported?

This is probably down to a top level circular dependency. In particular,
trying to paraview to compute the version to form part of the
native-search-path at the top level causes problems.

Making openfoam have LD_LIBRARY_PATH as a search path seems like the
incorrect use of search paths though, since you're searching for
something in the same package. Replacing this with wrapping would be an
improvement, although still I'm unsure why LD_LIBRARY_PATH would need
setting in this case.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmUf+31fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcHUw/+KXUEOkQD+2+6agDP+zeAhcCjCsiV49S3
Dq7uoP+o8WtkhVhVPEZGFzMDCzR47i6AKH9Qw2ovRX7LjVyZeUtsNNtVXVbpz7sb
xkiAFd0CkxukhQqKCixZvAdzBMytv782cUpSAbwdzImmEWCmc0Y4goPsqLiW3FW+
fdjS6alEeMYuzzJL5gvxpkYd3M3fHCOTRpso2pTlDVCe1Bd4uJPvfd/4ycwvwm25
cteaX7Hpx8Z9bSP8v5imGvIsGx0Ckr9ZlSN9615A77HhJUOMSKKIlQFhb68Mcwk6
DELu/NiGlfZjW03XyTyg5GKU1TlCESy8HaU1UpUGSAessYZ1wiqFHBFSVDCPJUvg
Qj2QTVcuALAlng2tBZIo77g/xdZ2QR8o/MGbCKoZRkvQC80lHV5r/ogy4zQNP6n1
bPUdN3e7eYg7X59UcrkA+cHyL0MTVeFFNCaVyiHs2RzN4ciKW050oZWA4ZZV+Qdl
J/cIJJ9vYJ2+G4venSIv7ScvvyR99P62wCKvBTu+10Ki/UxyU25DMGVCrOlvx79i
4MKTa2lpioIyrhbShCYoC8657vrJrt2RLR1Y03KuLvC8sMHaknLXGnGWbT0vWsKk
5AajwAjwoSqvFkrSmARtl70NHIXA/jWJfqAHM0GY/gEJUglAYZuSy4QVHcgF2YQw
mop9AfyL/FY=
=GjRl
-----END PGP SIGNATURE-----

R
R
Reza Housseini wrote on 9 Oct 2023 14:40
(name . Christopher Baines)(address . mail@cbaines.net)
2c3bb152-6928-cdcd-a8b6-593218a6d4e9@gmail.com
Toggle quote (3 lines)
> This is probably down to a top level circular dependency. In particular,
> trying to paraview to compute the version to form part of the
> native-search-path at the top level causes problems.
I'm wondering why it builds fine locally but causes problems in QA have
you any pointers what might be the difference?
Toggle quote (5 lines)
> Making openfoam have LD_LIBRARY_PATH as a search path seems like the
> incorrect use of search paths though, since you're searching for
> something in the same package. Replacing this with wrapping would be an
> improvement, although still I'm unsure why LD_LIBRARY_PATH would need
> setting in this case
Hmm maybe you are right, will try to wrap the binaries instead...
Attachment: OpenPGP_signature
R
[PATCH v3 0/3] Remove paraview plugin search path.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018b1842f031-14ff0ad0-2e06-4336-8a98-82b9e39635f4-000000@eu-west-1.amazonses.com
This updated patch series removes the paraview plugin search path from
the openfoam-package factory function. This search path should be
added to the paraview package instead.

Reza Housseini (3):
gnu: Add openfoam-package.
gnu: openfoam-org: Update to 11.
gnu: openfoam-com: Update to 2306.

gnu/packages/simulation.scm | 699 ++++++++++++++++++------------------
1 file changed, 356 insertions(+), 343 deletions(-)


base-commit: 1b0ec97bce2db93ec4159a13fb0a184f012df4fe
--
2.41.0
R
[PATCH v3 2/3] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018b18430da9-37594e16-03cb-4c0b-86dd-76aa61c88050-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Use
openfoam-package factory function to create package.
---
gnu/packages/simulation.scm | 372 +++++-------------------------------
1 file changed, 49 insertions(+), 323 deletions(-)
Toggle diff (385 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 4b95688e33..6ce15a2c2d 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -374,329 +374,55 @@ (define* (openfoam-package source version name home-page synopsis)
(home-page home-page))))
(define-public openfoam-org
- (package
- (name "openfoam-org")
- (version "10.20230119")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
- (sha256
- (base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
- (modules '((guix build utils)))
- (snippet `(begin
- ;; patch shell paths
- (substitute* (list "wmake/src/Makefile"
- "wmake/makefiles/general")
- (("/bin/sh")
- "sh"))
- (substitute* "etc/bashrc"
- ;; only go back one folder level
- (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
- "$(dirname ${BASH_SOURCE:-$0})/..")
- ;; do not use openfoam folder convention
- (("^export WM_PROJECT_DIR=.*$")
- (string-append
- "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR\n"))
- ;; do not source bash_completion (gives error)
- (("^.*bash_completion.*$" all)
- (string-append "#" all))
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; add expand flag to RunFunctions
- (substitute* "bin/tools/RunFunctions"
- (("foamDictionary (.*)" all args)
- (string-append "foamDictionary -expand " args)))
- ;; disable failing test
- (substitute* "test/postProcessing/channel/Allrun"
- (("^.*getApplication.*$" all)
- (string-append "#" all "\n")))))))
- (build-system gnu-build-system)
- (inputs (list boost
- cgal
- git
- gmp
- libxt
- metis
- mpfr
- ncurses
- openmpi
- openssh
- paraview
- pt-scotch32
- readline
- zlib))
- (native-inputs (list bison
- flex
- ;; paraview plugin dependencies
- cli11
- cmake-minimal
- cgns
- curl
- double-conversion
- eigen
- expat
- ffmpeg
- fmt
- freetype
- gdal
- gl2ps
- glew
- gmsh
- hdf5
- jsoncpp
- libjpeg-turbo
- libogg
- libpng
- libharu
- libtheora
- libtiff
- libx11
- libxml2
- lz4
- netcdf
- nlohmann-json
- proj
- protobuf
- pugixml
- python
- python-mpi4py
- qtbase-5
- qtsvg-5
- qttools-5
- qtwebengine-5
- qtxmlpatterns
- utfcpp
- vtk
- xz))
- (propagated-inputs (list gnuplot))
- (outputs '("debug" ;~60MB
- "out"))
- (arguments
- (list
- ;; Executable files and shared libraries are located in the 'platforms'
- ;; subdirectory.
- #:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/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))
-
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'build 'patch-HOME-path
- (lambda _
- (setenv "HOME" "/tmp")))
- (add-before 'build 'rename-self
- (lambda _
- ;; The script 'bin/foamEtcFile' derives the version name based
- ;; on the current directory name (!), so make sure to follow the
- ;; expected naming convention.
- (let ((here (canonicalize-path "."))
- (target #$(string-append
- "OpenFOAM-"
- (string-map (match-lambda
- (#\. #\-)
- (chr chr))
- (package-version this-package)))))
- (chdir "..")
- (format #t "renaming '~a' to '~a'~%"
- here target)
- (rename-file here target)
- (chdir target))))
- (add-before 'build 'patch-scotch
- (lambda _
- (substitute* "etc/config.sh/scotch"
- (("^export SCOTCH_VERSION=scotch_.*$")
- (string-append "export SCOTCH_VERSION=scotch_"
- #$(package-version pt-scotch32) "\n"))
- (("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
- (add-before 'build 'patch-mpi
- (lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
- ;; specify openmpi type
- (substitute* "etc/bashrc"
- (("WM_MPLIB=SYSTEMOPENMPI")
- "WM_MPLIB=OPENMPI"))
- (substitute* "etc/config.sh/mpi"
- (("export FOAM_MPI=openmpi-.*$")
- (string-append "export FOAM_MPI=openmpi-"
- mpi-version "\n"))
- (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
- (add-before 'build 'patch-paraview
- (lambda _
- (substitute* "etc/config.sh/paraview"
- (("^export ParaView_VERSION=.*$")
- (string-append "export ParaView_VERSION="
- #$(package-version paraview) "\n"))
- (("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
- (add-before 'build 'add-rpaths
- (lambda _
- (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))
- (openfoam-lib
- (string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
- (ldflags
- (string-append "-Wl,"
- rpaths
- "-rpath="
- openfoam-lib
- ","
- "-rpath="
- openfoam-lib
- "/dummy,"
- "-rpath="
- openfoam-lib
- "/paraview-"
- #$(version-major+minor (package-version
- paraview)))))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
- (string-append all " " ldflags)))) #t))
- (add-before 'build 'add-vtk-include-path
- (lambda _
- (let* ((vtk-version #$(version-major+minor
- (package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
- (vtk-inc-flag (string-append "-I" vtk-inc)))
- (substitute* "wmake/rules/linux64Gcc/c++"
- (("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
- (delete 'configure) ;no configure phase
- (replace 'build
- (lambda _
- ;; compile OpenFOAM libraries and applications
- (invoke "bash" "-c"
- (format #f
- "source ./etc/bashrc && ./Allwmake -j~a"
- (parallel-job-count)))))
- (add-after 'build 'cleanup
- ;; Avoid unnecessary, voluminous object and dep files.
- (lambda _
- (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
- (delete-file-recursively
- "platforms/linux64GccDPInt32Opt/src"))
- (when (file-exists?
- "platforms/linux64GccDPInt32OptOPENMPI")
- (delete-file-recursively
- "platforms/linux64GccDPInt32OptOPENMPI"))
- (for-each delete-file
- (find-files "." "\\.o$")) #t))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (when (file-exists? "test")
- (with-directory-excursion "test"
- (invoke "bash" "-c"
- (format #f
- "source ../etc/bashrc && ./Allrun -j~a"
- (parallel-job-count)))))
- ;; too many tutorials are failing
- ;; (with-directory-excursion "tutorials"
- ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
- ) #t))
- (replace 'install
- (lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (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 _
- (let* ((bin (string-append #$output "/bin"))
- (lib (string-append #$output "/lib"))
- (openfoam (string-append #$output
- "/share/OpenFOAM"))
- (build-bin (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/bin"))
- (build-lib (string-append openfoam
- "/platforms/linux64GccDPInt32Opt/lib"))
- (foam-bin (string-append openfoam "/bin")))
- ;; add symbolic links in standard 'bin' directory
- (mkdir-p bin)
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append build-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir build-bin))
- (for-each (lambda (file)
- (unless (member file
- '("." ".."))
- (symlink (string-append foam-bin "/"
- file)
- (string-append bin "/" file))))
- (scandir foam-bin))
- ;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
- ;; 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 $(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
-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
-chemical reaction can be modelled. Numerical methods are included to deal with
-sharp gradients, such as those encountered in flows with shock waves and flows
-with gas/liquid interfaces. Large problems may be split into smaller, connected
-problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
+ (let* ((version "11")
+ (name "openfoam-org")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
+ (sha256 (base32
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ ;; patch shell paths
+ (substitute* (list "wmake/src/Makefile"
+ "wmake/makefiles/general")
+ (("/bin/sh")
+ "sh"))
+ (substitute* "etc/bashrc"
+ ;; only go back one folder level
+ (("\\$\\(dirname \\$\\{BASH_SOURCE:-\\$0\\}\\)/../..")
+ "$(dirname ${BASH_SOURCE:-$0})/..")
+ ;; do not use openfoam folder convention
+ (("^export WM_PROJECT_DIR=.*$")
+ (string-append
+ "export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR
+"))
+ ;; do not source bash_completion (gives error)
+ (("^.*bash_completion.*$" all)
+ (string-append "#" all))
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; add expand flag to RunFunctions
+ (substitute* "bin/tools/RunFunctions"
+ (("foamDictionary (.*)" all args)
+ (string-append "foamDictionary -expand "
+ args)))
+ ;; disable failing test
+ (substitute* "test/postProcessing/channel/Allrun"
+ (("^.*getApplication.*$" all)
+ (string-append "#" all "\n")))))))
+ (home-page "https://openfoam.org")
+ (synopsis "Framework for numerical simulation of fluid flow")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
--
2.41.0
R
[PATCH v3 1/3] gnu: Add openfoam-package.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018b184309d5-eff905ae-ed1b-4c1a-b305-45f0e69ba7de-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-package): Add factory function to
generate openfoam packages. Improve build tree clean up to fix reproducibility
bug. Fix install path to follow openfoam naming convention.
---
gnu/packages/simulation.scm | 285 ++++++++++++++++++++++++++++++++++++
1 file changed, 285 insertions(+)
Toggle diff (298 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..4b95688e33 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -88,6 +88,291 @@ (define-module (gnu packages simulation)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
+(define* (openfoam-package source version name home-page synopsis)
+ (let* ((install-path (string-append "share/OpenFOAM-" version)))
+ (package
+ (name name)
+ (version version)
+ (source source)
+ (build-system gnu-build-system)
+ (native-search-paths
+ (list (search-path-specification
+ (variable "WM_PROJECT_DIR")
+ (files `(,install-path)))))
+ (inputs (list boost
+ cgal
+ git
+ gmp
+ libxt
+ metis
+ mpfr
+ ncurses
+ openmpi
+ openssh
+ paraview
+ pt-scotch32
+ readline
+ scotch
+ zlib))
+ (native-inputs (list bison
+ flex
+ ;; paraview plugin dependencies
+ cli11
+ cmake-minimal
+ cgns
+ curl
+ double-conversion
+ eigen
+ expat
+ ffmpeg
+ fmt
+ freetype
+ gdal
+ gl2ps
+ glew
+ gmsh
+ hdf5
+ jsoncpp
+ libjpeg-turbo
+ libogg
+ libpng
+ libharu
+ libtheora
+ libtiff
+ libx11
+ libxml2
+ lz4
+ netcdf
+ nlohmann-json
+ proj
+ protobuf
+ pugixml
+ python
+ python-mpi4py
+ qtbase-5
+ qtsvg-5
+ qttools-5
+ qtwebengine-5
+ qtxmlpatterns
+ utfcpp
+ vtk
+ xz))
+ (propagated-inputs (list gnuplot))
+ (outputs '("debug" ;~60MB
+ "out"))
+ (arguments
+ (list
+ ;; Executable files and shared libraries are located in the 'platforms'
+ ;; subdirectory.
+ #:strip-directories
+ #~(list (string-append "OpenFOAM-" #$version "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$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))
+
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'patch-HOME-path
+ (lambda _
+ (setenv "HOME" "/tmp") #t))
+ (add-before 'build 'patch-scotch
+ (lambda _
+ (substitute* "etc/config.sh/scotch"
+ (("^export SCOTCH_VERSION=scotch_.*$")
+ (string-append "export SCOTCH_VERSION=scotch_"
+ #$(package-version pt-scotch32) "\n"))
+ (("^export SCOTCH_ARCH_PATH=.*$")
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n")))
+ #t))
+ (add-before 'build 'patch-mpi
+ (lambda _
+ (let* ((mpi-version #$(package-version openmpi)))
+ ;; specify openmpi type
+ (substitute* "etc/bashrc"
+ (("WM_MPLIB=SYSTEMOPENMPI")
+ "WM_MPLIB=OPENMPI"))
+ (substitute* "etc/config.sh/mpi"
+ (("export FOAM_MPI=openmpi-.*$")
+ (string-append "export FOAM_MPI=openmpi-"
+ mpi-version "\n"))
+ (("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n"))))
+ #t))
+ (add-before 'build 'patch-paraview
+ (lambda _
+ (substitute* "etc/config.sh/paraview"
+ (("^export ParaView_VERSION=.*$")
+ (string-append "export ParaView_VERSION="
+ #$(package-version paraview) "\n"))
+ (("^export ParaView_DIR=.*$")
+ (string-append "export ParaView_DIR=" #$paraview "\n"))
+ (("export ParaView_GL=mesa") "export ParaView_GL=system"))
+ #t))
+ (add-before 'build 'add-rpaths
+ (lambda _
+ (letrec* ((libraries '("boost"
+ "cgal"
+ "gmp"
+ "metis"
+ "mpfr"
+ "scotch"
+ "pt-scotch32"
+ "openmpi"
+ "zlib"
+ "paraview"))
+ (rpaths
+ (fold-right (lambda (lib rpaths)
+ (string-append rpaths
+ "-rpath="
+ (assoc-ref %build-inputs lib)
+ "/lib,")) "" libraries))
+ (openfoam-lib
+ (string-append #$output
+ "/share/OpenFOAM-" #$version
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (ldflags
+ (string-append "-Wl,"
+ rpaths
+ "-rpath="
+ openfoam-lib
+ ","
+ "-rpath="
+ openfoam-lib
+ "/dummy,"
+ "-rpath="
+ openfoam-lib
+ "/paraview-"
+ #$(version-major+minor (package-version
+ paraview)))))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\) -fPIC" all)
+ (string-append all " " ldflags)))) #t))
+ (add-before 'build 'add-vtk-include-path
+ (lambda _
+ (let* ((vtk-version #$(version-major+minor
+ (package-version vtk)))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
+ (vtk-inc-flag (string-append "-I" vtk-inc)))
+ (substitute* "wmake/rules/linux64Gcc/c++"
+ (("\\$\\(LIB_HEADER_DIRS\\)" all)
+ (string-append all " " vtk-inc-flag " "))))
+ #t))
+ (delete 'configure) ;no configure phase
+ (replace 'build
+ (lambda _
+ ;; compile OpenFOAM libraries and applications
+ (invoke "bash" "-c"
+ (format #f
+ "source ./etc/bashrc && ./Allwmake -j~a"
+ (parallel-job-count)))))
+ (add-after 'build 'cleanup
+ ;; Avoid unnecessary, voluminous object and dep files.
+ (lambda _
+ (when (file-exists? "platforms/linux64GccDPInt32Opt/src")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32Opt/src"))
+ (when (file-exists?
+ "platforms/linux64GccDPInt32OptOPENMPI")
+ (delete-file-recursively
+ "platforms/linux64GccDPInt32OptOPENMPI"))
+ (for-each delete-file
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all")
+ #t))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (when (file-exists? "test")
+ (with-directory-excursion "test"
+ (invoke "bash" "-c"
+ (format #f
+ "source ../etc/bashrc && ./Allrun -j~a"
+ (parallel-job-count)))
+ ;; cleanup
+ (invoke "bash" "-c"
+ "source ../etc/bashrc && ./Allclean")))
+ ;; too many tutorials are failing
+ ;; (with-directory-excursion "tutorials"
+ ;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
+ ) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") "")))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-" #$version)))
+ (mkdir-p install-path) ;create install directory
+ ;; move contents of build directory to install directory
+ (copy-recursively "." install-path))))
+ (add-after 'install 'add-symbolic-link
+ (lambda _
+ (let* ((bin (string-append #$output "/bin"))
+ (lib (string-append #$output "/lib"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-" #$version))
+ (build-bin (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/bin"))
+ (build-lib (string-append openfoam
+ "/platforms/linux64GccDPInt32Opt/lib"))
+ (foam-bin (string-append openfoam "/bin")))
+ ;; add symbolic links in standard 'bin' directory
+ (mkdir-p bin)
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append build-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir build-bin))
+ (for-each (lambda (file)
+ (unless (member file
+ '("." ".."))
+ (symlink (string-append foam-bin "/"
+ file)
+ (string-append bin "/" file))))
+ (scandir foam-bin))
+ ;; add symbolic link for standard 'lib' directory
+ (symlink build-lib 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 $WM_PROJECT_DIR/etc/bashrc
+ ;; $ mkdir -p $FOAM_RUN
+ ;; $ cd $FOAM_RUN
+ ;; $ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
+ ;; $ cd pitzDaily
+ ;; $ chmod -R u+w .
+ ;; $ blockMesh
+ (synopsis synopsis)
+ (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
+chemical reaction can be modelled. Numerical methods are included to deal with
+sharp gradients, such as those encountered in flows with shock waves and flows
+with gas/liquid interfaces. Large problems may be split into smaller, connected
+problems for efficient solution on parallel systems.")
+ (license license:gpl3+)
+ (home-page home-page))))
+
(define-public openfoam-org
(package
(name "openfoam-org")
--
2.41.0
R
[PATCH v3 3/3] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018b184310e5-7c285620-deb5-4893-a60e-e9e94da60816-000000@eu-west-1.amazonses.com
* gnu/packages/simulation (openfoam-com): Update to 2306. Use openfoam-package
factory function to create package.
---
gnu/packages/simulation.scm | 58 +++++++++++++++++++------------------
1 file changed, 30 insertions(+), 28 deletions(-)
Toggle diff (74 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 6ce15a2c2d..f44e1dbf6f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -429,37 +429,39 @@ (define-public openfoam
(define-public openfoam-com
;; This is a fork of 'openfoam-org', maintained separately.
- (package
- (inherit openfoam-org)
- (name "openfoam-com")
- (version "2212")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://develop.openfoam.com"
- "/Development/openfoam/-/archive/OpenFOAM-v"
- version
- "/openfoam-OpenFOAM-v"
- version
- ".tar.gz"))
- (sha256
- (base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
- (modules '((guix build utils)))
- (snippet `(begin
- (substitute* "etc/bashrc"
- ;; set same version as guix package
- (("^export WM_PROJECT_VERSION=.*$")
- (string-append "export WM_PROJECT_VERSION="
- ,version "\n")))
- ;; patch shell paths
- (substitute* (list "src/OSspecific/POSIX/POSIX.C"
+ (let* ((version "2306")
+ (name "openfoam-com")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://develop.openfoam.com"
+ "/Development/openfoam/-/archive/OpenFOAM-v"
+ version
+ "/openfoam-OpenFOAM-v"
+ version
+ ".tar.gz"))
+ (sha256 (base32
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ (substitute* "etc/bashrc"
+ ;; set same version as guix package
+ (("^export WM_PROJECT_VERSION=.*$")
+ (string-append "export WM_PROJECT_VERSION="
+ ,version "\n")))
+ ;; patch shell paths
+ (substitute* (list
+ "src/OSspecific/POSIX/POSIX.C"
"wmake/src/Makefile"
"wmake/makefiles/general"
"wmake/makefiles/info")
- (("/bin/sh")
- "sh"))))))
- (synopsis "Framework for numerical simulation of fluid flow (from openfoam.com)")
- (home-page "https://www.openfoam.com")))
+ (("/bin/sh")
+ "sh"))))))
+ (home-page "https://www.openfoam.com")
+ (synopsis
+ "Framework for numerical simulation of fluid flow (from openfoam.com)")
+ (template (openfoam-package source version name home-page synopsis)))
+ (package
+ (inherit template))))
(define-public open-simulation-interface
(package
--
2.41.0
C
C
Christopher Baines wrote on 10 Oct 2023 19:09
Re: Failed to build in QA
(name . Reza Housseini)(address . reza.housseini@gmail.com)
87edi2flpx.fsf@cbaines.net
Reza Housseini <reza.housseini@gmail.com> writes:

Toggle quote (7 lines)
>> This is probably down to a top level circular dependency. In particular,
>> trying to paraview to compute the version to form part of the
>> native-search-path at the top level causes problems.
>
> I'm wondering why it builds fine locally but causes problems in QA
> have you any pointers what might be the difference?

You should be able to reproduce this locally, I see the issue when
running make.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmUlhUpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xfq2w/+MlKd4WBODRfYQujdjPHausMsBbAzXkUc
YobqirURl5x1DEY8U3b2YT3SOtPTREHxAtSoSRvMCv/zfwMhn2G5p1LkCOQAaNtn
zez6+Je7I2S1udmRfN/8jjA4aajR8vAixgkSKBGE93pAn2Le7SYjw5moxAeGgCBT
2nBimxoK/HJJ15n9D9E3TwQN0jh/mS22MYy6vKE53Hy2NGbwldkh+XsDYWVNfEhJ
iYJ3mwdAiPY8tQJdDS88FFq99jpe+XA4ruC/WuNWpEc/6ZK9uzc5EGzXVgklFNyF
n5tQ5BV18jHJv/bhLHi2wnbGbzKPIDuwvJJM9s4HGFQy5Vc/ZFjwN2+jcvToSQqU
Q6YhNyvaPnt2IPo13TFAPu34pRldvQpIjLOMmOVMxtk3AdXlM5521susiZ0NSQaN
2VlpN/E0BCDY89SSjpCGamVEVjaRCEp5XQzh38Ma6akXvNDawdeEU9vAHCgs9gcY
Q9mmb4r3FKTorEVai3mtYWqZbtozHllZp2lGmVwSHAKQ3gavtYzDxF2KVs28b9DY
jreymmEQWCJ+3VV62PW9Ad1lPExDFyOwgNZA8hyq8XJIOfwFzQAPXlINs5Z/jJTH
bjFUuzE3538sW1L4I5beeGVROcnPBVqE39loqSGD9XM/UJDWFOQ0dH5SBk5Y8HR4
oX4MY/KlHZQ=
=GapC
-----END PGP SIGNATURE-----

R
R
reza.housseini@gmail.com wrote on 20 Oct 2023 09:57
(name . Christopher Baines)(address . mail@cbaines.net)
DBFF3BC7-263C-454D-83B1-303F2D864A3E@gmail.com
On October 9, 2023 12:40:40 PM UTC, Reza Housseini <reza.housseini@gmail.com> wrote:
Toggle quote (13 lines)
>> This is probably down to a top level circular dependency. In particular,
>> trying to paraview to compute the version to form part of the
>> native-search-path at the top level causes problems.
>
>I'm wondering why it builds fine locally but causes problems in QA have you any pointers what might be the difference?
>
>> Making openfoam have LD_LIBRARY_PATH as a search path seems like the
>> incorrect use of search paths though, since you're searching for
>> something in the same package. Replacing this with wrapping would be an
>> improvement, although still I'm unsure why LD_LIBRARY_PATH would need
>> setting in this case
>Hmm maybe you are right, will try to wrap the binaries instead...

I removed the search-path but it still fails to build, I cannot make sense of the error message...
R
[PATCH v4 1/6] gnu: openfoam-org: Use gexps.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7b9bde-2db93a73-9870-4286-a7f7-1687cd6b849c-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Use gexps, other cosmetic changes.
Change-Id: I856d9660559cb4656251cba6bc5dd31d004f1b74
---
gnu/packages/simulation.scm | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
Toggle diff (98 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..cb6f07c383 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -238,13 +238,10 @@ (define-public openfoam-org
(string-append "export SCOTCH_VERSION=scotch_"
#$(package-version pt-scotch32) "\n"))
(("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n"))) #t))
(add-before 'build 'patch-mpi
(lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
+ (let* ((mpi-version #$(package-version openmpi)))
;; specify openmpi type
(substitute* "etc/bashrc"
(("WM_MPLIB=SYSTEMOPENMPI")
@@ -254,8 +251,7 @@ (define-public openfoam-org
(string-append "export FOAM_MPI=openmpi-"
mpi-version "\n"))
(("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n")))) #t))
(add-before 'build 'patch-paraview
(lambda _
(substitute* "etc/config.sh/paraview"
@@ -263,12 +259,11 @@ (define-public openfoam-org
(string-append "export ParaView_VERSION="
#$(package-version paraview) "\n"))
(("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
+ (string-append "export ParaView_DIR=" #$paraview "\n"))) #t))
(add-before 'build 'add-rpaths
(lambda _
- (letrec* ((libraries '("boost" "cgal"
+ (letrec* ((libraries '("boost"
+ "cgal"
"gmp"
"metis"
"mpfr"
@@ -277,11 +272,10 @@ (define-public openfoam-org
"zlib"
"paraview"))
(rpaths
- (fold-right (lambda (library rpaths)
+ (fold-right (lambda (lib rpaths)
(string-append rpaths
"-rpath="
- (assoc-ref
- %build-inputs library)
+ (assoc-ref %build-inputs lib)
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
@@ -307,13 +301,11 @@ (define-public openfoam-org
(lambda _
(let* ((vtk-version #$(version-major+minor
(package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
(vtk-inc-flag (string-append "-I" vtk-inc)))
(substitute* "wmake/rules/linux64Gcc/c++"
(("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
+ (string-append all " " vtk-inc-flag " ")))) #t))
(delete 'configure) ;no configure phase
(replace 'build
(lambda _
@@ -400,6 +392,7 @@ (define-public openfoam-org
;; $ cd pitzDaily
;; $ chmod -R u+w .
;; $ blockMesh
+ (home-page "https://openfoam.org")
(synopsis "Framework for numerical simulation of fluid flow")
(description
"OpenFOAM provides a set of solvers and methods for tackling
@@ -410,8 +403,7 @@ (define-public openfoam-org
sharp gradients, such as those encountered in flows with shock waves and flows
with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
+ (license license:gpl3+)))
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
base-commit: e4397a32ac81d0b23b168df27424001a7d20aee7
--
2.41.0
R
[PATCH v4 2/6] gnu: openfoam-org: Refactor dependency.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7bc2b3-8b054767-1be2-4c35-a92f-eb0cce13e97d-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Move dependency paraview to from
native-inputs to propagated-inputs.
Change-Id: I64c53b3554acc3d7390c88bbf2bcbcac98cdc141
---
gnu/packages/simulation.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Toggle diff (23 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index cb6f07c383..73e53fe35f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -143,7 +143,6 @@ (define-public openfoam-org
ncurses
openmpi
openssh
- paraview
pt-scotch32
readline
zlib))
@@ -190,7 +189,7 @@ (define-public openfoam-org
utfcpp
vtk
xz))
- (propagated-inputs (list gnuplot))
+ (propagated-inputs (list paraview gnuplot))
(outputs '("debug" ;~60MB
"out"))
(arguments
--
2.41.0
R
[PATCH v4 3/6] gnu: openfoam-org: Improve internal path handling.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7bd644-e5d6a960-b3c2-48aa-9822-a7b6188ea8c4-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve handling of internal
path WM_PROJECT_DIR.
Change-Id: I43de76fb009f955294686a0b45bf3dc0217e7dc7
---
gnu/packages/simulation.scm | 57 ++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 14 deletions(-)
Toggle diff (99 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 73e53fe35f..75eb070f64 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -197,8 +197,10 @@ (define-public openfoam-org
;; Executable files and shared libraries are located in the 'platforms'
;; subdirectory.
#:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib")
+ #~(list (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
#:modules
'((ice-9 ftw)
@@ -278,7 +280,9 @@ (define-public openfoam-org
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
(ldflags
(string-append "-Wl,"
rpaths
@@ -338,19 +342,32 @@ (define-public openfoam-org
;; (with-directory-excursion "tutorials"
;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") ""))) #t))
(replace 'install
(lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (mkdir-p install-dir) ;create install directory
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (mkdir-p install-path) ;create install directory
;; move contents of build directory to install directory
- (copy-recursively "." install-dir))))
+ (copy-recursively "." install-path))))
(add-after 'install 'add-symbolic-link
(lambda _
(let* ((bin (string-append #$output "/bin"))
(lib (string-append #$output "/lib"))
+ (etc (string-append #$output "/etc"))
(openfoam (string-append #$output
- "/share/OpenFOAM"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)))
(build-bin (string-append openfoam
"/platforms/linux64GccDPInt32Opt/bin"))
(build-lib (string-append openfoam
@@ -373,12 +390,24 @@ (define-public openfoam-org
(string-append bin "/" file))))
(scandir foam-bin))
;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
+ (symlink build-lib lib)
+ ;; add symbolic link for bashrc file
+ (mkdir-p etc)
+ (symlink (string-append openfoam "/etc/bashrc")
+ (string-append etc "/bashrc"))) #t))
+ (add-after 'add-symbolic-link 'wrap
+ (lambda* (#:key python inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append #$output "/bin"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (for-each
+ (lambda (program)
+ (unless (member program
+ '("." ".."))
+ (wrap-program (string-append bin "/" program)
+ `("WM_PROJECT_DIR" ":" prefix (,openfoam)))))
+ (scandir bin))))))))
;; Note:
;; Tutorial files are installed read-only in /gnu/store.
;; To allow write permissions on files copied from the store a
--
2.41.0
R
[PATCH v4 6/6] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7c1445-1ace1095-2585-4777-b163-26f247d87f01-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-com): Update to 2306.

Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d
---
gnu/packages/simulation.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b33f24a5f4..f01044e76a 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -444,7 +444,7 @@ (define-public openfoam-com
(package
(inherit openfoam-org)
(name "openfoam-com")
- (version "2212")
+ (version "2306")
(source (origin
(method url-fetch)
(uri (string-append "https://develop.openfoam.com"
@@ -455,7 +455,7 @@ (define-public openfoam-com
".tar.gz"))
(sha256
(base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
(modules '((guix build utils)))
(snippet `(begin
(substitute* "etc/bashrc"
--
2.41.0
R
[PATCH v4 4/6] gnu: openfoam-org: Improve build clean up.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7bed2d-635d8749-047e-4f80-9b20-6ad52e4d9eea-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve build tree cleanup for
package reproducibility.

Change-Id: I59193f16a7d9598a9bc842f1c6091369c47906a8
---
gnu/packages/simulation.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 75eb070f64..c6041643c8 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -328,7 +328,9 @@ (define-public openfoam-org
(delete-file-recursively
"platforms/linux64GccDPInt32OptOPENMPI"))
(for-each delete-file
- (find-files "." "\\.o$")) #t))
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all") #t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
--
2.41.0
R
[PATCH v4 5/6] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1b7bfef1-05ec3c68-24bb-43c0-9ef1-17ec3a472f76-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11.
Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410
---
gnu/packages/simulation.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Toggle diff (33 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index c6041643c8..b33f24a5f4 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -91,17 +91,18 @@ (define-module (gnu packages simulation)
(define-public openfoam-org
(package
(name "openfoam-org")
- (version "10.20230119")
+ (version "11")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
(sha256
(base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
(modules '((guix build utils)))
(snippet `(begin
;; patch shell paths
--
2.41.0
C
C
Christopher Baines wrote on 29 Nov 2023 17:06
Re: Failed to build in QA
(name . Reza Housseini)(address . reza.housseini@gmail.com)
87plzslez6.fsf@cbaines.net
Reza Housseini <reza.housseini@gmail.com> writes:

Toggle quote (10 lines)
> Hi Christopher
>
> I submitted a new revision to the issue, but the QA link shows
>
> Issue not found
> This could mean the issue does not exist, it has no patches or has
> been closed.
>
> do you know what the problem is here?

There's two issues, one is the machine running Patchwork is low on disk
space, and that keeps stopping new messages being processed. I've
resolved that for now.

The other issue with the v4 series is that Patchwork has got confused
and only picked out the first of the v4 patches. The threading also
looks weird to me in my email client, but I'm not quite sure why. How
did you send the v4 patches?

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmVnYe1fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XdEBg//a2oqbjDnb6j7lGTyBw4WuaGbDZaN4vEl
v3yrwZGO2sLY0TiFDXDER8NGLyIkKqb7aNQDND0GT8V30yczZfv/9oTUwjMwBO6M
E6pocTYUf4iaQazp/p6iilc9NRg/S7aaAI4o5KWLBgXQXWBCrgoDgUm4iSXOSGSM
8UbKjBchem6NTfx6yP3J5ZZuAGDMfY7B3GJkGX2Hp88NVUyFOwdFmG/2/INqcyqC
r84FLIHg3EnPFPSge0jm9q4cED+SSYGWYqHGf+Ts7hkzBOu/IXsv6rqWAelX3lXG
nhKTYYPvf8E92SyPpRdU1iYWWgzX0uR+MvC5PzFTrOPRK/UlLvFPs62FV/Tz3NHG
pw/IbkQjoVb961GUAGAYKnMs0OpFTBGghHOeLu5a6csf5umg9JkvMtLMBSHfjaH2
kkey9Gc9lMJIrmTIaNE5KRXPMfP1MwaUF5ps2tNZ965tELCDWj5DOjp6wKlLWnFX
kgLwMbLFXbhAG/A84Hppaw2NmJ3YHoLbcvXcfv6+LNfxZC4JZdzcuK34xXhxgR93
E18Wsj0KPBZ8ll7C7UHIFiYvCtnAaDutLwzQizzvJO8UP/iVkcxmadDQIDS/iu0e
Lv5vWquL3hCC04N/C8bEoUFi+E55rj4rxqyB/locPm+NKGYTALT6hwzGrPrv5E5Q
eIV8i1SFeJA=
=zP/g
-----END PGP SIGNATURE-----

R
R
Reza Housseini wrote on 29 Nov 2023 15:49
(name . Christopher Baines)(address . mail@cbaines.net)
d54d6122-b50f-3189-f500-1475f07d1269@gmail.com
Hi Christopher
I submitted a new revision to the issue, but the QA link shows
Issue not found
This could mean the issue does not exist, it has no patches or has been
closed.
do you know what the problem is here?
Thanks for your help,
Best,
Reza
R
R
reza.housseini@gmail.com wrote on 29 Nov 2023 17:35
(name . Christopher Baines)(address . mail@cbaines.net)
5B2CC699-5047-4F0C-9245-985BE9AA82B8@gmail.com
Toggle quote (4 lines)
>There's two issues, one is the machine running Patchwork is low on disk
>space, and that keeps stopping new messages being processed. I've
>resolved that for now.

Thanks!

Toggle quote (5 lines)
>The other issue with the v4 series is that Patchwork has got confused
>and only picked out the first of the v4 patches. The threading also
>looks weird to me in my email client, but I'm not quite sure why. How
>did you send the v4 patches?

I sent them with git send-mail but I also noticed that the order got mixed up in issues.guix.gnu.org, no idea how this happened...
A
A
Attila Lendvai wrote on 29 Nov 2023 20:54
(name . reza.housseini@gmail.com)(address . reza.housseini@gmail.com)
xwNeT6gUzeFCqfOOAg53EInzT5z7xQjDmgAGLj0krB6NsrtlH_SoqmcHO89p9ACLbrX2cBsVSew0AZHGPjhsZQ7u4EMUPyOsmif21Bbs2dU=@lendvai.name
Toggle quote (10 lines)
> > The other issue with the v4 series is that Patchwork has got confused
> > and only picked out the first of the v4 patches. The threading also
> > looks weird to me in my email client, but I'm not quite sure why. How
> > did you send the v4 patches?
>
>
> I sent them with git send-mail but I also noticed that the order got
> mixed up in issues.guix.gnu.org, no idea how this happened...


i also see this every once in a while. i guess it's because the SMTP server-farm receives mutliple emails in close proximity, and they end up reaching debbugs in a different order.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“In matters of conscience, the law of majority has no place.”
— Mahatma Gandhi (1869–1948)
R
Re: [bug#66262] Failed to build in QA
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
0102018c1cb56a26-f31f78b5-860b-47e3-897e-48bc95896826-000000@eu-west-1.amazonses.com
Toggle quote (1 lines)
> i also see this every once in a while. i guess it's because the SMTP server-farm receives mutliple emails in close proximity, and they end up reaching debbugs in a different order.
What is the way to go here, shall I just resubmit?
R
[PATCH v5 1/6] gnu: openfoam-org: Use gexps.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccef519-02ab42c1-6093-4f6c-aa96-93fae11a2422-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Use gexps, other cosmetic changes.
Change-Id: I856d9660559cb4656251cba6bc5dd31d004f1b74
---
gnu/packages/simulation.scm | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
Toggle diff (98 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..cb6f07c383 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -238,13 +238,10 @@ (define-public openfoam-org
(string-append "export SCOTCH_VERSION=scotch_"
#$(package-version pt-scotch32) "\n"))
(("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n"))) #t))
(add-before 'build 'patch-mpi
(lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
+ (let* ((mpi-version #$(package-version openmpi)))
;; specify openmpi type
(substitute* "etc/bashrc"
(("WM_MPLIB=SYSTEMOPENMPI")
@@ -254,8 +251,7 @@ (define-public openfoam-org
(string-append "export FOAM_MPI=openmpi-"
mpi-version "\n"))
(("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n")))) #t))
(add-before 'build 'patch-paraview
(lambda _
(substitute* "etc/config.sh/paraview"
@@ -263,12 +259,11 @@ (define-public openfoam-org
(string-append "export ParaView_VERSION="
#$(package-version paraview) "\n"))
(("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
+ (string-append "export ParaView_DIR=" #$paraview "\n"))) #t))
(add-before 'build 'add-rpaths
(lambda _
- (letrec* ((libraries '("boost" "cgal"
+ (letrec* ((libraries '("boost"
+ "cgal"
"gmp"
"metis"
"mpfr"
@@ -277,11 +272,10 @@ (define-public openfoam-org
"zlib"
"paraview"))
(rpaths
- (fold-right (lambda (library rpaths)
+ (fold-right (lambda (lib rpaths)
(string-append rpaths
"-rpath="
- (assoc-ref
- %build-inputs library)
+ (assoc-ref %build-inputs lib)
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
@@ -307,13 +301,11 @@ (define-public openfoam-org
(lambda _
(let* ((vtk-version #$(version-major+minor
(package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
(vtk-inc-flag (string-append "-I" vtk-inc)))
(substitute* "wmake/rules/linux64Gcc/c++"
(("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
+ (string-append all " " vtk-inc-flag " ")))) #t))
(delete 'configure) ;no configure phase
(replace 'build
(lambda _
@@ -400,6 +392,7 @@ (define-public openfoam-org
;; $ cd pitzDaily
;; $ chmod -R u+w .
;; $ blockMesh
+ (home-page "https://openfoam.org")
(synopsis "Framework for numerical simulation of fluid flow")
(description
"OpenFOAM provides a set of solvers and methods for tackling
@@ -410,8 +403,7 @@ (define-public openfoam-org
sharp gradients, such as those encountered in flows with shock waves and flows
with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
+ (license license:gpl3+)))
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
--
2.41.0
R
[PATCH v5 3/6] gnu: openfoam-org: Improve internal path handling.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccefd42-56f59917-da2f-47d0-811f-63af76b3da98-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve handling of internal
path WM_PROJECT_DIR.
Change-Id: I43de76fb009f955294686a0b45bf3dc0217e7dc7
---
gnu/packages/simulation.scm | 57 ++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 14 deletions(-)
Toggle diff (99 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 73e53fe35f..75eb070f64 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -197,8 +197,10 @@ (define-public openfoam-org
;; Executable files and shared libraries are located in the 'platforms'
;; subdirectory.
#:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib")
+ #~(list (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
#:modules
'((ice-9 ftw)
@@ -278,7 +280,9 @@ (define-public openfoam-org
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
(ldflags
(string-append "-Wl,"
rpaths
@@ -338,19 +342,32 @@ (define-public openfoam-org
;; (with-directory-excursion "tutorials"
;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") ""))) #t))
(replace 'install
(lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (mkdir-p install-dir) ;create install directory
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (mkdir-p install-path) ;create install directory
;; move contents of build directory to install directory
- (copy-recursively "." install-dir))))
+ (copy-recursively "." install-path))))
(add-after 'install 'add-symbolic-link
(lambda _
(let* ((bin (string-append #$output "/bin"))
(lib (string-append #$output "/lib"))
+ (etc (string-append #$output "/etc"))
(openfoam (string-append #$output
- "/share/OpenFOAM"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)))
(build-bin (string-append openfoam
"/platforms/linux64GccDPInt32Opt/bin"))
(build-lib (string-append openfoam
@@ -373,12 +390,24 @@ (define-public openfoam-org
(string-append bin "/" file))))
(scandir foam-bin))
;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
+ (symlink build-lib lib)
+ ;; add symbolic link for bashrc file
+ (mkdir-p etc)
+ (symlink (string-append openfoam "/etc/bashrc")
+ (string-append etc "/bashrc"))) #t))
+ (add-after 'add-symbolic-link 'wrap
+ (lambda* (#:key python inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append #$output "/bin"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (for-each
+ (lambda (program)
+ (unless (member program
+ '("." ".."))
+ (wrap-program (string-append bin "/" program)
+ `("WM_PROJECT_DIR" ":" prefix (,openfoam)))))
+ (scandir bin))))))))
;; Note:
;; Tutorial files are installed read-only in /gnu/store.
;; To allow write permissions on files copied from the store a
--
2.41.0
R
[PATCH v5 5/6] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccf052e-66e376ea-d0b1-440b-8173-ea80f606f775-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11.
Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410
---
gnu/packages/simulation.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Toggle diff (33 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index c6041643c8..b33f24a5f4 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -91,17 +91,18 @@ (define-module (gnu packages simulation)
(define-public openfoam-org
(package
(name "openfoam-org")
- (version "10.20230119")
+ (version "11")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
(sha256
(base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
(modules '((guix build utils)))
(snippet `(begin
;; patch shell paths
--
2.41.0
R
[PATCH v5 4/6] gnu: openfoam-org: Improve build clean up.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccf0d0d-9fb0ccc6-9db3-4cee-afed-de5446aecf79-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve build tree cleanup for
package reproducibility.

Change-Id: I59193f16a7d9598a9bc842f1c6091369c47906a8
---
gnu/packages/simulation.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 75eb070f64..c6041643c8 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -328,7 +328,9 @@ (define-public openfoam-org
(delete-file-recursively
"platforms/linux64GccDPInt32OptOPENMPI"))
(for-each delete-file
- (find-files "." "\\.o$")) #t))
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all") #t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
--
2.41.0
R
[PATCH v5 6/6] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccf38d0-8d630963-7b7e-45c3-8ff5-e34503334350-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-com): Update to 2306.

Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d
---
gnu/packages/simulation.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b33f24a5f4..f01044e76a 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -444,7 +444,7 @@ (define-public openfoam-com
(package
(inherit openfoam-org)
(name "openfoam-com")
- (version "2212")
+ (version "2306")
(source (origin
(method url-fetch)
(uri (string-append "https://develop.openfoam.com"
@@ -455,7 +455,7 @@ (define-public openfoam-com
".tar.gz"))
(sha256
(base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
(modules '((guix build utils)))
(snippet `(begin
(substitute* "etc/bashrc"
--
2.41.0
R
[PATCH v5 2/6] gnu: openfoam-org: Refactor dependency.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1ccf4b62-56604a1d-c6a5-4bd3-9c3b-d17fc61d1746-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Move dependency paraview to from
native-inputs to propagated-inputs.
Change-Id: I64c53b3554acc3d7390c88bbf2bcbcac98cdc141
---
gnu/packages/simulation.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Toggle diff (23 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index cb6f07c383..73e53fe35f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -143,7 +143,6 @@ (define-public openfoam-org
ncurses
openmpi
openssh
- paraview
pt-scotch32
readline
zlib))
@@ -190,7 +189,7 @@ (define-public openfoam-org
utfcpp
vtk
xz))
- (propagated-inputs (list gnuplot))
+ (propagated-inputs (list paraview gnuplot))
(outputs '("debug" ;~60MB
"out"))
(arguments
--
2.41.0
R
[PATCH v6 1/6] gnu: openfoam-org: Use gexps.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f59d2c9-86fe0561-ea80-4b45-b6e2-a14c895c3791-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Use gexps, other cosmetic changes.
Change-Id: I856d9660559cb4656251cba6bc5dd31d004f1b74
---
gnu/packages/simulation.scm | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
Toggle diff (98 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..cb6f07c383 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -238,13 +238,10 @@ (define-public openfoam-org
(string-append "export SCOTCH_VERSION=scotch_"
#$(package-version pt-scotch32) "\n"))
(("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n"))) #t))
(add-before 'build 'patch-mpi
(lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
+ (let* ((mpi-version #$(package-version openmpi)))
;; specify openmpi type
(substitute* "etc/bashrc"
(("WM_MPLIB=SYSTEMOPENMPI")
@@ -254,8 +251,7 @@ (define-public openfoam-org
(string-append "export FOAM_MPI=openmpi-"
mpi-version "\n"))
(("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n")))) #t))
(add-before 'build 'patch-paraview
(lambda _
(substitute* "etc/config.sh/paraview"
@@ -263,12 +259,11 @@ (define-public openfoam-org
(string-append "export ParaView_VERSION="
#$(package-version paraview) "\n"))
(("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
+ (string-append "export ParaView_DIR=" #$paraview "\n"))) #t))
(add-before 'build 'add-rpaths
(lambda _
- (letrec* ((libraries '("boost" "cgal"
+ (letrec* ((libraries '("boost"
+ "cgal"
"gmp"
"metis"
"mpfr"
@@ -277,11 +272,10 @@ (define-public openfoam-org
"zlib"
"paraview"))
(rpaths
- (fold-right (lambda (library rpaths)
+ (fold-right (lambda (lib rpaths)
(string-append rpaths
"-rpath="
- (assoc-ref
- %build-inputs library)
+ (assoc-ref %build-inputs lib)
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
@@ -307,13 +301,11 @@ (define-public openfoam-org
(lambda _
(let* ((vtk-version #$(version-major+minor
(package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
(vtk-inc-flag (string-append "-I" vtk-inc)))
(substitute* "wmake/rules/linux64Gcc/c++"
(("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
+ (string-append all " " vtk-inc-flag " ")))) #t))
(delete 'configure) ;no configure phase
(replace 'build
(lambda _
@@ -400,6 +392,7 @@ (define-public openfoam-org
;; $ cd pitzDaily
;; $ chmod -R u+w .
;; $ blockMesh
+ (home-page "https://openfoam.org")
(synopsis "Framework for numerical simulation of fluid flow")
(description
"OpenFOAM provides a set of solvers and methods for tackling
@@ -410,8 +403,7 @@ (define-public openfoam-org
sharp gradients, such as those encountered in flows with shock waves and flows
with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
+ (license license:gpl3+)))
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
--
2.41.0
R
[PATCH v6 2/6] gnu: openfoam-org: Refactor dependency.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f60ec12-161b99f7-d467-4b62-b3fd-560da6ad919a-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Move dependency paraview to from
native-inputs to propagated-inputs.
Change-Id: I64c53b3554acc3d7390c88bbf2bcbcac98cdc141
---
gnu/packages/simulation.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Toggle diff (26 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index cb6f07c383..73e53fe35f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -143,7 +143,6 @@ (define-public openfoam-org
ncurses
openmpi
openssh
- paraview
pt-scotch32
readline
zlib))
@@ -190,7 +189,7 @@ (define-public openfoam-org
utfcpp
vtk
xz))
- (propagated-inputs (list gnuplot))
+ (propagated-inputs (list paraview gnuplot))
(outputs '("debug" ;~60MB
"out"))
(arguments
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
prerequisite-patch-id: e928ac9ae5a11e33ced4f46fed14ea984b551d0c
--
2.41.0
R
[PATCH v6 3/6] gnu: openfoam-org: Improve internal path handling.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f638b54-d6cf3a44-a138-4161-b415-b1529a9c1ae7-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve handling of internal
path WM_PROJECT_DIR.
Change-Id: I43de76fb009f955294686a0b45bf3dc0217e7dc7
---
gnu/packages/simulation.scm | 57 ++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 14 deletions(-)
Toggle diff (103 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 73e53fe35f..75eb070f64 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -197,8 +197,10 @@ (define-public openfoam-org
;; Executable files and shared libraries are located in the 'platforms'
;; subdirectory.
#:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib")
+ #~(list (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
#:modules
'((ice-9 ftw)
@@ -278,7 +280,9 @@ (define-public openfoam-org
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
(ldflags
(string-append "-Wl,"
rpaths
@@ -338,19 +342,32 @@ (define-public openfoam-org
;; (with-directory-excursion "tutorials"
;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") ""))) #t))
(replace 'install
(lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (mkdir-p install-dir) ;create install directory
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (mkdir-p install-path) ;create install directory
;; move contents of build directory to install directory
- (copy-recursively "." install-dir))))
+ (copy-recursively "." install-path))))
(add-after 'install 'add-symbolic-link
(lambda _
(let* ((bin (string-append #$output "/bin"))
(lib (string-append #$output "/lib"))
+ (etc (string-append #$output "/etc"))
(openfoam (string-append #$output
- "/share/OpenFOAM"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)))
(build-bin (string-append openfoam
"/platforms/linux64GccDPInt32Opt/bin"))
(build-lib (string-append openfoam
@@ -373,12 +390,24 @@ (define-public openfoam-org
(string-append bin "/" file))))
(scandir foam-bin))
;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
+ (symlink build-lib lib)
+ ;; add symbolic link for bashrc file
+ (mkdir-p etc)
+ (symlink (string-append openfoam "/etc/bashrc")
+ (string-append etc "/bashrc"))) #t))
+ (add-after 'add-symbolic-link 'wrap
+ (lambda* (#:key python inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append #$output "/bin"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (for-each
+ (lambda (program)
+ (unless (member program
+ '("." ".."))
+ (wrap-program (string-append bin "/" program)
+ `("WM_PROJECT_DIR" ":" prefix (,openfoam)))))
+ (scandir bin))))))))
;; Note:
;; Tutorial files are installed read-only in /gnu/store.
;; To allow write permissions on files copied from the store a
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
prerequisite-patch-id: e928ac9ae5a11e33ced4f46fed14ea984b551d0c
prerequisite-patch-id: ff305aca25644db4a2b385cd2a9980df4ca457d5
--
2.41.0
R
[PATCH v6 4/6] gnu: openfoam-org: Improve build clean up.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f72fa7b-c5c0531a-16e4-48e0-8259-5240c64d3edb-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve build tree cleanup for
package reproducibility.

Change-Id: I59193f16a7d9598a9bc842f1c6091369c47906a8
---
gnu/packages/simulation.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 75eb070f64..c6041643c8 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -328,7 +328,9 @@ (define-public openfoam-org
(delete-file-recursively
"platforms/linux64GccDPInt32OptOPENMPI"))
(for-each delete-file
- (find-files "." "\\.o$")) #t))
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all") #t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?

base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
prerequisite-patch-id: e928ac9ae5a11e33ced4f46fed14ea984b551d0c
prerequisite-patch-id: ff305aca25644db4a2b385cd2a9980df4ca457d5
prerequisite-patch-id: b429416cc65454ac2af04a12b8bc93d7b87fbda8
--
2.41.0
R
[PATCH v6 5/6] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f765fa5-2e167a23-9d58-44ab-8ca7-f4766d468af7-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11.
Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410
---
gnu/packages/simulation.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Toggle diff (39 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index c6041643c8..b33f24a5f4 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -91,17 +91,18 @@ (define-module (gnu packages simulation)
(define-public openfoam-org
(package
(name "openfoam-org")
- (version "10.20230119")
+ (version "11")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
(sha256
(base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
(modules '((guix build utils)))
(snippet `(begin
;; patch shell paths
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
prerequisite-patch-id: e928ac9ae5a11e33ced4f46fed14ea984b551d0c
prerequisite-patch-id: ff305aca25644db4a2b385cd2a9980df4ca457d5
prerequisite-patch-id: b429416cc65454ac2af04a12b8bc93d7b87fbda8
prerequisite-patch-id: f1923fb8c806820e8e71471d00fc0ab56bb4ff5c
--
2.41.0
R
[PATCH v6 6/6] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c1f78439a-cee5ea9b-ddf7-4644-b038-016b4d81adf1-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-com): Update to 2306.

Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d
---
gnu/packages/simulation.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b33f24a5f4..f01044e76a 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -444,7 +444,7 @@ (define-public openfoam-com
(package
(inherit openfoam-org)
(name "openfoam-com")
- (version "2212")
+ (version "2306")
(source (origin
(method url-fetch)
(uri (string-append "https://develop.openfoam.com"
@@ -455,7 +455,7 @@ (define-public openfoam-com
".tar.gz"))
(sha256
(base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
(modules '((guix build utils)))
(snippet `(begin
(substitute* "etc/bashrc"

base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
prerequisite-patch-id: e928ac9ae5a11e33ced4f46fed14ea984b551d0c
prerequisite-patch-id: ff305aca25644db4a2b385cd2a9980df4ca457d5
prerequisite-patch-id: b429416cc65454ac2af04a12b8bc93d7b87fbda8
prerequisite-patch-id: f1923fb8c806820e8e71471d00fc0ab56bb4ff5c
prerequisite-patch-id: 95f7502d97cb847e3c6a53899d6513377f9475b9
--
2.41.0
R
Re: [bug#66262] Failed to build in QA
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
0102018c1f7bd492-8f6a4efd-4235-445b-8264-5dd32ba46240-000000@eu-west-1.amazonses.com
On 11/29/23 21:11, reza via Guix-patches via wrote:
Toggle quote (3 lines)
>> i also see this every once in a while. i guess it's because the SMTP server-farm receives mutliple emails in close proximity, and they end up reaching debbugs in a different order.
>
> What is the way to go here, shall I just resubmit?
I submitted them now (twice). The first attempt ended the same as the
former and the second time I waited until the mail appeared in the issue
tracker, a rather slow and inefficient way to submit patches.
What I do not understand is why the list seems to receive the mails in
order, but then issues.guix.gnu.org mangles them somehow. Is this a bug?
I now also have a new error for QA:
An error occurred
Sorry about that!
json-invalid
#<input:delimited input port 7f52a7ff97c0>
I have the impression I now cycled through all possible pitfalls...
R
[PATCH v7 1/7] gnu: openfoam-org: Use gexps.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b0a37-63a6f14a-1c64-4d81-a00f-6333031854bf-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Use gexps, other cosmetic changes.
Change-Id: I856d9660559cb4656251cba6bc5dd31d004f1b74
---
gnu/packages/simulation.scm | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
Toggle diff (98 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b2fb123815..cb6f07c383 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -238,13 +238,10 @@ (define-public openfoam-org
(string-append "export SCOTCH_VERSION=scotch_"
#$(package-version pt-scotch32) "\n"))
(("^export SCOTCH_ARCH_PATH=.*$")
- (string-append "export SCOTCH_ARCH_PATH="
- (assoc-ref %build-inputs "pt-scotch32")
- "\n"))) #t))
+ (string-append "export SCOTCH_ARCH_PATH=" #$pt-scotch32 "\n"))) #t))
(add-before 'build 'patch-mpi
(lambda _
- (let* ((mpi-path (assoc-ref %build-inputs "openmpi"))
- (mpi-version #$(package-version openmpi)))
+ (let* ((mpi-version #$(package-version openmpi)))
;; specify openmpi type
(substitute* "etc/bashrc"
(("WM_MPLIB=SYSTEMOPENMPI")
@@ -254,8 +251,7 @@ (define-public openfoam-org
(string-append "export FOAM_MPI=openmpi-"
mpi-version "\n"))
(("export MPI_ARCH_PATH=.*\\$FOAM_MPI.*$")
- (string-append "export MPI_ARCH_PATH=" mpi-path
- "\n")))) #t))
+ (string-append "export MPI_ARCH_PATH=" #$openmpi "\n")))) #t))
(add-before 'build 'patch-paraview
(lambda _
(substitute* "etc/config.sh/paraview"
@@ -263,12 +259,11 @@ (define-public openfoam-org
(string-append "export ParaView_VERSION="
#$(package-version paraview) "\n"))
(("^export ParaView_DIR=.*$")
- (string-append "export ParaView_DIR="
- (assoc-ref %build-inputs "paraview")
- "\n"))) #t))
+ (string-append "export ParaView_DIR=" #$paraview "\n"))) #t))
(add-before 'build 'add-rpaths
(lambda _
- (letrec* ((libraries '("boost" "cgal"
+ (letrec* ((libraries '("boost"
+ "cgal"
"gmp"
"metis"
"mpfr"
@@ -277,11 +272,10 @@ (define-public openfoam-org
"zlib"
"paraview"))
(rpaths
- (fold-right (lambda (library rpaths)
+ (fold-right (lambda (lib rpaths)
(string-append rpaths
"-rpath="
- (assoc-ref
- %build-inputs library)
+ (assoc-ref %build-inputs lib)
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
@@ -307,13 +301,11 @@ (define-public openfoam-org
(lambda _
(let* ((vtk-version #$(version-major+minor
(package-version vtk)))
- (vtk-root (assoc-ref %build-inputs "vtk"))
- (vtk-inc (string-append vtk-root "/include/vtk-" vtk-version))
+ (vtk-inc (string-append #$vtk "/include/vtk-" vtk-version))
(vtk-inc-flag (string-append "-I" vtk-inc)))
(substitute* "wmake/rules/linux64Gcc/c++"
(("\\$\\(LIB_HEADER_DIRS\\)" all)
- (string-append all " " vtk-inc-flag " "))))
- #t))
+ (string-append all " " vtk-inc-flag " ")))) #t))
(delete 'configure) ;no configure phase
(replace 'build
(lambda _
@@ -400,6 +392,7 @@ (define-public openfoam-org
;; $ cd pitzDaily
;; $ chmod -R u+w .
;; $ blockMesh
+ (home-page "https://openfoam.org")
(synopsis "Framework for numerical simulation of fluid flow")
(description
"OpenFOAM provides a set of solvers and methods for tackling
@@ -410,8 +403,7 @@ (define-public openfoam-org
sharp gradients, such as those encountered in flows with shock waves and flows
with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
- (license license:gpl3+)
- (home-page "https://openfoam.org")))
+ (license license:gpl3+)))
(define-public openfoam
(deprecated-package "openfoam" openfoam-org))
base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
--
2.41.0
R
[PATCH v7 2/7] gnu: openfoam-org: Refactor dependency.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b1b15-de00bec8-daed-437d-b7ae-43a527cf1bfe-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Move dependency paraview to from
native-inputs to propagated-inputs.
Change-Id: I64c53b3554acc3d7390c88bbf2bcbcac98cdc141
---
gnu/packages/simulation.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Toggle diff (23 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index cb6f07c383..73e53fe35f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -143,7 +143,6 @@ (define-public openfoam-org
ncurses
openmpi
openssh
- paraview
pt-scotch32
readline
zlib))
@@ -190,7 +189,7 @@ (define-public openfoam-org
utfcpp
vtk
xz))
- (propagated-inputs (list gnuplot))
+ (propagated-inputs (list paraview gnuplot))
(outputs '("debug" ;~60MB
"out"))
(arguments
--
2.41.0
R
[PATCH v7 3/7] gnu: openfoam-org: Improve internal path handling.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b27c4-0d31f22d-4f5d-46d5-91a1-03cc727da837-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve handling of internal
path WM_PROJECT_DIR.
Change-Id: I43de76fb009f955294686a0b45bf3dc0217e7dc7
---
gnu/packages/simulation.scm | 57 ++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 14 deletions(-)
Toggle diff (99 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 73e53fe35f..75eb070f64 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -197,8 +197,10 @@ (define-public openfoam-org
;; Executable files and shared libraries are located in the 'platforms'
;; subdirectory.
#:strip-directories
- #~(list "share/OpenFOAM/platforms/linux64GccDPInt32Opt/bin"
- "share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib")
+ #~(list (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/bin")
+ (string-append "OpenFOAM-" #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
#:modules
'((ice-9 ftw)
@@ -278,7 +280,9 @@ (define-public openfoam-org
"/lib,")) "" libraries))
(openfoam-lib
(string-append #$output
- "/share/OpenFOAM/platforms/linux64GccDPInt32Opt/lib"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)
+ "/platforms/linux64GccDPInt32Opt/lib"))
(ldflags
(string-append "-Wl,"
rpaths
@@ -338,19 +342,32 @@ (define-public openfoam-org
;; (with-directory-excursion "tutorials"
;; (invoke "bash" "-c" "source ../etc/bashrc && ./Alltest"))
) #t))
+ (add-before 'install 'set-paths
+ (lambda _
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (substitute* "etc/bashrc"
+ (("^\\[ \"\\$BASH\".*$") "")
+ (("^export FOAM_INST_DIR=\\$\\(cd.*$")
+ (string-append "export FOAM_INST_DIR=" install-path "\n"))
+ (("^export FOAM_INST_DIR=\\$HOME.*$") ""))) #t))
(replace 'install
(lambda _
- (let ((install-dir (string-append #$output
- "/share/OpenFOAM")))
- (mkdir-p install-dir) ;create install directory
+ (let ((install-path (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (mkdir-p install-path) ;create install directory
;; move contents of build directory to install directory
- (copy-recursively "." install-dir))))
+ (copy-recursively "." install-path))))
(add-after 'install 'add-symbolic-link
(lambda _
(let* ((bin (string-append #$output "/bin"))
(lib (string-append #$output "/lib"))
+ (etc (string-append #$output "/etc"))
(openfoam (string-append #$output
- "/share/OpenFOAM"))
+ "/share/OpenFOAM-"
+ #$(package-version this-package)))
(build-bin (string-append openfoam
"/platforms/linux64GccDPInt32Opt/bin"))
(build-lib (string-append openfoam
@@ -373,12 +390,24 @@ (define-public openfoam-org
(string-append bin "/" file))))
(scandir foam-bin))
;; add symbolic link for standard 'lib' directory
- (symlink build-lib lib)) #t)))))
- (native-search-paths
- (list (search-path-specification
- (variable "WM_PROJECT_DIR")
- (separator #f)
- (files '("share/OpenFOAM")))))
+ (symlink build-lib lib)
+ ;; add symbolic link for bashrc file
+ (mkdir-p etc)
+ (symlink (string-append openfoam "/etc/bashrc")
+ (string-append etc "/bashrc"))) #t))
+ (add-after 'add-symbolic-link 'wrap
+ (lambda* (#:key python inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append #$output "/bin"))
+ (openfoam (string-append #$output
+ "/share/OpenFOAM-"
+ #$(package-version this-package))))
+ (for-each
+ (lambda (program)
+ (unless (member program
+ '("." ".."))
+ (wrap-program (string-append bin "/" program)
+ `("WM_PROJECT_DIR" ":" prefix (,openfoam)))))
+ (scandir bin))))))))
;; Note:
;; Tutorial files are installed read-only in /gnu/store.
;; To allow write permissions on files copied from the store a
--
2.41.0
R
[PATCH v7 4/7] gnu: openfoam-org: Improve build clean up.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b3946-19d1f11f-bfe2-43d0-bb40-e9cb6d2a66e7-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Improve build tree cleanup for
package reproducibility.

Change-Id: I59193f16a7d9598a9bc842f1c6091369c47906a8
---
gnu/packages/simulation.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 75eb070f64..c6041643c8 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -328,7 +328,9 @@ (define-public openfoam-org
(delete-file-recursively
"platforms/linux64GccDPInt32OptOPENMPI"))
(for-each delete-file
- (find-files "." "\\.o$")) #t))
+ (find-files "." "\\.o$"))
+ ;; Remove spurious files in src tree
+ (invoke "bash" "-c" "source ./etc/bashrc && wclean all") #t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
--
2.41.0
R
[PATCH v7 5/7] gnu: openfoam-org: Update to 11.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b44f0-5c315424-1285-443d-931b-09bbb36e243f-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Update to 11.
Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410
---
gnu/packages/simulation.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Toggle diff (33 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index c6041643c8..b33f24a5f4 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -91,17 +91,18 @@ (define-module (gnu packages simulation)
(define-public openfoam-org
(package
(name "openfoam-org")
- (version "10.20230119")
+ (version "11")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version)))
- (commit (second (string-split version #\.)))))
+ (method url-fetch)
+ (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)
+ "/archive/"
+ "version-"
+ (version-major version)
+ ".tar.gz"))
(sha256
(base32
- "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
- (file-name (git-file-name name version))
+ "1h70a5ni2psx7bcx2xg6aqraj2kkbfn8mflh2akbp6k9mmpgih7b"))
(modules '((guix build utils)))
(snippet `(begin
;; patch shell paths
--
2.41.0
R
[PATCH v7 6/7] gnu: openfoam-com: Update to 2306.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b4f69-b1d41878-9e0b-46cd-aa36-ace133023b56-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-com): Update to 2306.

Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d
---
gnu/packages/simulation.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b33f24a5f4..f01044e76a 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -444,7 +444,7 @@ (define-public openfoam-com
(package
(inherit openfoam-org)
(name "openfoam-com")
- (version "2212")
+ (version "2306")
(source (origin
(method url-fetch)
(uri (string-append "https://develop.openfoam.com"
@@ -455,7 +455,7 @@ (define-public openfoam-com
".tar.gz"))
(sha256
(base32
- "0i9039hfz9gvgymkdjhjvvn5500zha3cpdbpqrzfrfi8lbz10is2"))
+ "0zlkp48vygl2a5cyl0mfpj8dsb5bffviq96rg3kws1l6ni40v7jr"))
(modules '((guix build utils)))
(snippet `(begin
(substitute* "etc/bashrc"
--
2.41.0
R
[PATCH v7 7/7] gnu: openfoam-org: Improve wrapping of binaries.
(name . 66262@debbugs.gnu.org)(address . 66262@debbugs.gnu.org)(name . reza)(address . reza@housseini.me)
0102018c270b602e-42d16a77-013b-4cca-ac8d-cc731d174e67-000000@eu-west-1.amazonses.com
* gnu/packages/simulation.scm (openfoam-org): Add all variables from
etc/bashrc to the wrapping of binaries.
Change-Id: Idf0d4d9a043dfff806b6fb1871c1931794c1935b
---
gnu/packages/simulation.scm | 159 +++++++++++++++++++++++++++++++++++-
1 file changed, 155 insertions(+), 4 deletions(-)
Toggle diff (177 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index f01044e76a..6b61783c2c 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -401,15 +401,166 @@ (define-public openfoam-org
(add-after 'add-symbolic-link 'wrap
(lambda* (#:key python inputs outputs #:allow-other-keys)
(let* ((bin (string-append #$output "/bin"))
- (openfoam (string-append #$output
- "/share/OpenFOAM-"
- #$(package-version this-package))))
+ (openfoam-version #$(package-version this-package))
+ (openfoam-root (string-append #$output
+ "/share/OpenFOAM-"
+ openfoam-version))
+ (openmpi-version #$(package-version openmpi))
+ (paraview-version #$(package-version paraview))
+ (paraview-version-major+minor
+ #$(version-major+minor (package-version paraview))))
(for-each
(lambda (program)
(unless (member program
'("." ".."))
+ ;; wrap the programs with all the variables created by sourcing
+ ;; etc/bashrc
(wrap-program (string-append bin "/" program)
- `("WM_PROJECT_DIR" ":" prefix (,openfoam)))))
+ `("WM_PROJECT_INST_DIR" = (,openfoam-root))
+ `("WM_PROJECT_DIR" = (,openfoam-root))
+ '("WM_PROJECT" = ("OpenFOAM"))
+ `("WM_PROJECT_VERSION" = (,openfoam-version))
+ '("WM_COMPILER_TYPE" = ("system"))
+ '("WM_COMPILER" = ("Gcc"))
+ '("WM_ARCH_OPTION" = ("64"))
+ '("WM_PRECISION_OPTION" = ("DP"))
+ '("WM_LABEL_SIZE" = ("32"))
+ '("WM_COMPILE_OPTION" = ("Opt"))
+ '("WM_MPLIB" = ("OPENMPI"))
+ '("WM_OSTYPE" = ("POSIX"))
+ '("WM_OPTIONS" = ("linux64GccDPInt32Opt"))
+ `("WM_PROJECT_USER_DIR" = (,(string-append
+ "$HOME/OpenFOAM/$USER-"
+ openfoam-version)))
+ `("WM_THIRD_PARTY_DIR" = (,(string-append
+ openfoam-root
+ "/ThirdParty-"
+ openfoam-version)))
+ '("WM_LABEL_OPTION" = ("Int32"))
+ '("WM_LINK_LANGUAGE" = ("c++"))
+ '("WM_COMPILER_LIB_ARCH" = ("64"))
+ `("WM_DIR" = (,(string-append openfoam-root "/wmake")))
+ '("WM_LDFLAGS" = ("-m64"))
+ '("WM_CC" = ("gcc"))
+ '("WM_CFLAGS" = ("-m64 -fPIC"))
+ '("WM_CXX" = ("g++"))
+ '("WM_CXXFLAGS" = ("-m64 -fPIC -std=c++0x"))
+
+ `("FOAM_INST_DIR" = (,openfoam-root))
+ `("FOAM_APP" = (,(string-append openfoam-root
+ "/applications")))
+ `("FOAM_SRC" = (,(string-append openfoam-root "/src")))
+ `("FOAM_ETC" = (,(string-append openfoam-root "/etc")))
+ `("FOAM_TUTORIALS" = (,(string-append openfoam-root
+ "/tutorials")))
+ `("FOAM_UTILITIES" = (,(string-append
+ openfoam-root
+ "/applications/utilities")))
+ `("FOAM_SOLVERS" = (,(string-append
+ openfoam-root
+ "/applications/solvers")))
+ `("FOAM_MPI" = (,(string-append "openmpi-"
+ openmpi-version)))
+ `("FOAM_RUN" = (,(string-append "$HOME/OpenFOAM/$USER-"
+ openfoam-version "/run")))
+ `("FOAM_EXT_LIBBIN" = (,(string-append
+ openfoam-root
+ "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32/lib")))
+ `("FOAM_APPBIN" = (,(string-append
+ openfoam-root
+ "/platforms/linux64GccDPInt32Opt/bin")))
+ `("FOAM_JOB_DIR" = (,(string-append openfoam-root
+ "/jobControl")))
+ `("FOAM_LIBBIN" = (,(string-append
+ openfoam-root
+ "/platforms/linux64GccDPInt32Opt/lib")))
+ `("FOAM_SITE_LIBBIN" = (,(string-append
+ openfoam-root
+ "/site/"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/lib")))
+ `("FOAM_SITE_APPBIN" = (,(string-append
+ openfoam-root
+ "/site/"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/bin")))
+ `("FOAM_USER_LIBBIN" = (,(string-append
+ "$HOME/OpenFOAM/$USER-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/lib")))
+ `("FOAM_USER_APPBIN" = (,(string-append
+ "$HOME/OpenFOAM/$USER-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/bin")))
+ `("FOAM_MODULES" = (,(string-append openfoam-root
+ "/applications/modules")))
+ '("FOAM_SIGFPE" = (""))
+ '("FOAM_SETTINGS" = (""))
+
+ `("ParaView_INCLUDE_DIR" = (,(string-append #$paraview
+ "/include/paraview-"
+ paraview-version-major+minor)))
+ '("ParaView_GL" = ("mesa"))
+ `("ParaView_VERSION" = (,paraview-version))
+ `("ParaView_MAJOR" = (,paraview-version-major+minor))
+ `("ParaView_DIR" = (,#$paraview))
+ `("PV_PLUGIN_PATH" = (,(string-append
+ openfoam-root
+ "/platforms/linux64GccDPInt32Opt/lib/paraview-"
+ paraview-version-major+minor)))
+
+ `("MPI_ARCH_PATH" = (,#$openmpi))
+ `("OPAL_PREFIX" = (,#$openmpi))
+ '("MPI_BUFFER_SIZE" = ("20000000"))
+
+ `("LD_LIBRARY_PATH" prefix
+ (,(string-append openfoam-root "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64Gcc/gperftools-svn/lib")
+ ,(string-append #$paraview "/lib")
+ ,(string-append openfoam-root
+ "/platforms/linux64GccDPInt32Opt/lib/openmpi-"
+ openmpi-version)
+ ,(string-append openfoam-root "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32/lib/openmpi-"
+ openmpi-version)
+ ,(string-append #$openmpi "/lib")
+ ,(string-append #$openmpi "/lib64")
+ ,(string-append "$HOME/OpenFOAM/$USER-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/lib")
+ ,(string-append openfoam-root "/site/"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/lib")
+ ,(string-append openfoam-root
+ "/platforms/linux64GccDPInt32Opt/lib")
+ ,(string-append openfoam-root "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32/lib")
+ ,(string-append openfoam-root
+ "/platforms/linux64GccDPInt32Opt/lib/dummy")))
+ `("PATH" prefix
+ (,(string-append openfoam-root "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64Gcc/gperftools-svn/bin")
+ ,(string-append #$paraview "/bin")
+ ,(string-append openfoam-root "/ThirdParty-"
+ openfoam-version
+ "/platforms/linux64Gcc/cmake-*/bin")
+ ,(string-append #$openmpi "/bin")
+ ,(string-append openfoam-root "/bin")
+ ,(string-append openfoam-root "/wmake")
+ ,(string-append "$HOME/OpenFOAM/$USER-"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/bin")
+ ,(string-append openfoam-root "/site/"
+ openfoam-version
+ "/platforms/linux64GccDPInt32Opt/bin")
+ ,(string-append openfoam-root
+ "/platforms/linux64GccDPInt32Opt/bin"))))))
(scandir bin))))))))
;; Note:
;; Tutorial files are installed read-only in /gnu/store.
--
2.41.0
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 66262@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66262
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch