Subject: bug#27905: closed (Re: [bug#27905] changes for openmpi)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 12 Sep 2017 07:01:04 +0000

Your bug report

#27905: changes for openmpi

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
27905: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27905
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#27905] changes for openmpi
From: [email-masked] (Ludovic Courtès)
To: Dave Love <[email-masked]>
Cc: [email-masked]
Date: Tue, 12 Sep 2017 09:00:22 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Dave Love <[email-masked]> skribis:

> I wrote: 
>
>>> So to me that means we can apply the patch below and be done with it.
>>> Fine with you?
>>
>> No, I now think it shouldn't be changed, since the valgrind integration
>> is supposed not to impose a significant speed penalty, and I can remove
>> valgrind from the closure simply.  I'll send a new patch later.
>
> Here it is, eventually, which gets rid of a lot from the closure.
>
> From 6b47b2ce671bfbdab3c5f4f2546f02bcfee66d68 Mon Sep 17 00:00:00 2001
> From: Dave Love <[email-masked]>
> Date: Mon, 4 Sep 2017 18:04:21 +0100
> Subject: [PATCH 2/2] gnu openmpi: Remove valgrind from closure.
>
> * mpi.scm (openmpi)[arguments]: Elide romio config info to avoid valgrind
> path.

Awesome!  I tweaked the commit log and pushed.

Now we’re down to 156 MiB for the whole closure, which is much better.
There’s still room for optimization (Bash, xz, util-linux?), but we’ll
get there:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix size openmpi
store item                                                       total    self
/gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25              38.5    37.1  23.7%
/gnu/store/8j1h29zcgrg13dc2md7lalxliv1jrq2p-gfortran-5.4.0-lib      73.0    34.5  22.0%
/gnu/store/3x53yv4v144c9xp02rs64z7j597kkqax-gcc-5.4.0-lib           68.6    30.1  19.2%
/gnu/store/z77nhww8zh96w6lb5ak6h3jb4niain3b-eudev-3.2.2            103.2    14.1   9.0%
/gnu/store/dy81cx0yshq8vban59vjsdl4rvxnwxab-util-linux-2.30         87.6    12.0   7.7%
/gnu/store/jk8bcr9q79cj6j97xb6rdil1fw0g8hd6-openmpi-1.10.7         156.5    10.1   6.5%
/gnu/store/09j7scnl3hahcmql986fsjpzj6gqsmzv-ncurses-6.0             74.3     5.7   3.6%
/gnu/store/bhawz0mpfdjhwq423q6kk2jz34dpcsx5-libnl-3.3.0             72.3     3.6   2.3%
/gnu/store/n2k1kmwj0rswq6qija8v8kz9ramj2a83-rdma-core-14           108.8     2.0   1.3%
/gnu/store/808hmh1bp6khhbfrbljcsnly9497bxvy-libfabric-1.4.1        110.4     1.6   1.0%
/gnu/store/zhrajv6qf2hzn9c3g2bb07559hyrz5xp-bash-static-4.4.12       1.4     1.4   0.9%
/gnu/store/g3nari57wcfnm00kv9bnpyzdzfq4h8pk-xz-5.2.2                70.7     1.1   0.7%
/gnu/store/kpxi8h3669afr9r1bgvaf9ij3y4wdyyn-bash-minimal-4.4.12     39.5     1.0   0.6%
/gnu/store/hf6k2i6aqqs50p181bs1aa7xw49kd6xn-hwloc-1.11.8-lib        72.8     0.6   0.4%
/gnu/store/ljzqi3ajkc6l5r8hwdz7kr1zwbli3i7y-pciutils-3.5.5          71.8     0.5   0.3%
/gnu/store/sfx1wh27i6gsrk21p87rdyikc64v7d51-zlib-1.2.11             69.0     0.4   0.2%
/gnu/store/bdys6wm9hwd7akd5mc00xw0y4cz0j1fg-numactl-2.0.11          68.9     0.3   0.2%
/gnu/store/insr5wrif9pn1mlqa5rl9k3sr5qf2q1y-kmod-24                 71.3     0.3   0.2%
/gnu/store/0p4gxh2xiz31v2zx8mg43nv2djjyfwmn-libpciaccess-0.13.5     71.9     0.1   0.1%
total: 156.5 MiB
--8<---------------cut here---------------end--------------->8---

