GNU bug report logs - #74675
[PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc

Previous Next

Package: guix-patches;

Reported by: Luca Cirrottola <luca.cirrottola <at> inria.fr>

Date: Tue, 3 Dec 2024 20:17:01 UTC

Severity: normal

Tags: patch

Done: Andreas Enge <andreas <at> enge.fr>

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 74675 in the body.
You can then email your comments to 74675 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


Report forwarded to guix-patches <at> gnu.org:
bug#74675; Package guix-patches. (Tue, 03 Dec 2024 20:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Luca Cirrottola <luca.cirrottola <at> inria.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 03 Dec 2024 20:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Luca Cirrottola <luca.cirrottola <at> inria.fr>
To: guix-patches <at> gnu.org
Cc: Luca Cirrottola <luca.cirrottola <at> inria.fr>
Subject: [PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc
Date: Tue,  3 Dec 2024 21:16:18 +0100
Hello,
The hypre package builds its "doc" output by default, bringing texlive
into the dependency graph of packages using hypre, and possibly breaking
their compilation due to errors in building the hypre documentation (see
bug 74672). I would like to also have the possibility to build hypre
without doxygen and latex documentation.

This patch is an attempt to solve my problem by splitting the package
into two variants, one without documentation ("hypre-sans-doc") and one
with ("hypre"). Also, a "hypre-openmpi-sans-doc" is added besides
"hypre-openmpi".

Thus, two new packages are introduced ("hypre-sans-doc" and
"hypre-openmpi-sans-doc") without modifying the expected behaviour of
the original "hypre" and "hypre-openmpi" packages.

I would have loved to simply generate the "hypre-openmpi-sans-doc"
package by modifying the "inherit" field of "hypre-openmpi", but I have
not been able to do it with package transformation options. I would be
grateful for any suggestion to reduce code redundancy in my patch, as
well as for any better solution that could achieve the same objective
(the possibility to build hypre without doc).


Luca Cirrottola (1):
  Add a hypre-sans-doc package, make hypre inherit from it, and add a
    variant hypre-openmpi-sans-doc.

 gnu/packages/maths.scm | 131 ++++++++++++++++++++++++++---------------
 1 file changed, 85 insertions(+), 46 deletions(-)

-- 
2.34.1





Information forwarded to guix-patches <at> gnu.org:
bug#74675; Package guix-patches. (Tue, 03 Dec 2024 20:21:01 GMT) Full text and rfc822 format available.

Message #8 received at 74675 <at> debbugs.gnu.org (full text, mbox):

From: Luca Cirrottola <luca.cirrottola <at> inria.fr>
To: 74675 <at> debbugs.gnu.org
Cc: Luca Cirrottola <luca.cirrottola <at> inria.fr>
Subject: [PATCH 1/1] Add a hypre-sans-doc package, make hypre inherit from it,
 and add a variant hypre-openmpi-sans-doc.
Date: Tue,  3 Dec 2024 21:20:13 +0100
---
 gnu/packages/maths.scm | 131 ++++++++++++++++++++++++++---------------
 1 file changed, 85 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 893877a5e5..bbc307c286 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -7291,9 +7291,9 @@ (define-public xaos
     (home-page "https://xaos-project.github.io/")
     (license license:gpl2+)))
 
-(define-public hypre
+(define-public hypre-sans-doc
   (package
-    (name "hypre")
+    (name "hypre-sans-doc")
     (version "2.20.0")
     (source
      (origin
@@ -7305,6 +7305,63 @@ (define-public hypre
        (sha256
         (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
     (build-system gnu-build-system)
+    (inputs
+     (list openblas))
+    (arguments
+     (list #:modules `((srfi srfi-1)
+                       ,@%default-gnu-modules)
+           #:configure-flags #~'("--enable-shared"
+                                 "--disable-fortran"
+                                 "--without-MPI"
+                                 "--with-openmp"
+                                 "--with-fei"
+                                 "--with-lapack"
+                                 "--with-blas")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'configure 'chdir-src
+                 (lambda _
+                   (chdir "src")))
+               (replace 'configure
+                 (lambda* (#:key build target configure-flags
+                           #:allow-other-keys #:rest args)
+                   (let* ((configure (assoc-ref %standard-phases 'configure)))
+                     (apply configure
+                            (append args
+                                    (list #:configure-flags
+                                          (cons (string-append "--host="
+                                                               (or target build))
+                                                configure-flags)))))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (setenv "LD_LIBRARY_PATH"
+                             (string-append (getcwd) "/hypre/lib"))
+                     (setenv "PATH"
+                             (string-append "." ":" (getenv "PATH")))
+                     (invoke "make" "check" "CHECKRUN=")
+                     (for-each (lambda (filename)
+                                 (let ((size (stat:size (stat filename))))
+                                   (when (positive? size)
+                                     (error (format #f
+                                                    "~a size ~d; error indication~%"
+                                                    filename size)))))
+                               (find-files "test" ".*\\.err$"))))))))
+    (home-page "https://computing.llnl.gov/projects\
+/hypre-scalable-linear-solvers-multigrid-methods")
+    (synopsis "Library of solvers and preconditioners for linear equations")
+    (description
+     "HYPRE is a software library of high performance preconditioners and
+solvers for the solution of large, sparse linear systems of equations.  It
+features multigrid solvers for both structured and unstructured grid
+problems.")
+    (properties '((tunable? . #t)))
+    (license license:lgpl2.1)))
+
+(define-public hypre
+  (package
+    (inherit hypre-sans-doc)
+    (name "hypre")
     (outputs '("out"                    ;5.3 MiB of headers and libraries
                "doc"))                  ;12 MiB of documentation
     (native-inputs
@@ -7352,57 +7409,18 @@ (define-public hypre
                   texlive-wrapfig
                   texlive-xcolor
                   texlive-xypic))))
-    (inputs
-     (list openblas))
     (arguments
-     (list #:modules `((srfi srfi-1)
-                       ,@%default-gnu-modules)
-           #:configure-flags #~'("--enable-shared"
-                                 "--disable-fortran"
-                                 "--without-MPI"
-                                 "--with-openmp"
-                                 "--with-fei"
-                                 "--with-lapack"
-                                 "--with-blas")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-before 'configure 'chdir-src
-                 (lambda _
-                   (chdir "src")))
-               (replace 'configure
-                 (lambda* (#:key build target configure-flags
-                           #:allow-other-keys #:rest args)
-                   (let* ((configure (assoc-ref %standard-phases 'configure)))
-                     (apply configure
-                            (append args
-                                    (list #:configure-flags
-                                          (cons (string-append "--host="
-                                                               (or target build))
-                                                configure-flags)))))))
+     (substitute-keyword-arguments (package-arguments hypre-sans-doc)
+       ((#:phases phases)
+        #~(modify-phases #$phases
                (add-after 'build 'build-docs
                  (lambda _
                    (invoke "make" "-C" "docs")))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (setenv "LD_LIBRARY_PATH"
-                             (string-append (getcwd) "/hypre/lib"))
-                     (setenv "PATH"
-                             (string-append "." ":" (getenv "PATH")))
-                     (invoke "make" "check" "CHECKRUN=")
-                     (for-each (lambda (filename)
-                                 (let ((size (stat:size (stat filename))))
-                                   (when (positive? size)
-                                     (error (format #f
-                                                    "~a size ~d; error indication~%"
-                                                    filename size)))))
-                               (find-files "test" ".*\\.err$")))))
                (add-after 'install 'install-docs
                  (lambda* (#:key outputs #:allow-other-keys)
                    ;; Custom install because docs/Makefile doesn't honor ${docdir}.
                    (let* ((doc (assoc-ref outputs "doc"))
-                          (docdir (string-append doc "/share/doc/hypre-"
-                                                 #$version)))
+                          (docdir (string-append doc "/share/doc/hypre")))
                      (with-directory-excursion "docs"
                        (for-each (lambda (base)
                                    (install-file (string-append base
@@ -7411,7 +7429,7 @@ (define-public hypre
                                                                     "-html")
                                                      (string-append docdir
                                                                     "/" base)))
-                                 '("usr-manual" "ref-manual")))))))))
+                                 '("usr-manual" "ref-manual"))))))))))
     (home-page "https://computing.llnl.gov/projects\
 /hypre-scalable-linear-solvers-multigrid-methods")
     (synopsis "Library of solvers and preconditioners for linear equations")
@@ -7444,6 +7462,27 @@ (define-public hypre-openmpi
 parallel computers.  It features parallel multigrid solvers for both
 structured and unstructured grid problems.")))
 
+(define-public hypre-openmpi-sans-doc
+  (package
+    (inherit hypre-sans-doc)
+    (name "hypre-openmpi-sans-doc")
+    (inputs (modify-inputs (package-inputs hypre-sans-doc)
+              (prepend openmpi)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments hypre-sans-doc)
+       ((#:configure-flags flags)
+        #~`("--with-MPI" ,@(delete "--without-MPI" #$flags)))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-before 'check 'mpi-setup
+              #$%openmpi-setup)))))
+    (synopsis "Parallel solvers and preconditioners for linear equations")
+    (description
+     "HYPRE is a software library of high performance preconditioners and
+solvers for the solution of large, sparse linear systems of equations on
+parallel computers.  It features parallel multigrid solvers for both
+structured and unstructured grid problems.")))
+
 (define-public matio
   (package
     (name "matio")
-- 
2.34.1





Information forwarded to guix-patches <at> gnu.org:
bug#74675; Package guix-patches. (Wed, 26 Mar 2025 09:19:02 GMT) Full text and rfc822 format available.

Message #11 received at 74675 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Luca Cirrottola <luca.cirrottola <at> inria.fr>
Cc: 74675 <at> debbugs.gnu.org, Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Eric Bavier <bavier <at> posteo.net>
Subject: Re: [PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc
Date: Wed, 26 Mar 2025 10:18:22 +0100
Hello Luca,

Am Tue, Dec 03, 2024 at 09:16:18PM +0100 schrieb Luca Cirrottola:
> The hypre package builds its "doc" output by default, bringing texlive
> into the dependency graph of packages using hypre, and possibly breaking
> their compilation due to errors in building the hypre documentation (see
> bug 74672). I would like to also have the possibility to build hypre
> without doxygen and latex documentation.
> 
> This patch is an attempt to solve my problem by splitting the package
> into two variants, one without documentation ("hypre-sans-doc") and one
> with ("hypre"). Also, a "hypre-openmpi-sans-doc" is added besides
> "hypre-openmpi".

I am sceptical of adding too many variants of packages, especially with
and without documentation; it is not something we tend to do in Guix.
If the size of the package is a problem, we could move the documentation
to a separate output. Actually, I realise this is already the case!

And I do not see the problem with texlive dependencies, as these are
only native-inputs. So people using binary substitutes will not download
or even see these dependencies.

If documentation building is broken, we should fix it; as said in the
other issue you cite, I cannot reproduce the problem, however.

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#74675; Package guix-patches. (Wed, 26 Mar 2025 18:19:02 GMT) Full text and rfc822 format available.

Message #14 received at 74675 <at> debbugs.gnu.org (full text, mbox):

From: Luca Cirrottola <luca.cirrottola <at> inria.fr>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 74675 <at> debbugs.gnu.org, Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Eric Bavier <bavier <at> posteo.net>
Subject: Re: [PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc
Date: Wed, 26 Mar 2025 19:18:46 +0100 (CET)
Hello Andreas,

The problem arose because some of my software ecosystem lives in a time-machine where some variants and package-input-rewriting goes on, so substitutes are not always available and a lot of recompilation goes on sometimes. I understand this is not the mainstream usage and that we should try to rely more on substitutes, instead of skipping some compilation. My bad.

Feel free to close this issue, since we are also discussing how to fix the package (the right way) in the other issue (74672).

Thanks,
Luca




Reply sent to Andreas Enge <andreas <at> enge.fr>:
You have taken responsibility. (Wed, 26 Mar 2025 20:54:02 GMT) Full text and rfc822 format available.

Notification sent to Luca Cirrottola <luca.cirrottola <at> inria.fr>:
bug acknowledged by developer. (Wed, 26 Mar 2025 20:54:02 GMT) Full text and rfc822 format available.

Message #19 received at 74675-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Luca Cirrottola <luca.cirrottola <at> inria.fr>
Cc: 74675-done <at> debbugs.gnu.org, Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Eric Bavier <bavier <at> posteo.net>
Subject: Re: [PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc
Date: Wed, 26 Mar 2025 21:52:53 +0100
Hi again,

Am Wed, Mar 26, 2025 at 07:18:46PM +0100 schrieb Luca Cirrottola:
> The problem arose because some of my software ecosystem lives in a time-machine where some variants and package-input-rewriting goes on, so substitutes are not always available and a lot of recompilation goes on sometimes. I understand this is not the mainstream usage and that we should try to rely more on substitutes, instead of skipping some compilation. My bad.
> Feel free to close this issue, since we are also discussing how to fix the package (the right way) in the other issue (74672).

okay, so I am closing this. As said in the other issue, I have not
really understood the problem, so if you could give more detailed
explanations there, we will get closer to a solution.

Andreas





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Apr 2025 11:27:03 GMT) Full text and rfc822 format available.

This bug report was last modified 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.