gnu: Add 'version-prefix' and 'version-major+minor'; use them.
[jackhill/guix/guix.git] / gnu / packages / mpi.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages mpi)
22 #:use-module (guix packages)
23 #:use-module ((guix licenses)
24 #:hide (expat))
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages gcc)
30 #:use-module (gnu packages linux)
31 #:use-module (gnu packages pciutils)
32 #:use-module (gnu packages xorg)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages xml)
35 #:use-module (gnu packages ncurses)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages valgrind))
38
39 (define-public hwloc
40 (package
41 (name "hwloc")
42 (version "1.9")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "http://www.open-mpi.org/software/hwloc/v"
46 version "/downloads/hwloc-"
47 version ".tar.bz2"))
48 (sha256
49 (base32
50 "0zjgiili2a8v63s8ly3a8qp8ibxv1jw3zbgm7diic3w1qgqiza14"))))
51 (build-system gnu-build-system)
52 (arguments
53 ;; Enable libpci support, which effectively makes hwloc GPLv2+.
54 '(#:configure-flags '("--enable-libpci")))
55 (inputs
56 `(("libx11" ,libx11)
57 ("cairo" ,cairo)
58 ("ncurses" ,ncurses)
59 ("expat" ,expat)))
60 (native-inputs
61 `(("pkg-config" ,pkg-config)))
62 (propagated-inputs
63 ;; 'hwloc.pc' refers to libpci and libnuma, hence the propagation.
64 `(("numactl" ,numactl)
65 ("pciutils" ,pciutils)))
66 (home-page "http://www.open-mpi.org/projects/hwloc/")
67 (synopsis "Abstraction of hardware architectures")
68 (description
69 "hwloc provides a portable abstraction (across OS,
70 versions, architectures, ...) of the hierarchical topology of modern
71 architectures, including NUMA memory nodes, sockets, shared caches, cores and
72 simultaneous multithreading. It also gathers various attributes such as cache
73 and memory information. It primarily aims at helping high-performance
74 computing applications with gathering information about the hardware so as to
75 exploit it accordingly and efficiently.
76
77 hwloc may display the topology in multiple convenient formats. It also offers
78 a powerful programming interface to gather information about the hardware,
79 bind processes, and much more.")
80
81 ;; But see above about linking against libpci.
82 (license bsd-3)))
83
84 (define-public openmpi
85 (package
86 (name "openmpi")
87 (version "1.8.1")
88 (source
89 (origin
90 (method url-fetch)
91 (uri (string-append "http://www.open-mpi.org/software/ompi/v"
92 (version-major+minor version)
93 "/downloads/openmpi-" version ".tar.bz2"))
94 (sha256
95 (base32
96 "13z1q69f3qwmmhpglarfjminfy2yw4rfqr9jydjk5507q3mjf50p"))))
97 (build-system gnu-build-system)
98 (inputs
99 `(("hwloc" ,hwloc)
100 ("gfortran" ,gfortran-4.8)
101 ("valgrind" ,valgrind)))
102 (native-inputs
103 `(("pkg-config" ,pkg-config)))
104 (arguments
105 `(#:configure-flags `("--enable-static"
106 "--enable-oshmem"
107 ;; Thread support causes some applications to hang
108 ;; "--enable-event-thread-support"
109 ;; "--enable-opal-multi-threads"
110 ;; "--enable-orte-progress-threads"
111 ;; "--enable-mpi-thread-multiple"
112 "--enable-mpi-ext=all"
113 "--with-devel-headers"
114 "--enable-debug"
115 "--enable-memchecker"
116 ,(string-append "--with-valgrind="
117 (assoc-ref %build-inputs "valgrind"))
118 ,(string-append "--with-hwloc="
119 (assoc-ref %build-inputs "hwloc")))))
120 (home-page "http://www.open-mpi.org")
121 (synopsis "MPI-2 implementation")
122 (description
123 "The Open MPI Project is an MPI-2 implementation that is developed and
124 maintained by a consortium of academic, research, and industry partners. Open
125 MPI is therefore able to combine the expertise, technologies, and resources
126 from all across the High Performance Computing community in order to build the
127 best MPI library available. Open MPI offers advantages for system and
128 software vendors, application developers and computer science researchers.")
129 ;; See file://LICENSE
130 (license bsd-2)))