gnu: Use PACKAGE/INHERIT in more places.
[jackhill/guix/guix.git] / gnu / packages / mpi.scm
index b39c507..9a4dc6d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2018, 2019 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
@@ -69,6 +69,7 @@
     (build-system gnu-build-system)
     (outputs '("out"           ;'lstopo' & co., depends on Cairo, libx11, etc.
                "lib"           ;small closure
+               "doc"           ;400+ section 3 man pages
                "debug"))
     (inputs
      `(("libx11" ,libx11)
                (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
                  (("^.*prefix=.*$")
                   ""))
+               #t)))
+         (add-after 'install 'move-man3-pages
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Move section 3 man pages to the "doc" output.
+             (let ((out (assoc-ref outputs "out"))
+                   (doc (assoc-ref outputs "doc")))
+               (copy-recursively (string-append out "/share/man/man3")
+                                 (string-append doc "/share/man/man3"))
+               (delete-file-recursively (string-append out "/share/man/man3"))
                #t))))))
     (home-page "https://www.open-mpi.org/projects/hwloc/")
     (synopsis "Abstraction of hardware architectures")
@@ -132,18 +142,18 @@ bind processes, and much more.")
     (license license:bsd-3)))
 
 (define-public hwloc-2
-  ;; Note: 2.0 isn't the default yet, see above.
+  ;; Note: 2.x isn't the default yet, see above.
   (package
     (inherit hwloc-1)
-    (version "2.2.0")
+    (version "2.4.1")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
+              (uri (string-append "https://download.open-mpi.org/release/hwloc/v"
                                   (version-major+minor version)
-                                  "/downloads/hwloc-" version ".tar.bz2"))
+                                  "/hwloc-" version ".tar.bz2"))
               (sha256
                (base32
-                "0li27a3lnmb77qxpijj0kpblz32wmqd3b386sypq8ar7vy9vhw5f"))))
+                "0qyywmyns2jf3is3axrwmffvdd7ji7liy5axp650q4i6kzk2291r"))))
 
     ;; libnuma is no longer needed.
     (inputs (alist-delete "numactl" (package-inputs hwloc-1)))
@@ -177,7 +187,7 @@ bind processes, and much more.")
 (define-public openmpi
   (package
     (name "openmpi")
-    (version "4.0.3")
+    (version "4.0.5")
     (source
      (origin
       (method url-fetch)
@@ -185,7 +195,7 @@ bind processes, and much more.")
                           (version-major+minor version)
                           "/downloads/openmpi-" version ".tar.bz2"))
       (sha256
-       (base32 "00zxcw99gr5n693cmcmn4f6a47vx1ywna895p0x7p163v37gw0hl"))
+       (base32 "02f0r9d3xgs08svkmj8v7lzviyxqnkk4yd3z0wql550xnriki3y5"))
       (patches (search-patches "openmpi-mtl-priorities.patch"))))
     (build-system gnu-build-system)
     (inputs
@@ -221,6 +231,10 @@ bind processes, and much more.")
                            "--with-hwloc=external"
                            "--with-libevent"
 
+                           ;; Help 'orterun' and 'mpirun' find their tools
+                           ;; under $prefix by default.
+                           "--enable-mpirun-prefix-by-default"
+
                            ;; InfiniBand support
                            "--enable-openib-control-hdr-padding"
                            "--enable-openib-dynamic-sl"
@@ -286,7 +300,7 @@ software vendors, application developers and computer science researchers.")
 
 ;; TODO: javadoc files contain timestamps.
 (define-public java-openmpi
-  (package (inherit openmpi)
+  (package/inherit openmpi
     (name "java-openmpi")
     (inputs
      `(("openmpi" ,openmpi)
@@ -330,8 +344,7 @@ software vendors, application developers and computer science researchers.")
     (synopsis "Java bindings for MPI")))
 
 (define-public openmpi-thread-multiple
-  (package
-    (inherit openmpi)
+  (package/inherit openmpi
     (name "openmpi-thread-multiple")
     (arguments
      (substitute-keyword-arguments (package-arguments openmpi)
@@ -432,7 +445,12 @@ arrays) that expose a buffer interface.")
      `(#:configure-flags
        (list "--disable-silent-rules"             ;let's see what's happening
              "--enable-debuginfo"
-             ;; "--with-device=ch4:ucx" ; --with-device=ch4:ofi segfaults in tests
+
+             ;; Default to "ch4", as will be the case in 3.4.  It also works
+             ;; around issues when running test suites of packages that use
+             ;; MPICH: <https://issues.guix.gnu.org/39588#15>.
+             "--with-device=ch4:ucx" ; --with-device=ch4:ofi segfaults in tests
+
              (string-append "--with-hwloc-prefix="
                             (assoc-ref %build-inputs "hwloc"))