unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#32732] [PATCH] gnu: hdf5-parallel-openmpi: Really enable parallel build.
@ 2018-09-13 20:03 Paul Garlick
  2018-09-16 21:00 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Garlick @ 2018-09-13 20:03 UTC (permalink / raw)
  To: 32732; +Cc: Paul Garlick

This fix ensures that the H5_HAVE_PARALLEL identifier is correctly set
in the file H5pubconf.h.

* gnu/packages/maths.scm (hdf5-parallel-openmpi)[arguments]: Add
the "--enable-parallel" flag to the list of configure flags.  Remove
the incompatible "--enable-cxx" flag.  Add 'mpi-setup' phase.  Replace
the 'split' phase, omitting the references to the h5fc script which is
not present.
---
 gnu/packages/maths.scm | 38 +++++++++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index af41093..85d3884 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1034,10 +1034,13 @@ Swath).")
      `(("mpi" ,openmpi)
        ,@(package-inputs hdf5)))
     (arguments
-     (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
-                                     ,@(package-arguments hdf5))
+     (substitute-keyword-arguments (package-arguments hdf5)
+       ((#:configure-flags flags)
+        ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
+           (add-after 'build 'mpi-setup
+	     ,%openmpi-setup)
            (add-before 'check 'patch-tests
              (lambda _
                ;; OpenMPI's mpirun will exit with non-zero status if it
@@ -1051,7 +1054,36 @@ Swath).")
                   (string-append front back "\n")))
                (substitute* "tools/h5diff/testph5diff.sh"
                  (("/bin/sh") (which "sh")))
-               #t))))))
+               #t))
+           (replace 'split
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                ;; Move all fortran-related files
+                (let* ((out (assoc-ref outputs "out"))
+                       (bin (string-append out "/bin"))
+                       (lib (string-append out "/lib"))
+                       (inc (string-append out "/include"))
+                       (ex (string-append out "/share/hdf5_examples/fortran"))
+                       (fort (assoc-ref outputs "fortran"))
+                       (flib (string-append fort "/lib"))
+                       (finc (string-append fort "/include"))
+                       (fex (string-append fort "/share/hdf5_examples/fortran")))
+                  (mkdir-p flib)
+                  (mkdir-p finc)
+                  (mkdir-p fex)
+                  (for-each (lambda (file)
+                              (rename-file file
+                                           (string-append flib "/" (basename file))))
+                            (find-files lib ".*fortran.*"))
+                  (for-each (lambda (file)
+                              (rename-file file
+                                           (string-append finc "/" (basename file))))
+                            (find-files inc ".*mod"))
+                  (for-each (lambda (file)
+                              (rename-file file
+                                           (string-append fex "/" (basename file))))
+                            (find-files ex ".*"))
+                  (delete-file-recursively ex))
+                #t))))))
     (synopsis "Management suite for data with parallel IO support")))
 
 (define-public h5check
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#32732] [PATCH] gnu: hdf5-parallel-openmpi: Really enable parallel build.
  2018-09-13 20:03 [bug#32732] [PATCH] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
@ 2018-09-16 21:00 ` Ludovic Courtès
  2018-09-20 17:59   ` [bug#32732] [PATCH 1/2] gnu: hdf5: Allow for absence of utility script Paul Garlick
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-09-16 21:00 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 32732

Hi Paul,

Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

> This fix ensures that the H5_HAVE_PARALLEL identifier is correctly set
> in the file H5pubconf.h.
>
> * gnu/packages/maths.scm (hdf5-parallel-openmpi)[arguments]: Add
> the "--enable-parallel" flag to the list of configure flags.  Remove
> the incompatible "--enable-cxx" flag.  Add 'mpi-setup' phase.  Replace
> the 'split' phase, omitting the references to the h5fc script which is
> not present.

Good catch!

> +           (replace 'split
> +              (lambda* (#:key inputs outputs #:allow-other-keys)
> +                ;; Move all fortran-related files

Instead of duplicating the whole phase minus the h5fc bit, what about
changing the phase in ‘hdf5’ so that it does:

                ;; Note: When built with --enable-parallel, the 'h5fc' file
                ;; doesn't exist, hence this condition.
                (when (file-exists? (string-append bin "/h5fc"))
                  (rename-file (string-append bin "/h5fc")
                               (string-append fbin "/h5fc")))

That way, no need to touch the ‘split’ phase in
‘hdf5-parallel-openmpi’.

If that’s fine with you, could you send an updated patch?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#32732] [PATCH 1/2] gnu: hdf5: Allow for absence of utility script.
  2018-09-16 21:00 ` Ludovic Courtès
