gnu: moka-icon-theme: Add faba-icon-theme as propagated input.
[jackhill/guix/guix.git] / gnu / packages / mpi.scm
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>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
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.
14 ;;;
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.
19 ;;;
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/>.
22
23 (define-module (gnu packages mpi)
24 #:use-module (guix packages)
25 #:use-module ((guix licenses)
26 #:hide (expat))
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))
41
42 (define-public hwloc
43 (package
44 (name "hwloc")
45 (version "1.11.8")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
49 (version-major+minor version)
50 "/downloads/hwloc-" version ".tar.bz2"))
51 (sha256
52 (base32
53 "0karxv4r1r8sa7ki5aamlxdvyvz0bvzq4gdhq0yi5nc4a0k11vzc"))))
54 (build-system gnu-build-system)
55 (outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc.
56 "lib" ;small closure
57 "debug"))
58 (inputs
59 `(("libx11" ,libx11)
60 ("cairo" ,cairo)
61 ("ncurses" ,ncurses)
62 ("expat" ,expat)
63 ,@(if (not (string-prefix? "armhf"
64 (or (%current-target-system)
65 (%current-system))))
66 `(("numactl" ,numactl))
67 '())))
68 (propagated-inputs
69 ;; hwloc.pc lists it in 'Requires.private'.
70 `(("libpciaccess" ,libpciaccess)))
71 (native-inputs
72 `(("pkg-config" ,pkg-config)))
73 (arguments
74 `(#:configure-flags '("--localstatedir=/var")
75 #:phases
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"))
84 (("-lnuma" lib)
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")
92 (("^.*prefix=.*$")
93 ""))
94 #t))))))
95 (home-page "https://www.open-mpi.org/projects/hwloc/")
96 (synopsis "Abstraction of hardware architectures")
97 (description
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.
105
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.")
109 (license bsd-3)))
110
111 (define-public openmpi
112 (package
113 (name "openmpi")
114 (version "1.10.7")
115 (source
116 (origin
117 (method url-fetch)
118 (uri (string-append "https://www.open-mpi.org/software/ompi/v"
119 (version-major+minor version)
120 "/downloads/openmpi-" version ".tar.bz2"))
121 (sha256
122 (base32
123 "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
124 (build-system gnu-build-system)
125 (inputs
126 `(("hwloc" ,hwloc "lib")
127 ("gfortran" ,gfortran)
128 ("libfabric" ,libfabric)
129 ("rdma-core" ,rdma-core)
130 ("valgrind" ,valgrind)))
131 (native-inputs
132 `(("pkg-config" ,pkg-config)
133 ("perl" ,perl)))
134 (outputs '("out" "debug"))
135 (arguments
136 `(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work
137 "--enable-memchecker"
138 "--with-sge"
139
140 ;; VampirTrace is obsoleted by scorep and disabling
141 ;; it reduces the closure size considerably.
142 "--disable-vt"
143
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
150 (lambda _
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>
154 ;; and
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")
159 (("_ABSOLUTE") ""))
160 ;; Avoid valgrind (which pulls in gdb etc.).
161 (substitute*
162 '("./ompi/mca/io/romio/src/io_romio_component.c")
163 (("MCA_io_romio_COMPLETE_CONFIGURE_FLAGS")
164 "\"[elided to reduce closure]\""))
165 #t))
166 (add-before 'build 'scrub-timestamps ;reproducibility
167 (lambda _
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.*") ""))
172 #t))
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"))
177 #t))))))
178 (home-page "http://www.open-mpi.org")
179 (synopsis "MPI-3 implementation")
180 (description
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
188 (license bsd-2)))
189
190 (define-public openmpi-thread-multiple
191 (package
192 (inherit openmpi)
193 (name "openmpi-thread-multiple")
194 (arguments
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}.")))