Archived
1
0
Fork 0

gnu: openmpi: Use gexps.

* gnu/packages/mpi.scm (openmpi)[arguments]: Use gexps.
This commit is contained in:
Ludovic Courtès 2023-02-23 15:49:09 +01:00 committed by Ludovic Courtès
parent b8d3b9d14b
commit f45fc72c28
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -25,6 +25,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages mpi) (define-module (gnu packages mpi)
#:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix download) #:use-module (guix download)
@ -191,13 +192,13 @@ bind processes, and much more.")
(version "4.1.4") (version "4.1.4")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://www.open-mpi.org/software/ompi/v" (uri (string-append "https://www.open-mpi.org/software/ompi/v"
(version-major+minor version) (version-major+minor version)
"/downloads/openmpi-" version ".tar.bz2")) "/downloads/openmpi-" version ".tar.bz2"))
(sha256 (sha256
(base32 "03ckngrff1cl0l81vfvrfhp99rbgk7s0633kr1l468yibwbjx4cj")) (base32 "03ckngrff1cl0l81vfvrfhp99rbgk7s0633kr1l468yibwbjx4cj"))
(patches (search-patches "openmpi-mtl-priorities.patch")))) (patches (search-patches "openmpi-mtl-priorities.patch"))))
(properties (properties
;; Tell the 'generic-html' updater to monitor this URL for updates. ;; Tell the 'generic-html' updater to monitor this URL for updates.
@ -228,68 +229,69 @@ bind processes, and much more.")
(list pkg-config perl)) (list pkg-config perl))
(outputs '("out" "debug")) (outputs '("out" "debug"))
(arguments (arguments
`(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work (list
"--with-sge" #:configure-flags #~`("--enable-mpi-ext=affinity" ;cr doesn't work
"--with-sge"
,@(if ,(package? (this-package-input "valgrind")) #$@(if (package? (this-package-input "valgrind"))
`("--enable-memchecker" #~("--enable-memchecker"
"--with-valgrind") "--with-valgrind")
`("--without-valgrind")) #~("--without-valgrind"))
"--with-hwloc=external" "--with-hwloc=external"
"--with-libevent" "--with-libevent"
;; Help 'orterun' and 'mpirun' find their tools ;; Help 'orterun' and 'mpirun' find their tools
;; under $prefix by default. ;; under $prefix by default.
"--enable-mpirun-prefix-by-default" "--enable-mpirun-prefix-by-default"
;; InfiniBand support ;; InfiniBand support
"--enable-openib-control-hdr-padding" "--enable-openib-control-hdr-padding"
"--enable-openib-dynamic-sl" "--enable-openib-dynamic-sl"
"--enable-openib-udcm" "--enable-openib-udcm"
"--enable-openib-rdmacm" "--enable-openib-rdmacm"
"--enable-openib-rdmacm-ibaddr" "--enable-openib-rdmacm-ibaddr"
;; Enable support for SLURM's Process Manager ;; Enable support for SLURM's Process Manager
;; Interface (PMI). ;; Interface (PMI).
,(string-append "--with-pmi=" ,(string-append "--with-pmi="
(assoc-ref %build-inputs "slurm"))) #$(this-package-input "slurm")))
#:phases (modify-phases %standard-phases #:phases #~(modify-phases %standard-phases
;; opensm is needed for InfiniBand support. ;; opensm is needed for InfiniBand support.
(add-after 'unpack 'find-opensm-headers (add-after 'unpack 'find-opensm-headers
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(setenv "C_INCLUDE_PATH" (setenv "C_INCLUDE_PATH"
(search-input-directory inputs (search-input-directory inputs
"/include/infiniband")) "/include/infiniband"))
(setenv "CPLUS_INCLUDE_PATH" (setenv "CPLUS_INCLUDE_PATH"
(search-input-directory inputs (search-input-directory inputs
"/include/infiniband")))) "/include/infiniband"))))
(add-before 'build 'remove-absolute (add-before 'build 'remove-absolute
(lambda _ (lambda _
;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE ;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
;; etc.) to reduce the closure size. See ;; etc.) to reduce the closure size. See
;; <https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00388.html> ;; <https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00388.html>
;; and ;; and
;; <https://www.mail-archive.com/users@lists.open-mpi.org//msg31397.html>. ;; <https://www.mail-archive.com/users@lists.open-mpi.org//msg31397.html>.
(substitute* '("orte/tools/orte-info/param.c" (substitute* '("orte/tools/orte-info/param.c"
"oshmem/tools/oshmem_info/param.c" "oshmem/tools/oshmem_info/param.c"
"ompi/tools/ompi_info/param.c") "ompi/tools/ompi_info/param.c")
(("_ABSOLUTE") "")) (("_ABSOLUTE") ""))
;; Avoid valgrind (which pulls in gdb etc.). ;; Avoid valgrind (which pulls in gdb etc.).
(substitute* (substitute*
'("./ompi/mca/io/romio321/src/io_romio321_component.c") '("./ompi/mca/io/romio321/src/io_romio321_component.c")
(("MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS") (("MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS")
"\"[elided to reduce closure]\"")))) "\"[elided to reduce closure]\""))))
(add-before 'build 'scrub-timestamps ;reproducibility (add-before 'build 'scrub-timestamps ;reproducibility
(lambda _ (lambda _
(substitute* '("ompi/tools/ompi_info/param.c" (substitute* '("ompi/tools/ompi_info/param.c"
"orte/tools/orte-info/param.c" "orte/tools/orte-info/param.c"
"oshmem/tools/oshmem_info/param.c") "oshmem/tools/oshmem_info/param.c")
((".*(Built|Configured) on.*") "")))) ((".*(Built|Configured) on.*") ""))))
(add-after 'install 'remove-logs ;reproducibility (add-after 'install 'remove-logs ;reproducibility
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(for-each delete-file (find-files out "config.log")))))))) (for-each delete-file (find-files out "config.log"))))))))
(home-page "https://www.open-mpi.org") (home-page "https://www.open-mpi.org")
(synopsis "MPI-3 implementation") (synopsis "MPI-3 implementation")
(description (description