Package: guix-patches;
Reported by: reza <reza <at> housseini.me>
Date: Fri, 29 Sep 2023 09:02:02 UTC
Severity: normal
Tags: patch
Done: reza <reza <at> housseini.me>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66262 in the body.
You can then email your comments to 66262 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:02:02 GMT) Full text and rfc822 format available.reza <reza <at> housseini.me>
:guix-patches <at> gnu.org
.
(Fri, 29 Sep 2023 09:02:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: guix-patches <at> gnu.org <guix-patches <at> gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH 0/3] Update openfoam and fix bugs Date: Fri, 29 Sep 2023 09:00:35 +0000
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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:04:01 GMT) Full text and rfc822 format available.Message #8 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH 1/3] gnu: Add openfoam-package. Date: Fri, 29 Sep 2023 09:03:03 +0000
* 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(+) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:04:02 GMT) Full text and rfc822 format available.Message #11 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH 3/3] gnu: openfoam-com: Update to 2306. Date: Fri, 29 Sep 2023 09:03:11 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:04:02 GMT) Full text and rfc822 format available.Message #14 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH 2/3] gnu: openfoam-org: Update to 11. Date: Fri, 29 Sep 2023 09:03:07 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:41:02 GMT) Full text and rfc822 format available.Message #17 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v2 0/3] Update openfoam Date: Fri, 29 Sep 2023 09:39:41 +0000
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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:41:03 GMT) Full text and rfc822 format available.Message #20 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v2 1/3] gnu: Add openfoam-package. Date: Fri, 29 Sep 2023 09:39:50 +0000
* 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(+) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:41:03 GMT) Full text and rfc822 format available.Message #23 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v2 2/3] gnu: openfoam-org: Update to 11. Date: Fri, 29 Sep 2023 09:39:54 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 29 Sep 2023 09:41:04 GMT) Full text and rfc822 format available.Message #26 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v2 3/3] gnu: openfoam-com: Update to 2306. Date: Fri, 29 Sep 2023 09:40:00 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 06 Oct 2023 12:21:02 GMT) Full text and rfc822 format available.Message #29 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Christopher Baines <mail <at> cbaines.net> To: "reza.housseini <at> gmail.com" <reza.housseini <at> gmail.com> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Fri, 06 Oct 2023 13:14:58 +0100
[Message part 1 (text/plain, inline)]
"reza.housseini <at> gmail.com" <reza.housseini <at> gmail.com> writes: > On October 5, 2023 10:49:06 AM GMT+02:00, Christopher Baines <mail <at> cbaines.net> wrote: >> >>"reza.housseini <at> gmail.com" <reza.housseini <at> 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.
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Mon, 09 Oct 2023 14:06:01 GMT) Full text and rfc822 format available.Message #32 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Reza Housseini <reza.housseini <at> gmail.com> To: Christopher Baines <mail <at> cbaines.net> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Mon, 9 Oct 2023 14:40:40 +0200
[Message part 1 (text/plain, inline)]
> 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...
[OpenPGP_0xC375C6AF05125C52.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Tue, 10 Oct 2023 06:26:02 GMT) Full text and rfc822 format available.Message #35 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v3 0/3] Remove paraview plugin search path. Date: Tue, 10 Oct 2023 06:25:21 +0000
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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Tue, 10 Oct 2023 06:27:02 GMT) Full text and rfc822 format available.Message #38 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v3 2/3] gnu: openfoam-org: Update to 11. Date: Tue, 10 Oct 2023 06:25:29 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Tue, 10 Oct 2023 06:27:02 GMT) Full text and rfc822 format available.Message #41 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v3 1/3] gnu: Add openfoam-package. Date: Tue, 10 Oct 2023 06:25:28 +0000
* 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(+) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Tue, 10 Oct 2023 06:27:02 GMT) Full text and rfc822 format available.Message #44 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v3 3/3] gnu: openfoam-com: Update to 2306. Date: Tue, 10 Oct 2023 06:25:30 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Tue, 10 Oct 2023 17:10:02 GMT) Full text and rfc822 format available.Message #47 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Christopher Baines <mail <at> cbaines.net> To: Reza Housseini <reza.housseini <at> gmail.com> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Tue, 10 Oct 2023 18:09:04 +0100
[Message part 1 (text/plain, inline)]
Reza Housseini <reza.housseini <at> gmail.com> writes: >> 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.
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 20 Oct 2023 11:23:03 GMT) Full text and rfc822 format available.Message #50 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: "reza.housseini <at> gmail.com" <reza.housseini <at> gmail.com> To: Christopher Baines <mail <at> cbaines.net> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Fri, 20 Oct 2023 07:57:44 +0000
On October 9, 2023 12:40:40 PM UTC, Reza Housseini <reza.housseini <at> gmail.com> wrote: >> 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...
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:02 GMT) Full text and rfc822 format available.Message #53 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 1/6] gnu: openfoam-org: Use gexps. Date: Wed, 29 Nov 2023 14:28:54 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:03 GMT) Full text and rfc822 format available.Message #56 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 2/6] gnu: openfoam-org: Refactor dependency. Date: Wed, 29 Nov 2023 14:29:04 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:03 GMT) Full text and rfc822 format available.Message #59 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 3/6] gnu: openfoam-org: Improve internal path handling. Date: Wed, 29 Nov 2023 14:29:09 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:04 GMT) Full text and rfc822 format available.Message #62 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 6/6] gnu: openfoam-com: Update to 2306. Date: Wed, 29 Nov 2023 14:29:25 +0000
* gnu/packages/simulation.scm (openfoam-com): Update to 2306. Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d --- gnu/packages/simulation.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:05 GMT) Full text and rfc822 format available.Message #65 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 4/6] gnu: openfoam-org: Improve build clean up. Date: Wed, 29 Nov 2023 14:29:15 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 14:30:05 GMT) Full text and rfc822 format available.Message #68 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v4 5/6] gnu: openfoam-org: Update to 11. Date: Wed, 29 Nov 2023 14:29:20 +0000
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410 --- gnu/packages/simulation.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 16:09:01 GMT) Full text and rfc822 format available.Message #71 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Christopher Baines <mail <at> cbaines.net> To: Reza Housseini <reza.housseini <at> gmail.com> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Wed, 29 Nov 2023 16:06:43 +0000
[Message part 1 (text/plain, inline)]
Reza Housseini <reza.housseini <at> gmail.com> writes: > 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
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 16:10:02 GMT) Full text and rfc822 format available.Message #74 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Reza Housseini <reza.housseini <at> gmail.com> To: Christopher Baines <mail <at> cbaines.net> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Wed, 29 Nov 2023 15:49:16 +0100
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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 17:13:02 GMT) Full text and rfc822 format available.Message #77 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: "reza.housseini <at> gmail.com" <reza.housseini <at> gmail.com> To: Christopher Baines <mail <at> cbaines.net> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org Subject: Re: Failed to build in QA Date: Wed, 29 Nov 2023 16:35:57 +0000
>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! >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...
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 19:56:02 GMT) Full text and rfc822 format available.Message #80 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: Attila Lendvai <attila <at> lendvai.name> To: "reza.housseini <at> gmail.com" <reza.housseini <at> gmail.com> Cc: guix-devel <at> gnu.org, 66262 <at> debbugs.gnu.org, Christopher Baines <mail <at> cbaines.net> Subject: Re: Failed to build in QA Date: Wed, 29 Nov 2023 19:54:48 +0000
> > 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)
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:12:02 GMT) Full text and rfc822 format available.Message #83 received at submit <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: guix-patches <at> gnu.org <guix-patches <at> gnu.org> Subject: Re: [bug#66262] Failed to build in QA Date: Wed, 29 Nov 2023 20:11:40 +0000
> 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?
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:40:02 GMT) Full text and rfc822 format available.Message #86 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 1/6] gnu: openfoam-org: Use gexps. Date: Wed, 29 Nov 2023 20:39:34 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:40:03 GMT) Full text and rfc822 format available.Message #89 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 3/6] gnu: openfoam-org: Improve internal path handling. Date: Wed, 29 Nov 2023 20:39:36 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:41:02 GMT) Full text and rfc822 format available.Message #92 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 5/6] gnu: openfoam-org: Update to 11. Date: Wed, 29 Nov 2023 20:39:38 +0000
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410 --- gnu/packages/simulation.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:41:03 GMT) Full text and rfc822 format available.Message #95 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 4/6] gnu: openfoam-org: Improve build clean up. Date: Wed, 29 Nov 2023 20:39:40 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:41:03 GMT) Full text and rfc822 format available.Message #98 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 6/6] gnu: openfoam-com: Update to 2306. Date: Wed, 29 Nov 2023 20:39:51 +0000
* gnu/packages/simulation.scm (openfoam-com): Update to 2306. Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d --- gnu/packages/simulation.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Wed, 29 Nov 2023 20:41:03 GMT) Full text and rfc822 format available.Message #101 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v5 2/6] gnu: openfoam-org: Refactor dependency. Date: Wed, 29 Nov 2023 20:39:56 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 08:31:02 GMT) Full text and rfc822 format available.Message #104 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 1/6] gnu: openfoam-org: Use gexps. Date: Thu, 30 Nov 2023 08:30:29 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 08:39:01 GMT) Full text and rfc822 format available.Message #107 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 2/6] gnu: openfoam-org: Refactor dependency. Date: Thu, 30 Nov 2023 08:38:14 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 08:42:02 GMT) Full text and rfc822 format available.Message #110 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 3/6] gnu: openfoam-org: Improve internal path handling. Date: Thu, 30 Nov 2023 08:41:06 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 08:59:02 GMT) Full text and rfc822 format available.Message #113 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 4/6] gnu: openfoam-org: Improve build clean up. Date: Thu, 30 Nov 2023 08:57:58 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 09:02:02 GMT) Full text and rfc822 format available.Message #116 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 5/6] gnu: openfoam-org: Update to 11. Date: Thu, 30 Nov 2023 09:01:40 +0000
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410 --- gnu/packages/simulation.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 09:05:02 GMT) Full text and rfc822 format available.Message #119 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v6 6/6] gnu: openfoam-com: Update to 2306. Date: Thu, 30 Nov 2023 09:03:44 +0000
* gnu/packages/simulation.scm (openfoam-com): Update to 2306. Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d --- gnu/packages/simulation.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Thu, 30 Nov 2023 09:09:01 GMT) Full text and rfc822 format available.Message #122 received at submit <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: guix-patches <at> gnu.org <guix-patches <at> gnu.org> Subject: Re: [bug#66262] Failed to build in QA Date: Thu, 30 Nov 2023 09:07:38 +0000
On 11/29/23 21:11, reza via Guix-patches via wrote: >> 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...
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:02 GMT) Full text and rfc822 format available.Message #125 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 1/7] gnu: openfoam-org: Use gexps. Date: Fri, 1 Dec 2023 20:21:24 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:02 GMT) Full text and rfc822 format available.Message #128 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 2/7] gnu: openfoam-org: Refactor dependency. Date: Fri, 1 Dec 2023 20:21:28 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:03 GMT) Full text and rfc822 format available.Message #131 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 3/7] gnu: openfoam-org: Improve internal path handling. Date: Fri, 1 Dec 2023 20:21:31 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:03 GMT) Full text and rfc822 format available.Message #134 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 4/7] gnu: openfoam-org: Improve build clean up. Date: Fri, 1 Dec 2023 20:21:36 +0000
* 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(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:04 GMT) Full text and rfc822 format available.Message #137 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 5/7] gnu: openfoam-org: Update to 11. Date: Fri, 1 Dec 2023 20:21:39 +0000
* gnu/packages/simulation.scm (openfoam-org): Update to 11. Change-Id: I6f9752e8bb35754ac3f67acbaa1e4ae8b216e410 --- gnu/packages/simulation.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:22:04 GMT) Full text and rfc822 format available.Message #140 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 6/7] gnu: openfoam-com: Update to 2306. Date: Fri, 1 Dec 2023 20:21:41 +0000
* gnu/packages/simulation.scm (openfoam-com): Update to 2306. Change-Id: I418fa263706574b716a852c77a33c7de5ee0068d --- gnu/packages/simulation.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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
guix-patches <at> gnu.org
:bug#66262
; Package guix-patches
.
(Fri, 01 Dec 2023 20:23:02 GMT) Full text and rfc822 format available.Message #143 received at 66262 <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262 <at> debbugs.gnu.org <66262 <at> debbugs.gnu.org> Cc: reza <reza <at> housseini.me> Subject: [PATCH v7 7/7] gnu: openfoam-org: Improve wrapping of binaries. Date: Fri, 1 Dec 2023 20:21:46 +0000
* 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(-) 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
reza <reza <at> housseini.me>
:reza <reza <at> housseini.me>
:Message #148 received at 66262-done <at> debbugs.gnu.org (full text, mbox):
From: reza <reza <at> housseini.me> To: 66262-done <at> debbugs.gnu.org <66262-done <at> debbugs.gnu.org> Cc: Attila Lendvai <attila <at> lendvai.name>, Christopher Baines <mail <at> cbaines.net>, reza <reza <at> housseini.me>, reza.housseini <at> gmail.com <reza.housseini <at> gmail.com> Subject: Re: [PATCH 0/3] Update openfoam and fix bugs Date: Fri, 20 Dec 2024 09:23:03 +0000
Close this patch series in favor of a clean rework. > * 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(-) > > 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
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Fri, 17 Jan 2025 12:24:10 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.