gnu: dealii: Update to 8.5.0.
[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)
f1be6f5b 125 (outputs '("out" "static"))
5b527256 126 (inputs
798b7678 127 `(("hwloc" ,hwloc "lib")
19afbea1 128 ("gfortran" ,gfortran)
1691b4cd 129 ("valgrind" ,valgrind)))
5b527256 130 (native-inputs
38f0a2ba
EB
131 `(("pkg-config" ,pkg-config)
132 ("perl" ,perl)))
fb0e3709 133 (arguments
5b527256 134 `(#:configure-flags `("--enable-static"
38f0a2ba 135
38f0a2ba 136 "--enable-mpi-thread-multiple"
ac356fd6 137 "--enable-builtin-atomics"
38f0a2ba 138
fb0e3709 139 "--enable-mpi-ext=all"
5b527256 140 "--with-devel-headers"
1691b4cd 141 "--enable-memchecker"
efcacc17 142 "--with-sge"
1691b4cd
EB
143 ,(string-append "--with-valgrind="
144 (assoc-ref %build-inputs "valgrind"))
5b527256 145 ,(string-append "--with-hwloc="
9474a4b3
EB
146 (assoc-ref %build-inputs "hwloc")))
147 #:phases (modify-phases %standard-phases
148 (add-before 'build 'scrub-timestamps ;reproducibility
149 (lambda _
150 (substitute* '("ompi/tools/ompi_info/param.c"
151 "orte/tools/orte-info/param.c"
152 "oshmem/tools/oshmem_info/param.c")
153 ((".*(Built|Configured) on.*") ""))
154 #t))
155 (add-after 'install 'remove-logs ;reproducibility
156 (lambda* (#:key outputs #:allow-other-keys)
157 (let ((out (assoc-ref outputs "out")))
158 (for-each delete-file (find-files out "config.log"))
f1be6f5b
LC
159 #t)))
160 (add-after 'install 'move-static-libraries
161 (lambda* (#:key outputs #:allow-other-keys)
162 ;; Move 19 MiB of static libraries to 'static'.
163 (let* ((out (assoc-ref outputs "out"))
164 (static (assoc-ref outputs "static"))
165 (lib (string-append out "/lib"))
166 (slib (string-append static "/lib")))
167 (mkdir-p slib)
168 (for-each (lambda (file)
169 (rename-file
170 file
171 (string-append slib "/" (basename file))))
172 (find-files lib "\\.a$"))
9474a4b3 173 #t))))))
fb0e3709 174 (home-page "http://www.open-mpi.org")
bb0f6d75 175 (synopsis "MPI-3 implementation")
fb0e3709 176 (description
bb0f6d75 177 "The Open MPI Project is an MPI-3 implementation that is developed and
8ede638c
EB
178maintained by a consortium of academic, research, and industry partners. Open
179MPI is therefore able to combine the expertise, technologies, and resources
180from all across the High Performance Computing community in order to build the
181best MPI library available. Open MPI offers advantages for system and
182software vendors, application developers and computer science researchers.")
fb0e3709
EB
183 ;; See file://LICENSE
184 (license bsd-2)))