Thanks!

Ludo’.

Subject: changes for openmpi
From: Dave Love <[email-masked]>
To: [email-masked]
Date: Tue, 01 Aug 2017 13:54:24 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Here's a series with suggestions for openmpi.  I hope the log messages
are sufficiently explanatory, otherwise I can comment.  The hwloc and
valgrind changes are in line with what I'm used to using with RHEL and
Debian packaging.  (I know you won't particularly want to follow them,
but they make sense from the point of view of a user.)

I think the last one will need to be used for gfortran-specific
variants, as suggested on -devel.  That will take the closure back up
somewhat, but what I get now is:

  store item                                                       total    self
  /gnu/store/la6mj9kh7fwws233955wyp80x39ag88w-openmpi-1.10.7         134.1     9.7   7.2%
  /gnu/store/b8ni7680lh6j8z26dam7ki9z6f9y6pnz-hwloc-1.11.7-nogui      89.9     2.9   2.1%
  /gnu/store/h7mx27bl0wynlz8vjszzykqqldccfwm5-ncurses-6.0             74.3     5.7   4.2%
  /gnu/store/w1mrskd2ddgvkr727r9241g8dlkf0rlf-gfortran-5.4.0-lib      73.0    34.5  25.7%
  /gnu/store/lsidb1rk8z24c516pqw99anm57cpm8r1-numactl-2.0.11          68.9     0.3   0.2%
  /gnu/store/4vdik5cc02yh2hypwnwi6n6799j6srgn-libpciaccess-0.13.5     68.7     0.1   0.1%
  /gnu/store/dhc2iy059hi91fk55dcv79z09kp6500y-gcc-5.4.0-lib           68.6    30.1  22.4%
  /gnu/store/k7029k5va68lkapbzcycdzj7m5bjb4b8-bash-4.4.12             50.9     5.4   4.1%
  /gnu/store/hvyk1qyph1hihfmym1w271ygp84adb0v-readline-7.0            45.5     1.3   1.0%
  /gnu/store/q1x4v3x8v2g59d244hl7k0i1n4h83c9a-ncurses-6.0             44.2     5.7   4.2%
  /gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25              38.5    37.1  27.7%
  /gnu/store/02426nwiy32cscm4h83729vn5ws1gs2i-bash-static-4.4.12       1.4     1.4   1.1%
  total: 134.1 MiB

>From 9f6330bcc336eae6aedc78f56c1ebbbf30ae0b2d Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 14:54:29 +0100
Subject: [PATCH 2/8] gnu: Add openmpi-thread-multiple and modify openmpi
 accordingly.

thread-multiple support hurts performance even if it's not used.

* gnu/packages/mpi.scm (openmpi)[arguments]: Don't enable thread-multiple.
---
 gnu/packages/mpi.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 968eb8870..aa0b78237 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -133,7 +133,6 @@ bind processes, and much more.")
     (arguments
      `(#:configure-flags `("--enable-static"
 
-                           "--enable-mpi-thread-multiple"
                            "--enable-builtin-atomics"
 
                            "--enable-mpi-ext=all"
@@ -183,2 +182,18 @@ software vendors, application developers and computer science researchers.")
     ;; See file://LICENSE
     (license bsd-2)))
