all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luca Cirrottola <luca.cirrottola@inria.fr>
To: 74675@debbugs.gnu.org
Cc: Luca Cirrottola <luca.cirrottola@inria.fr>
Subject: [bug#74675] [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	[thread overview]
Message-ID: <20241203202013.5739-1-luca.cirrottola@inria.fr> (raw)
In-Reply-To: <20241203201618.5533-1-luca.cirrottola@inria.fr>

---
 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





      reply	other threads:[~2024-12-03 20:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 20:16 [bug#74675] [PATCH 0/1] Possibly build hypre without doxygen and LaTeX doc Luca Cirrottola
2024-12-03 20:20 ` Luca Cirrottola [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241203202013.5739-1-luca.cirrottola@inria.fr \
    --to=luca.cirrottola@inria.fr \
    --cc=74675@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.