gnu: valgrind: Add separate "doc" output.
[jackhill/guix/guix.git] / gnu / packages / mpi.scm
CommitLineData
fb0e3709 1;;; GNU Guix --- Functional package management for GNU
ce7d9c98 2;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
77abe3f0 3;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
29a7c98a 4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
37d6b097 5;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
1f9bff41 6;;; Copyright © 2017 Dave Love <fx@gnu.org>
fb0e3709
EB
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)
2b0d560a
LC
25 #:use-module ((guix licenses)
26 #:hide (expat))
fb0e3709 27 #:use-module (guix download)
29a7c98a 28 #:use-module (guix utils)
fb0e3709
EB
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages gcc)
2b0d560a
LC
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)
38f0a2ba 37 #:use-module (gnu packages perl)
2b0d560a
LC
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages pkg-config)
29a7c98a 40 #:use-module (gnu packages valgrind))
fb0e3709 41
2b0d560a
LC
42(define-public hwloc
43 (package
44 (name "hwloc")
77abe3f0 45 (version "1.11.7")
2b0d560a
LC
46 (source (origin
47 (method url-fetch)
a2d0e200 48 (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
ce7d9c98
EB
49 (version-major+minor version)
50 "/downloads/hwloc-" version ".tar.bz2"))
2b0d560a
LC
51 (sha256
52 (base32
77abe3f0 53 "0acph1mf7588hfx8ds26ncr6nw5fd9x92adm11fwin7f93i10sdb"))))
2b0d560a 54 (build-system gnu-build-system)
798b7678
LC
55 (outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc.
56 "lib" ;small closure
57 "debug"))
2b0d560a 58 (inputs
5b527256 59 `(("libx11" ,libx11)
2b0d560a
LC
60 ("cairo" ,cairo)
61 ("ncurses" ,ncurses)
37d6b097
AE
62 ("expat" ,expat)
63 ,@(if (not (string-prefix? "armhf"
64 (or (%current-target-system)
65 (%current-system))))
66 `(("numactl" ,numactl))
67 '())))
c6e59259
LC
68 (propagated-inputs
69 ;; hwloc.pc lists it in 'Requires.private'.
70 `(("libpciaccess" ,libpciaccess)))
2b0d560a
LC
71 (native-inputs
72 `(("pkg-config" ,pkg-config)))
579f5c8a 73 (arguments
7eb9f31c
LC
74 `(#:configure-flags '("--localstatedir=/var")
75 #:phases
579f5c8a 76 (modify-phases %standard-phases
798b7678
LC
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))))))
a2d0e200 95 (home-page "https://www.open-mpi.org/projects/hwloc/")
2b0d560a
LC
96 (synopsis "Abstraction of hardware architectures")
97 (description
98 "hwloc provides a portable abstraction (across OS,
99versions, architectures, ...) of the hierarchical topology of modern
100architectures, including NUMA memory nodes, sockets, shared caches, cores and
101simultaneous multithreading. It also gathers various attributes such as cache
102and memory information. It primarily aims at helping high-performance
103computing applications with gathering information about the hardware so as to
104exploit it accordingly and efficiently.
105
106hwloc may display the topology in multiple convenient formats. It also offers
107a powerful programming interface to gather information about the hardware,
108bind processes, and much more.")
2b0d560a
LC
109 (license bsd-3)))
110
fb0e3709
EB
111(define-public openmpi
112 (package
113 (name "openmpi")
1f9bff41 114 (version "1.10.7")
fb0e3709
EB
115 (source
116 (origin
117 (method url-fetch)
6876590f 118 (uri (string-append "https://www.open-mpi.org/software/ompi/v"
29a7c98a 119 (version-major+minor version)
fb0e3709
EB
120 "/downloads/openmpi-" version ".tar.bz2"))
121 (sha256
122 (base32
1f9bff41 123 "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
fb0e3709 124 (build-system gnu-build-system)
5b527256 125 (inputs
798b7678 126 `(("hwloc" ,hwloc "lib")
19afbea1 127 ("gfortran" ,gfortran)
a0995702
DL
128 ("libfabric" ,libfabric)
129 ("rdma-core" ,rdma-core)
1691b4cd 130 ("valgrind" ,valgrind)))
5b527256 131 (native-inputs
38f0a2ba
EB
132 `(("pkg-config" ,pkg-config)
133 ("perl" ,perl)))
fb0e3709 134 (arguments
327404ae 135 `(#:configure-flags `("--enable-builtin-atomics"
38f0a2ba 136
fb0e3709 137 "--enable-mpi-ext=all"
5b527256 138 "--with-devel-headers"
1691b4cd 139 "--enable-memchecker"
efcacc17 140 "--with-sge"
1691b4cd
EB
141 ,(string-append "--with-valgrind="
142 (assoc-ref %build-inputs "valgrind"))
5b527256 143 ,(string-append "--with-hwloc="
9474a4b3
EB
144 (assoc-ref %build-inputs "hwloc")))
145 #:phases (modify-phases %standard-phases
146 (add-before 'build 'scrub-timestamps ;reproducibility
147 (lambda _
148 (substitute* '("ompi/tools/ompi_info/param.c"
149 "orte/tools/orte-info/param.c"
150 "oshmem/tools/oshmem_info/param.c")
151 ((".*(Built|Configured) on.*") ""))
152 #t))
153 (add-after 'install 'remove-logs ;reproducibility
154 (lambda* (#:key outputs #:allow-other-keys)
155 (let ((out (assoc-ref outputs "out")))
156 (for-each delete-file (find-files out "config.log"))
157 #t))))))
fb0e3709 158 (home-page "http://www.open-mpi.org")
bb0f6d75 159 (synopsis "MPI-3 implementation")
fb0e3709 160 (description
bb0f6d75 161 "The Open MPI Project is an MPI-3 implementation that is developed and
8ede638c
EB
162maintained by a consortium of academic, research, and industry partners. Open
163MPI is therefore able to combine the expertise, technologies, and resources
164from all across the High Performance Computing community in order to build the
165best MPI library available. Open MPI offers advantages for system and
166software vendors, application developers and computer science researchers.")
fb0e3709
EB
167 ;; See file://LICENSE
168 (license bsd-2)))
685bef2b
DL
169
170(define-public openmpi-thread-multiple
171 (package
172 (inherit openmpi)
173 (name "openmpi-thread-multiple")
174 (arguments
175 (substitute-keyword-arguments (package-arguments openmpi)
176 ((#:configure-flags flags)
177 `(cons "--enable-mpi-thread-multiple" ,flags))))
178 (description " This version of Open@tie{}MPI has an implementation of
179@code{MPI_Init_thread} that provides @code{MPI_THREAD_MULTIPLE}. This won't
180work correctly with all transports (such as @code{openib}), and the
181performance is generally worse than the vanilla @code{openmpi} package, which
182only provides @code{MPI_THREAD_FUNNELED}.")))