diff mbox series

[bug#67822,v4] gnu: maths: petsc: Reduce closure size.

Message ID a2c44dd68bd3b7ce4ebad81cf22c667caebc586e.1704824104.git.lars.bilke@ufz.de
State New
Headers show
Series [bug#67822,v4] gnu: maths: petsc: Reduce closure size. | expand

Commit Message

Lars Bilke Jan. 9, 2024, 6:15 p.m. UTC
Reduces closure size by around 350 MB by removing refernces to build
dependencies (e.g. gcc).

New ion v4:

Used proposed :graph: syntax.
Also removed gfortran reference.

Change-Id: I2e6900747b2118546f0a39ceb109b3f2f90e6949
---
 gnu/packages/maths.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)


base-commit: a1a645337a76cf5fb55d20ee694fcb6a52fcf11b

Comments

Lars Bilke Feb. 27, 2024, 7:49 a.m. UTC | #1
Dear Ludo,

may I kindly ask for another review here? I have implemented the suggestions in v4 and would like to benefit from the size reduction as I am preparing some container-based computations on several HPC clusters which do not have Guix installed ( yet ;-) ).

Thanks a lot!
Lars

On 9 Jan 2024, at 19:15, Lars Bilke wrote:

> Reduces closure size by around 350 MB by removing refernces to build
> dependencies (e.g. gcc).
>
> New ion v4:
>
> Used proposed :graph: syntax.
> Also removed gfortran reference.
>
> Change-Id: I2e6900747b2118546f0a39ceb109b3f2f90e6949
> ---
>  gnu/packages/maths.scm | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index adc7beb655..7dc93ce8ee 100644
> --- a/gnu/packages/maths.scm
> +++ b/gnu/packages/maths.scm
> @@ -3484,8 +3484,21 @@ (define-public petsc
>                            '("configure.log" "make.log" "gmake.log"
>                              "test.log" "error.log" "RDict.db"
>                              "PETScBuildInternal.cmake"
> +                            "configure-hash"
>                              ;; Once installed, should uninstall with Guix
>                              "uninstall.py")))))
> +          (add-after 'clean-install 'clear-reference-to-compiler
> +            (lambda* (#:key inputs outputs #:allow-other-keys)
> +              ;; Do not retain a reference to GCC and other build only inputs.
> +              (let ((out (assoc-ref outputs "out")))
> +              (substitute* (string-append out "/lib/petsc/conf/petscvariables")
> +                (("([[:graph:]]+)/bin/gcc") "gcc")
> +                (("([[:graph:]]+)/bin/g\\+\\+") "g++")
> +                (("([[:graph:]]+)/bin/make") "make")
> +                (("([[:graph:]]+)/bin/diff") "diff")
> +                (("([[:graph:]]+)/bin/sed") "sed")
> +                (("([[:graph:]]+)/bin/gfortran") "gfortran")
> +                ))))
>            (add-after 'install 'move-examples
>              (lambda* (#:key outputs #:allow-other-keys)
>                (let* ((out (assoc-ref outputs "out"))
>
> base-commit: a1a645337a76cf5fb55d20ee694fcb6a52fcf11b
> -- 
> 2.43.0
Ludovic Courtès Feb. 27, 2024, 9:50 a.m. UTC | #2
Hi,

Lars Bilke <lars.bilke@ufz.de> skribis:

> Reduces closure size by around 350 MB by removing refernces to build
> dependencies (e.g. gcc).
>
> New ion v4:
>
> Used proposed :graph: syntax.
> Also removed gfortran reference.
>
> Change-Id: I2e6900747b2118546f0a39ceb109b3f2f90e6949

[...]

> +                (("([[:graph:]]+)/bin/sed") "sed")
> +                (("([[:graph:]]+)/bin/gfortran") "gfortran")
> +                ))))

I move those lonely parens to the previous line, tweaked the commit log,
and applied it.  Thank you!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index adc7beb655..7dc93ce8ee 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3484,8 +3484,21 @@  (define-public petsc
                           '("configure.log" "make.log" "gmake.log"
                             "test.log" "error.log" "RDict.db"
                             "PETScBuildInternal.cmake"
+                            "configure-hash"
                             ;; Once installed, should uninstall with Guix
                             "uninstall.py")))))
+          (add-after 'clean-install 'clear-reference-to-compiler
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Do not retain a reference to GCC and other build only inputs.
+              (let ((out (assoc-ref outputs "out")))
+              (substitute* (string-append out "/lib/petsc/conf/petscvariables")
+                (("([[:graph:]]+)/bin/gcc") "gcc")
+                (("([[:graph:]]+)/bin/g\\+\\+") "g++")
+                (("([[:graph:]]+)/bin/make") "make")
+                (("([[:graph:]]+)/bin/diff") "diff")
+                (("([[:graph:]]+)/bin/sed") "sed")
+                (("([[:graph:]]+)/bin/gfortran") "gfortran")
+                ))))
           (add-after 'install 'move-examples
             (lambda* (#:key outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))