1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages mpi)
24 #:use-module (guix packages)
25 #:use-module ((guix licenses)
27 #:use-module (guix download)
28 #:use-module (guix utils)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages gcc)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages pciutils)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages xml)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages valgrind))
48 (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
49 (version-major+minor version)
50 "/downloads/hwloc-" version ".tar.bz2"))
53 "0karxv4r1r8sa7ki5aamlxdvyvz0bvzq4gdhq0yi5nc4a0k11vzc"))))
54 (build-system gnu-build-system)
55 (outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc.
63 ,@(if (not (string-prefix? "armhf"
64 (or (%current-target-system)
66 `(("numactl" ,numactl))
69 ;; hwloc.pc lists it in 'Requires.private'.
70 `(("libpciaccess" ,libpciaccess)))
72 `(("pkg-config" ,pkg-config)))
74 `(#:configure-flags '("--localstatedir=/var")
76 (modify-phases %standard-phases
77 (add-after 'install 'refine-libnuma
78 ;; Give -L arguments for libraries to avoid propagation
79 (lambda* (#:key inputs outputs #:allow-other-keys)
80 (let ((out (assoc-ref outputs "lib"))
81 (numa (assoc-ref inputs "numactl")))
82 (substitute* (map (lambda (f) (string-append out "/" f))
83 '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
85 (string-append "-L" numa "/lib " lib))))))
86 (add-after 'install 'avoid-circular-references
87 (lambda* (#:key outputs #:allow-other-keys)
88 (let ((lib (assoc-ref outputs "lib")))
89 ;; Suppress the 'prefix=' and 'exec_prefix=' lines so that the
90 ;; "lib" output doesn't refer to "out".
91 (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
95 (home-page "https://www.open-mpi.org/projects/hwloc/")
96 (synopsis "Abstraction of hardware architectures")
98 "hwloc provides a portable abstraction (across OS,
99 versions, architectures, ...) of the hierarchical topology of modern
100 architectures, including NUMA memory nodes, sockets, shared caches, cores and
101 simultaneous multithreading. It also gathers various attributes such as cache
102 and memory information. It primarily aims at helping high-performance
103 computing applications with gathering information about the hardware so as to
104 exploit it accordingly and efficiently.
106 hwloc may display the topology in multiple convenient formats. It also offers
107 a powerful programming interface to gather information about the hardware,
108 bind processes, and much more.")
111 (define-public openmpi
118 (uri (string-append "https://www.open-mpi.org/software/ompi/v"
119 (version-major+minor version)
120 "/downloads/openmpi-" version ".tar.bz2"))
123 "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
124 (build-system gnu-build-system)
126 `(("hwloc" ,hwloc "lib")
127 ("gfortran" ,gfortran)
128 ("libfabric" ,libfabric)
129 ("rdma-core" ,rdma-core)
130 ("valgrind" ,valgrind)))
132 `(("pkg-config" ,pkg-config)
134 (outputs '("out" "debug"))
136 `(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work
137 "--enable-memchecker"
140 ;; VampirTrace is obsoleted by scorep and disabling
141 ;; it reduces the closure size considerably.
144 ,(string-append "--with-valgrind="
145 (assoc-ref %build-inputs "valgrind"))
146 ,(string-append "--with-hwloc="
147 (assoc-ref %build-inputs "hwloc")))
148 #:phases (modify-phases %standard-phases
149 (add-before 'build 'remove-absolute
151 ;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
152 ;; etc.) to reduce the closure size. See
153 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00388.html>
155 ;; <https://www.mail-archive.com/users@lists.open-mpi.org//msg31397.html>.
156 (substitute* '("orte/tools/orte-info/param.c"
157 "oshmem/tools/oshmem_info/param.c"
158 "ompi/tools/ompi_info/param.c")
160 ;; Avoid valgrind (which pulls in gdb etc.).
162 '("./ompi/mca/io/romio/src/io_romio_component.c")
163 (("MCA_io_romio_COMPLETE_CONFIGURE_FLAGS")
164 "\"[elided to reduce closure]\""))
166 (add-before 'build 'scrub-timestamps ;reproducibility
168 (substitute* '("ompi/tools/ompi_info/param.c"
169 "orte/tools/orte-info/param.c"
170 "oshmem/tools/oshmem_info/param.c")
171 ((".*(Built|Configured) on.*") ""))
173 (add-after 'install 'remove-logs ;reproducibility
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let ((out (assoc-ref outputs "out")))
176 (for-each delete-file (find-files out "config.log"))
178 (home-page "http://www.open-mpi.org")
179 (synopsis "MPI-3 implementation")
181 "The Open MPI Project is an MPI-3 implementation that is developed and
182 maintained by a consortium of academic, research, and industry partners. Open
183 MPI is therefore able to combine the expertise, technologies, and resources
184 from all across the High Performance Computing community in order to build the
185 best MPI library available. Open MPI offers advantages for system and
186 software vendors, application developers and computer science researchers.")
187 ;; See file://LICENSE
190 (define-public openmpi-thread-multiple
193 (name "openmpi-thread-multiple")
195 (substitute-keyword-arguments (package-arguments openmpi)
196 ((#:configure-flags flags)
197 `(cons "--enable-mpi-thread-multiple" ,flags))))
198 (description " This version of Open@tie{}MPI has an implementation of
199 @code{MPI_Init_thread} that provides @code{MPI_THREAD_MULTIPLE}. This won't
200 work correctly with all transports (such as @code{openib}), and the
201 performance is generally worse than the vanilla @code{openmpi} package, which
202 only provides @code{MPI_THREAD_FUNNELED}.")))