+
+(define-public openmpi-thread-multiple
+  (package
+    (inherit openmpi)
+    (name "openmpi-thread-multiple")
+    (arguments
+     (substitute-keyword-arguments (package-arguments openmpi)
+       ((#:configure-flags flags)
+        `(cons "--enable-mpi-thread-multiple" ,flags))))
+    (description (string-append (package-description openmpi)
+                                "\
+
+This version has an implementation of `MPI_Init_thread' that provides
+‘MPI_THREAD_MULTIPLE’.  This won't work correctly with all transports (e.g.
+openib), and the performance is generally worse than the vanilla openmpi
+package, which only provides ‘MPI_THREAD_FUNNELED’."))))

-- 
2.11.0

>From aab1baa5b90088c7d72366c669e47e273bbd9084 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 14:57:21 +0100
Subject: [PATCH 3/8] gnu: openmpi: Remove "static" output.

--enable-static removes dynamically-loaded MCA components.

* gnu/packages/mpi.scm (openmpi)[outputs]: Remove field.
[arguments]: Don't configure with --enable-static; remove
'move-static-libraries' phase.
---
 gnu/packages/mpi.scm | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index aa0b78237..e166d23d8 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -122,7 +122,6 @@ bind processes, and much more.")
        (base32
         "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
     (build-system gnu-build-system)
-    (outputs '("out" "static"))
     (inputs
      `(("hwloc" ,hwloc "lib")
        ("gfortran" ,gfortran)
@@ -131,9 +130,7 @@ bind processes, and much more.")
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
     (arguments
-     `(#:configure-flags `("--enable-static"
-
-                           "--enable-builtin-atomics"
+     `(#:configure-flags `("--enable-builtin-atomics"
 
                            "--enable-mpi-ext=all"
                            "--with-devel-headers"
@@ -155,20 +152,6 @@ bind processes, and much more.")
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let ((out (assoc-ref outputs "out")))
                         (for-each delete-file (find-files out "config.log"))
-                        #t)))
-                  (add-after 'install 'move-static-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Move 19 MiB of static libraries to 'static'.
-                      (let* ((out    (assoc-ref outputs "out"))
-                             (static (assoc-ref outputs "static"))
-                             (lib    (string-append out "/lib"))
-                             (slib   (string-append static "/lib")))
-                        (mkdir-p slib)
-                        (for-each (lambda (file)
-                                    (rename-file
-                                     file
-                                     (string-append slib "/" (basename file))))
-                                  (find-files lib "\\.a$"))
                         #t))))))
     (home-page "http://www.open-mpi.org")
     (synopsis "MPI-3 implementation")
-- 
2.11.0

>From 67a59e734dd451d1e64d450dcebeb23d60996f3e Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 14:58:39 +0100
Subject: [PATCH] gnu: hwloc: Replace "lib" output with "nogui", containing 
 all but lstopo.

A compute node typically wants the non-GUI programs available, which still
have a small closure.

* mpi.scm (hwloc)[outputs]: Replace lib with nogui.
(hwloc)[arguments]: Change configure --prefix; use "nogui" output,
not "lib"; populate "all" output.
(openmpi)[inputs]: Use hwloc-nogui.
---
 gnu/packages/mpi.scm      | 44 ++++++++++++++++++++++++++++++--------------
 gnu/packages/parallel.scm |  2 +-
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 385f9985a..66ffd7bdd 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages valgrind))
 
+;; Fixme: Replace hwloc-dump-hwdata.service with shepherd equivalent
 (define-public hwloc
   (package
     (name "hwloc")
@@ -53,7 +54,7 @@
                 "0acph1mf7588hfx8ds26ncr6nw5fd9x92adm11fwin7f93i10sdb"))))
     (build-system gnu-build-system)
     (outputs '("out"           ;'lstopo' & co., depends on Cairo, libx11, etc.
-               "lib"           ;small closure
+               "nogui"         ;small closure
                "debug"))
     (inputs
      `(("libx11" ,libx11)
@@ -71,27 +72,42 @@
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (arguments
-     `(#:configure-flags '("--localstatedir=/var")
+     `(#:configure-flags (list "--localstatedir=/var"
+                               (string-append "--prefix="
+                                              (assoc-ref %outputs "nogui")))
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'refine-libnuma
            ;; Give -L arguments for libraries to avoid propagation
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out  (assoc-ref outputs "lib"))
-                   (numa (assoc-ref inputs "numactl")))
-               (substitute* (map (lambda (f) (string-append out "/" f))
+             (let ((out  (assoc-ref outputs "out"))
+                   (numa (assoc-ref inputs "numactl"))
+                   (nogui (assoc-ref outputs "nogui")))
+               (substitute* (map (lambda (f) (string-append nogui "/" f))
                                  '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
                  (("-lnuma" lib)
                   (string-append "-L" numa "/lib " lib))))))
-         (add-after 'install 'avoid-circular-references
+         (add-after 'install 'move-lstopo
            (lambda* (#:key outputs #:allow-other-keys)
-             (let ((lib (assoc-ref outputs "lib")))
-               ;; Suppress the 'prefix=' and 'exec_prefix=' lines so that the
-               ;; "lib" output doesn't refer to "out".
-               (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
-                 (("^.*prefix=.*$")
-                  ""))
-               #t))))))
+             (let* ((out (assoc-ref outputs "out"))
+                    (nogui (assoc-ref outputs "nogui"))
+                    (binout (string-append out "/bin"))
+                    (appsout (string-append out "/share/applications"))
+                    (man1out (string-append out "/share/man/man1")))
+               (mkdir-p binout)
+               (mkdir-p appsout)
+               (mkdir-p man1out)
+               (and
+                (delete-file (string-append nogui "/share/man/man1/lstopo.1"))
+                (copy-file
+                 (string-append nogui "/share/man/man1/lstopo-no-graphics.1")
+                 (string-append man1out "/lstopo.1"))
+                (zero?
+                 (system (format #f "mv ~a/bin/lstopo ~a" nogui binout)))
+                (zero?
+                 (system
+                  (format #f "mv ~a/share/applications/lstopo.desktop ~a"
+                          nogui appsout))))))))))
     (home-page "https://www.open-mpi.org/projects/hwloc/")
     (synopsis "Abstraction of hardware architectures")
     (description
@@ -123,7 +139,7 @@ bind processes, and much more.")
         "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
     (build-system gnu-build-system)
     (inputs
-     `(("hwloc" ,hwloc "lib")
+     `(("hwloc" ,hwloc "nogui")
        ("gfortran" ,gfortran)
        ("valgrind" ,valgrind)))
     (native-inputs
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 179fa7ed3..c320dfa62 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -113,7 +113,7 @@ and they are executed on lists of files, hosts, users or other items.")
    ;; in particular mysql and gtk+.
    (inputs `(("expect" ,expect)
              ("freeipmi" ,freeipmi)
-             ("hwloc" ,hwloc "lib")
+             ("hwloc" ,hwloc "nogui")
              ("json-c" ,json-c)
              ("linux-pam" , linux-pam)
              ("munge" ,munge)
-- 
2.11.0

>From 1772aa47c3bc71521340d7f569d4d906ab7f53e9 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 15:01:59 +0100
Subject: [PATCH] gnu: valgrind: Add "doc" and "openmpi" outputs.

Also don't configure openmpi with valgrind; rely on the wrapper
library from the valgrind package, like Fedora and Debian.

* gnu/packages/valgrind.scm (valgrind)[outputs]: New field.
[arguments]: Add install-doc and install-openmpi phases.
[description]: Mention openmpi output.
* gnu/packages/mpi.scm (openmpi)[arguments]: Don't configure with
valgrind.
---
 gnu/packages/mpi.scm      |  9 ++-------
 gnu/packages/valgrind.scm | 25 +++++++++++++++++++++++--
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 64d1f497b..f3fc83b26 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -36,8 +36,7 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages valgrind))
+  #:use-module (gnu packages pkg-config))
 
 ;; Fixme: Replace hwloc-dump-hwdata.service with shepherd equivalent
 (define-public hwloc
@@ -140,8 +139,7 @@ bind processes, and much more.")
     (build-system gnu-build-system)
     (inputs
      `(("hwloc" ,hwloc "nogui")
-       ("gfortran" ,gfortran)
-       ("valgrind" ,valgrind)))
+       ("gfortran" ,gfortran)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
@@ -150,10 +148,7 @@ bind processes, and much more.")
 
                            "--enable-mpi-ext=all"
                            "--with-devel-headers"
-                           "--enable-memchecker"
                            "--with-sge"
-                           ,(string-append "--with-valgrind="
-                                           (assoc-ref %build-inputs "valgrind"))
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
diff --git a/gnu/packages/valgrind.scm b/gnu/packages/valgrind.scm
index 5f2bef16d..9bfba4761 100644
--- a/gnu/packages/valgrind.scm
+++ b/gnu/packages/valgrind.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Andreas Enge <[email-masked]>
 ;;; Copyright © 2015 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2016 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017 Dave Love <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
   #:use-module (guix licenses)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages mpi)
   #:use-module (gnu packages))
 
 (define-public valgrind
@@ -53,17 +55,36 @@
                  (("obj:/lib") "obj:*/lib")
                  (("obj:/usr/X11R6/lib") "obj:*/lib")
                  (("obj:/usr/lib") "obj:*/lib"))
-               #t))))))
+               #t)))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
+                   (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
+               (mkdir-p dest)
+               (zero? (system* "mv" orig dest)))))
+         (add-after 'install 'install-openmpi
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((dest (format #f "~a/lib/valgrind"
+                                 (assoc-ref outputs "openmpi"))))
+               (mkdir-p dest)
+               (zero?
+                (system (format #f "mv ~a/lib/valgrind/libmpiwrap* ~a"
+                                (assoc-ref outputs "out") dest)))))))))
     (inputs `(;; GDB is needed to provide a sane default for `--db-command'.
               ("gdb" ,gdb)))
     (native-inputs `(("perl" ,perl)))
+    (outputs '("doc"                    ;16 MB
+               "openmpi" "out"))
     (home-page "http://www.valgrind.org/")
     (synopsis "Debugging and profiling tool suite")
     (description
      "Valgrind is an instrumentation framework for building dynamic analysis
 tools.  There are Valgrind tools that can automatically detect many memory
 management and threading bugs, and profile your programs in detail.  You can
-also use Valgrind to build new tools.")
+also use Valgrind to build new tools.
+
+The openmpi output contains a wrapper library for openmpi, as described
+in the documenation.")
     (license gpl2+)
 
     ;; Building VEX on mips64el-linux fails with "opcode not supported on this
-- 
2.11.0

>From a8bd87987f82e3f0f7f44a8c6d487a397ce6eda6 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 15:03:46 +0100
Subject: [PATCH 6/8] gnu: openmpi: Modify configuration to reduce closure.

devel-headers are only for building MCA components, produce a large
closure and aren't normally packaged.  Only the affinity component of
mpi-ext is useful.

* mpi.scm (openmpi)[arguments]: Don't configure
--with-devel-headers and --enable-mpi-ext=all.
---
 gnu/packages/mpi.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index f3fc83b26..bbc81e45a 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -144,10 +144,9 @@ bind processes, and much more.")
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
     (arguments
-     `(#:configure-flags `("--enable-builtin-atomics"
+     `(#:configure-flags `("--enable-builtin-atomics" ;why?
 
-                           "--enable-mpi-ext=all"
-                           "--with-devel-headers"
+                           "--enable-mpi-ext=affinity" ;cr doesn't work
                            "--with-sge"
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
-- 
2.11.0

>From 8a0668951bc352aadc3cce5c12c9e4d9e2e7b6c6 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 15:04:44 +0100
Subject: [PATCH 7/8] gnu: openmpi: Configure without vampirtrace.

VT is obsoleted by scorep (not currently packaged) and disabling it reduces
the closure considerably.

* mpi.scm (openmpi)[arguments]: Configure without vampirtrace.
---
 gnu/packages/mpi.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index bbc81e45a..abda1cc43 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -148,6 +148,7 @@ bind processes, and much more.")
 
                            "--enable-mpi-ext=affinity" ;cr doesn't work
                            "--with-sge"
+                           "--disable-vt"
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
-- 
2.11.0

>From ec65c9d847c30d51bf83b49b397bc1ca20b7ca11 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Mon, 31 Jul 2017 17:15:19 +0100
Subject: [PATCH 8/8] gnu: openmpi: Remove references to compiler pathnames in
 "_info" programs.

This reduces the closure greatly, but note that the Fortran .mod files are
gfortran version-specific, so there should probably be development packages
for each incompatible version.  (The runtime is supposed to be more-or-less
version-independent unless the libgfortran soname changes.)  There may still
be a case for a separate runtime output.

* gnu/packages/mpi.scm (openmpi)[arguments]: Add "remove-absolute" phase.
---
 gnu/packages/mpi.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index abda1cc43..ffae04415 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -152,6 +152,14 @@ bind processes, and much more.")
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
+                  (add-before 'build 'remove-absolute
+                    ;; Remove compilers (OPAL_FC_ABSOLUTE etc.) from closure.
+                    (lambda _
+                      (substitute* '("orte/tools/orte-info/param.c"
+                                     "oshmem/tools/oshmem_info/param.c"
+                                     "ompi/tools/ompi_info/param.c")
+                        (("_ABSOLUTE") ""))
+                      #t))
                   (add-before 'build 'scrub-timestamps ;reproducibility
                     (lambda _
                       (substitute* '("ompi/tools/ompi_info/param.c"
-- 
2.11.0