gnu: java: Use HTTPS for osgi.org home pages.
[jackhill/guix/guix.git] / gnu / packages / profiling.scm
CommitLineData
6a3af24f
DL
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 Dave Love <fx@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages profiling)
20 #:use-module (guix packages)
21 #:use-module ((guix licenses) #:prefix license:) ; avoid zlib, expat clashes
22 #:use-module (guix download)
23 #:use-module (guix utils)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages base) ;for "which"
fb993719 28 #:use-module (gnu packages bison)
a66408f8
DL
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages documentation)
6a3af24f 31 #:use-module (gnu packages fabric-management)
fb993719 32 #:use-module (gnu packages flex)
3c8d1f94 33 #:use-module (gnu packages gawk)
6a3af24f 34 #:use-module (gnu packages gcc)
a66408f8 35 #:use-module (gnu packages glib)
6a3af24f
DL
36 #:use-module (gnu packages libunwind)
37 #:use-module (gnu packages linux)
fb993719 38 #:use-module (gnu packages mpi)
a6121c0a 39 #:use-module (gnu packages ncurses)
a66408f8 40 #:use-module (gnu packages perl)
fb993719 41 #:use-module (gnu packages perl)
a66408f8
DL
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages qt))
6a3af24f
DL
44
45;; Fixme: Separate out lib and fix resulting cycle errors; separate libpfm
46;; output(?); build libmsr and add that component.
47(define-public papi
48 (package
49 (name "papi")
50 (version "5.5.1")
51 (source
52 (origin
53 (method url-fetch)
54 (uri (string-append "http://icl.utk.edu/projects/papi/downloads/papi-"
55 version ".tar.gz"))
56 (sha256 (base32 "1m62s8fkjjgq04ayf18jcxc33rqfd7nrkdw1gr54q5pn4cijrp29"))))
57 (build-system gnu-build-system)
58 (inputs
59 `(("ncurses" ,ncurses)
60 ("lm-sensors" ,lm-sensors "lib")
61 ("rdma-core" ,rdma-core)
62 ("infiniband-diags" ,infiniband-diags "lib")
63 ("net-tools" ,net-tools)))
64 (native-inputs
65 `(("autoconf" ,autoconf)
66 ("gfortran" ,gfortran)))
67 (arguments
68 '(#:tests? #f ; no check target
69 #:configure-flags
70 ;; These are roughly per Fedora, but elide mx (assumed to be dead, even
71 ;; Open-MX) and add and powercap -- I don't know the pros/cons of
72 ;; infiniband and infiniband_mad, but you can't use them together, and
73 ;; the umad version needs at least one patch.
74 ;; Implicit enabled components: perf_event perf_event_uncore
75 `("--with-perf-events" "--with-shared-lib=yes" "--with-shlib"
76 "--with-static-lib=no"
77 "--with-components=appio coretemp example lustre micpower net rapl \
78stealtime lmsensors infiniband powercap"
79 ;; So utils get rpath set correctly:
80 ,(string-append "LDFLAGS=-Xlinker -rpath -Xlinker "
81 (assoc-ref %outputs "out") "/lib"))
82 #:phases
83 (modify-phases %standard-phases
84 (add-before 'configure 'autoconf
85 (lambda _
86 (chdir "src")
87 (zero? (system* "autoconf"))))
88 ;; Amalgamating with the following clause gives double substitution.
89 (add-before 'patch-source-shebangs 'patch-components
90 (lambda _
91 (with-directory-excursion "src/components"
92 (substitute* '("lmsensors/configure" "infiniband_umad/configure")
93 (("/bin/sh") (which "sh"))))
94 #t))
95 (add-after 'configure 'components
96 (lambda* (#:key inputs #:allow-other-keys)
97 (with-directory-excursion "components"
98 (and
99 (with-directory-excursion "infiniband_umad"
100 (zero? (system* "./configure")))
101 (with-directory-excursion "lmsensors"
102 (let ((base (assoc-ref inputs "lm-sensors")))
103 (zero?
104 (system*
105 "./configure"
106 (string-append "--with-sensors_incdir=" base
107 "/include/sensors")
108 (string-append "--with-sensors_libdir=" base "/lib")))))))))
109 (add-after 'install 'extra-doc
110 (lambda* (#:key outputs #:allow-other-keys)
111 (let ((doc (string-append (assoc-ref outputs "out")
112 "/share/doc")))
113 (mkdir-p doc)
114 (chdir "..") ; we went into src above
115 (for-each (lambda (file)
116 (install-file file doc))
117 '("README" "RELEASENOTES.txt" "LICENSE.txt"))
118 #t))))))
119 (home-page "http://icl.cs.utk.edu/papi/")
120 (synopsis "Performance Application Programming Interface")
121 (description
122 "PAPI provides the tool designer and application engineer with a consistent
123interface and methodology for use of the performance counter hardware found in
124most major microprocessors. PAPI enables software engineers to see, in near
125real time, the relation between software performance and processor events.
126
127In addition, PAPI provides access to a collection of components that expose
128performance measurement opportunites across the hardware and software stack.")
129 ;; See Debian papi copyright file.
130 (license (list license:bsd-3
131 license:lgpl2.1+ ;src/components/infiniband/pscanf.h
132 ;; not used in output
133 license:gpl2+ ;src/components/appio/tests/iozone/gengnuplot.sh
134 ;src/libpfm-3.y/*/multiplex*
135 ;; "BSD-like": src/libpfm-3.y/*, src/libpfm4/*
136 ;; lgpl2.1+: src/perfctr-2.*/*
137 ))))
a6121c0a
DL
138
139;; NB. there's a potential name clash with libotf.
140(define-public otf2
141 (package
142 (name "otf2")
143 (version "2.1")
144 (source
145 (origin
146 (method url-fetch)
147 (uri (string-append "http://www.vi-hps.org/upload/packages/otf2/otf2-"
148 version ".tar.gz"))
149 (sha256 (base32 "1lyaqhdfaqm1kd23yk71g71vkscw83s7m57j017y768h8sh8xlwa"))))
150 (native-inputs `(("python" ,python)))
151 (outputs '("doc" ; 18MB
152 "lib"
153 "out"))
154 (build-system gnu-build-system)
155 (arguments
156 `(#:configure-flags '("--enable-shared" "--disable-static")
157 #:phases
158 (modify-phases %standard-phases
159 (add-after 'install 'licence
160 (lambda* (#:key outputs #:allow-other-keys)
161 (for-each (lambda (output)
162 (let ((doc (string-append (assoc-ref outputs output)
163 "/share/doc/otf2")))
164 (install-file "COPYING" doc)))
165 '("lib" "doc"))
166 #t)))))
167 (home-page "http://www.vi-hps.org/projects/score-p/")
168 (synopsis "Open Trace Format 2 library")
169 (description "The Open Trace Format 2 (OTF2) is a scalable, memory
170efficient event trace data format plus support library.")
171 (license license:bsd-3)))
3c8d1f94
DL
172
173(define-public opari2
174 (package
175 (name "opari2")
176 (version "2.0.2")
177 (source
178 (origin
179 (method url-fetch)
180 (uri (let* ((parts (string-split version #\.) )
181 (major (car parts))
182 (minor (cadr parts)))
183 (string-append "http://www.vi-hps.org/upload/packages/opari2/opari2-"
184 version ".tar.gz")))
185 (sha256 (base32 "1ph8l5c646bm9l5vcn8rrbjvkyi7y8yvn2ny95r6kmlzs766g3q8"))))
186 (build-system gnu-build-system)
187 (inputs `(("gfortran" ,gfortran)))
188 (native-inputs `(("gawk" ,gawk) ;for tests
189 ("which" ,which)))
190 (arguments
191 `(#:phases
192 (modify-phases %standard-phases
193 (add-after 'install 'licence
194 (lambda* (#:key outputs #:allow-other-keys)
195 (let ((doc (string-append (assoc-ref outputs "out")
196 "/share/doc/opari2")))
197 (install-file "COPYING" doc)
198 #t))))))
199 (home-page "http://www.vi-hps.org/projects/score-p")
200 (synopsis "OpenMP runtime performance measurement instrumenter")
201 (description "OPARI2 is a source-to-source instrumentation tool for OpenMP
202and hybrid codes. It surrounds OpenMP directives and runtime library calls
203with calls to the POMP2 measurement interface.")
204 (license license:bsd-3)))
a66408f8
DL
205
206(define-public cube
207 (package
208 (name "cube")
209 (version "4.3.5")
210 (source
211 (origin
212 (method url-fetch)
213 (uri (string-append
214 "http://apps.fz-juelich.de/scalasca/releases/cube/4.3/dist/cube-"
215 version ".tar.gz"))
216 (sha256 (base32 "04irflia4rfw02093w9nx7rr98r640y4q8hisjywvd4b7r3nzhhx"))
217 (patches (search-patches "cube-nocheck.patch"))))
218 (inputs `(("dbus" ,dbus)
219 ("zlib" ,zlib)))
220 (native-inputs `(("perl" ,perl)
221 ("qtbase" ,qtbase) ; native because of qmake
222 ("which" ,which)))
223
224 ;; FIXME: The doc is 14MB, but adding a doc output results in a cycle.
225 (outputs '("out" ;"doc"
226 "lib"))
227
228 (build-system gnu-build-system)
229 (arguments
230 `(#:configure-flags
231 `("--enable-shared" "--disable-static" "--disable-silent-rules"
232 ,(string-append "LDFLAGS=-L" (assoc-ref %outputs "lib") "/lib"))
233 #:parallel-tests? #f
234 #:phases
235 (modify-phases %standard-phases
236 (add-after 'configure 'rpath
237 ;; Account for moving GUI stuff
238 (lambda* (#:key outputs #:allow-other-keys)
239 (let ((wl (string-append "-Wl,-rpath=" (assoc-ref outputs "out")
240 "/lib")))
241 (substitute* "build-backend/Makefile"
242 (("^cube_LDFLAGS =") (string-append "cube_LDFLAGS = " wl))
243 (("^libheatmap_plugin_la_LDFLAGS =")
244 (string-append "libheatmap_plugin_la_LDFLAGS = " wl))
245 (("^libbarplot_plugin_la_LDFLAGS =")
246 (string-append "libbarplot_plugin_la_LDFLAGS = " wl)))
247 #t)))
248 (add-before 'install 'includes-cube
249 ;; It tries to install here before include exists.
250 (lambda* (#:key outputs #:allow-other-keys)
251 (let ((inc (string-append (assoc-ref outputs "lib") "/include")))
252 (mkdir-p (string-append inc "/cube"))
253 (mkdir-p (string-append inc "/cubew"))
254 #t)))
255 (add-after 'install 'licence
256 (lambda* (#:key outputs #:allow-other-keys)
257 (let ((doc (string-append (assoc-ref outputs "lib")
258 "/share/doc/cube")))
259 (install-file "COPYING" doc)
260 #t)))
261 ;; XXX: Commented due to cycle (see comment above.)
262 ;; (add-after 'install 'doc
263 ;; (lambda _
264 ;; (let ((share (string-append (assoc-ref %outputs "doc")
265 ;; "/share")))
266 ;; (mkdir-p share)
267 ;; (rename-file (string-append %output "/share/doc")
268 ;; (string-append share "/doc")))))
269 (add-after 'install 'gui-stuff
270 ;; Get the Qt horror dependencies out of the lib closure
271 (lambda _
272 (let ((outlib (string-append (assoc-ref %outputs "out") "/lib"))
273 (lib (string-append (assoc-ref %outputs "lib") "/lib")))
274 (mkdir-p outlib)
275 (rename-file (string-append lib "/cube-plugins")
276 (string-append outlib "/cube-plugins"))
277 (for-each (lambda (file)
278 (rename-file
279 file (string-append outlib "/" (basename file))))
280 (append (find-files lib "libgraphwidgetcommon-plugin\\..*")
281 (find-files lib "libcube4gui\\.so.*")))
282 #t)))
283 (add-after 'install 'move-include
284 ;; Most of the headers end up under %output for some reason,
285 ;; despite --includedir in configure.
286 (lambda* (#:key outputs #:allow-other-keys)
287 (let ((outinc (string-append (assoc-ref outputs "out")
288 "/include"))
289 (libinc (string-append (assoc-ref outputs "lib")
290 "/include")))
291 (for-each (lambda (file)
292 (let ((from (string-append outinc "/" file)))
293 (copy-recursively from libinc)
294 (delete-file-recursively from)))
295 '("cube" "cubew"))
296 #t)))
297
298 ;; XXX: This doesn't work because cube-config, which is needed for
299 ;; building stuff, sources cube-config-frontend. We don't want that
300 ;; in the lib output because it pulls in >1GB via QT.
301 ;;
302 ;; (add-after 'install 'cube-config
303 ;; (lambda _
304 ;; (let* ((lib (assoc-ref %outputs "lib"))
305 ;; (libbin (string-append lib "/bin")))
306 ;; (mkdir-p libbin)
307 ;; (system (string-append "mv " (assoc-ref %outputs "out")
308 ;; "/bin/cube-config* " libbin))
309 ;; (substitute* (list (string-append libbin "/cube-config"))
310 ;; (("^prefix=.*") (string-append "prefix=" lib))
311 ;; (("^exec_prefix=\"\\$\\{prefix\\}\"")
312 ;; (string-append "exec_prefix=" lib))))))
313 (add-after 'install 'cube-config
314 (lambda* (#:key outputs #:allow-other-keys)
315 (let* ((lib (assoc-ref outputs "lib"))
316 (libbin (string-append lib "/bin")))
317 (mkdir-p libbin)
318 (install-file (string-append %output "/bin/cube-config") libbin)
319 (install-file (string-append %output "/bin/cube-config-backend")
320 libbin)
321 (substitute* (list (string-append libbin "/cube-config"))
322 (("^source .*frontend.*$") "")
323 (((assoc-ref outputs "out")) lib))
324 #t))))))
325 (home-page "http://www.scalasca.org/software/cube-4.x/download.html")
326 (synopsis "Performance report explorer for parallel programs")
327 (description
328 "CUBE (CUBE Uniform Behavioral Encoding) is a tool to display a variety
329of performance metrics for parallel programs including MPI and OpenMP
330applications. CUBE allows interactive exploration of a multidimensional
331performance space in a scalable fashion. Scalability is achieved in two ways:
332hierarchical decomposition of individual dimensions and aggregation across
333different dimensions. All performance metrics are uniformly accommodated in
334the same display and thus provide the ability to easily compare the effects of
335different kinds of performance behavior.")
336 (license license:bsd-3)))
fb993719
DL
337
338(define (make-scorep mpi)
339 (package
340 (name (string-append "scorep-" (package-name mpi)))
341 (version "3.1")
342 (source (origin
343 (method url-fetch)
344 (uri (string-append
345 "http://www.vi-hps.org/upload/packages/scorep/scorep-"
346 version ".tar.gz"))
347 (sha256
348 (base32
349 "0h45357djna4dn9jyxx0n36fhhms3jrf22988m9agz1aw2jfivs9"))
350 (modules '((guix build utils)))
351 (snippet
352 ;; Remove bundled software.
353 '(for-each delete-file-recursively
354 '("vendor/opari2" "vendor/cube")))))
355 (build-system gnu-build-system)
356 (inputs
357 `(("mpi" ,mpi)
358 ("papi" ,papi)
359 ("opari2" ,opari2)
360 ("libunwind" ,libunwind)
361 ("otf2" ,otf2)
362 ("cubelib" ,cube "lib") ;for lib, include
363 ("openmpi" ,openmpi)
364 ("zlib" ,zlib)))
365 (native-inputs
366 `(("gfortran" ,gfortran)
367 ("flex" ,flex)
368 ("cube" ,cube) ;for cube-config
369 ("bison" ,bison)
370 ("python" ,python)
371 ("doxygen" ,doxygen)
372 ("which" ,which)))
373 (arguments
374 `(#:configure-flags
375 (list "--enable-shared" "--disable-static"
376 (string-append "--with-opari2="
377 (assoc-ref %build-inputs "opari2"))
378 (string-append "--with-cube="
379 (assoc-ref %build-inputs "cube")))
380 #:parallel-tests? #f
381 #:make-flags '("V=1")
382 #:phases
383 (modify-phases %standard-phases
384 (add-after 'install 'licence
385 (lambda* (#:key outputs #:allow-other-keys)
386 (let ((doc (string-append (assoc-ref outputs "out")
387 "/share/doc/scorep")))
388 (install-file "COPYING" doc)
389 #t))))))
390 (home-page "http://www.vi-hps.org/projects/score-p/")
391 (synopsis "Performance measurement infrastructure for parallel code")
392 (description
393 "The Score-P (Scalable Performance Measurement Infrastructure for
394Parallel Codes) measurement infrastructure is a scalable and easy-to-use tool
395suite for profiling, event trace recording, and online analysis of
396high-performance computing (HPC) applications.")
397 (license license:cpl1.0)))
398
399(define-public scorep-openmpi (make-scorep openmpi))