@ 2018-09-20 17:59   ` Paul Garlick
  2018-09-20 17:59     ` [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Garlick @ 2018-09-20 17:59 UTC (permalink / raw)
  To: 32732, ludo; +Cc: Paul Garlick

* gnu/packages/maths.scm (hdf5)[arguments]: Add condition to 'split'
phase to check for existence of h5fc script.
---
 gnu/packages/maths.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 736bac1..30f1610 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -814,8 +814,11 @@ incompatible with HDF5.")
                 (mkdir-p flib)
                 (mkdir-p finc)
                 (mkdir-p fex)
-                (rename-file (string-append bin "/h5fc")
-                             (string-append fbin "/h5fc"))
+                ;; Note: When built with --enable-parallel, the 'h5fc' file
+                ;; doesn't exist, hence this condition.
+                (when (file-exists? (string-append bin "/h5fc"))
+                  (rename-file (string-append bin "/h5fc")
+                               (string-append fbin "/h5fc")))
                 (for-each (lambda (file)
                             (rename-file file
                                          (string-append flib "/" (basename file))))
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build.
  2018-09-20 17:59   ` [bug#32732] [PATCH 1/2] gnu: hdf5: Allow for absence of utility script Paul Garlick
@ 2018-09-20 17:59     ` Paul Garlick
  2018-09-21  1:07       ` Eric Bavier
  2018-09-24 12:20       ` bug#32732: " Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Garlick @ 2018-09-20 17:59 UTC (permalink / raw)
  To: 32732, ludo; +Cc: Paul Garlick

This fix ensures that the H5_HAVE_PARALLEL identifier is correctly set
in the file H5pubconf.h.

* gnu/packages/maths.scm (hdf5-parallel-openmpi)[arguments]: Add
the "--enable-parallel" flag to the list of configure flags.  Remove
the incompatible "--enable-cxx" flag.  Add 'mpi-setup' phase.
---
 gnu/packages/maths.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 30f1610..636b485 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1037,10 +1037,13 @@ Swath).")
      `(("mpi" ,openmpi)
        ,@(package-inputs hdf5)))
     (arguments
-     (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
-                                     ,@(package-arguments hdf5))
+     (substitute-keyword-arguments (package-arguments hdf5)
+       ((#:configure-flags flags)
+        ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
+           (add-after 'build 'mpi-setup
+             ,%openmpi-setup)
            (add-before 'check 'patch-tests
              (lambda _
                ;; OpenMPI's mpirun will exit with non-zero status if it
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build.
  2018-09-20 17:59     ` [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
@ 2018-09-21  1:07       ` Eric Bavier
  2018-09-24 12:20       ` bug#32732: " Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Bavier @ 2018-09-21  1:07 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 32732

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

On Thu, 20 Sep 2018 18:59:57 +0100
Paul Garlick <pgarlick@tourbillion-technology.com> wrote:

> This fix ensures that the H5_HAVE_PARALLEL identifier is correctly set
> in the file H5pubconf.h.
> 
> * gnu/packages/maths.scm (hdf5-parallel-openmpi)[arguments]: Add
> the "--enable-parallel" flag to the list of configure flags.  Remove
> the incompatible "--enable-cxx" flag.  Add 'mpi-setup' phase.
> ---

LGTM!  Thanks!

BTW, I'm working on creating a package for hdf5 version 1.10.3.  There
are a couple packages, and maybe users, that still need 1.8, so I'm
adding it separately.

`~Eric

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#32732: [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build.
  2018-09-20 17:59     ` [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
  2018-09-21  1:07       ` Eric Bavier
@ 2018-09-24 12:20       ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2018-09-24 12:20 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 32732-done

Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

> This fix ensures that the H5_HAVE_PARALLEL identifier is correctly set
> in the file H5pubconf.h.
>
> * gnu/packages/maths.scm (hdf5-parallel-openmpi)[arguments]: Add
> the "--enable-parallel" flag to the list of configure flags.  Remove
> the incompatible "--enable-cxx" flag.  Add 'mpi-setup' phase.

Pushed a few days ago as 45201bf245856954cb8368c328e54773a0a81156.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-24 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-13 20:03 [bug#32732] [PATCH] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
2018-09-16 21:00 ` Ludovic Courtès
2018-09-20 17:59   ` [bug#32732] [PATCH 1/2] gnu: hdf5: Allow for absence of utility script Paul Garlick
2018-09-20 17:59     ` [bug#32732] [PATCH 2/2] gnu: hdf5-parallel-openmpi: Really enable parallel build Paul Garlick
2018-09-21  1:07       ` Eric Bavier
2018-09-24 12:20       ` bug#32732: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).