me
/
guix
Archived
1
0
Fork 0

gnu: papi: Update to 6.0.0.

* gnu/packages/profiling.scm (papi): Update to 6.0.0.
[source]: Add 'modules' and 'snippet'.
[inputs]: Add LIBPFM4.
[native-inputs]: Remove AUTOCONF.
[arguments]: Use gexps.  Pass "--with-shlib-tools" and
"--with-pfm-prefix=".  Remove 'autoconf', 'patch-components', and
'components' phases.  Add 'change-directory' phase.  Adjust file name in
'extra-doc' phase'.
Ludovic Courtès 2022-01-18 17:50:46 +01:00 committed by Ludovic Courtès
parent 895c1c20bf
commit 775203e520
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 61 additions and 58 deletions

View File

@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Dave Love <fx@gnu.org> ;;; Copyright © 2017 Dave Love <fx@gnu.org>
;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -19,6 +20,7 @@
(define-module (gnu packages profiling) (define-module (gnu packages profiling)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix gexp)
#:use-module ((guix licenses) #:prefix license:) ; avoid zlib, expat clashes #:use-module ((guix licenses) #:prefix license:) ; avoid zlib, expat clashes
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix utils) #:use-module (guix utils)
@ -48,71 +50,75 @@
(define-public papi (define-public papi
(package (package
(name "papi") (name "papi")
(version "5.5.1") (version "6.0.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "http://icl.utk.edu/projects/papi/downloads/papi-" (uri (string-append "http://icl.utk.edu/projects/papi/downloads/papi-"
version ".tar.gz")) version ".tar.gz"))
(sha256 (base32 "1m62s8fkjjgq04ayf18jcxc33rqfd7nrkdw1gr54q5pn4cijrp29")))) (sha256 (base32
"0pq5nhy105fpnk78k6l9ygsfr5akn6l0ck1hbf2c419lmsfp0hil"))
(modules '((guix build utils)))
(snippet
'(begin
;; Remove bundled software.
(for-each delete-file-recursively
'("src/libpfm-3.y" "src/libpfm4"
"src/perfctr-2.6.x"
"src/perfctr-2.7.x"))
;; Adjust include directives.
(substitute* "src/components/lmsensors/linux-lmsensors.c"
(("<sensors.h>")
"<sensors/sensors.h>"))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
(list ncurses (list ncurses
`(,lm-sensors "lib") rdma-core rdma-core
`(,infiniband-diags "lib") net-tools)) libpfm4
`(,lm-sensors "lib")
`(,infiniband-diags "lib")
net-tools))
(native-inputs (native-inputs
(list autoconf gfortran)) (list gfortran))
(arguments (arguments
`(#:tests? #f ; no check target (list #:tests? #f ;no check target
#:configure-flags #:configure-flags
;; These are roughly per Fedora, but elide mx (assumed to be dead, even ;; These are roughly per Fedora, but elide mx (assumed to be dead, even
;; Open-MX) and add and powercap -- I don't know the pros/cons of ;; Open-MX) and add and powercap -- I don't know the pros/cons of
;; infiniband and infiniband_mad, but you can't use them together, and ;; infiniband and infiniband_mad, but you can't use them together, and
;; the umad version needs at least one patch. ;; the umad version needs at least one patch.
;; Implicit enabled components: perf_event perf_event_uncore ;; Implicit enabled components: perf_event perf_event_uncore
`("--with-perf-events" "--with-shared-lib=yes" "--with-shlib" #~`("--with-perf-events" "--with-shared-lib=yes" "--with-shlib"
"--with-static-lib=no" "--with-static-lib=no" "--with-shlib-tools"
"--with-components=appio coretemp example lustre micpower net rapl \ "--with-components=appio coretemp example lustre micpower net rapl \
stealtime lmsensors infiniband powercap" stealtime lmsensors infiniband powercap"
;; So utils get rpath set correctly: ;; So utils get rpath set correctly:
,(string-append "LDFLAGS=-Xlinker -rpath -Xlinker " ,(string-append "LDFLAGS=-Xlinker -rpath -Xlinker "
(assoc-ref %outputs "out") "/lib")) #$output "/lib")
#:phases ,(string-append "--with-pfm-prefix="
(modify-phases %standard-phases #$(this-package-input "libpfm4")))
(add-before 'configure 'autoconf
(lambda _ #:phases
(chdir "src") #~(modify-phases %standard-phases
(invoke "autoconf") (add-after 'unpack 'change-directory
#t)) (lambda _
;; Amalgamating with the following clause gives double substitution. (chdir "src")
(add-before 'patch-source-shebangs 'patch-components
(lambda _ ;; Work around a mistake whereby 'configure' would always error
(with-directory-excursion "src/components" ;; out when passing '--with-static-lib=no'.
(substitute* '("lmsensors/configure" "infiniband_umad/configure") (substitute* "configure"
(("/bin/sh") (which "sh")))) (("test \"\\$static_lib\" = \"no\"")
#t)) "false"))))
(add-after 'configure 'components (add-after 'install 'extra-doc
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(with-directory-excursion "components" (let ((doc (string-append (assoc-ref outputs "out")
(with-directory-excursion "infiniband_umad" "/share/doc/"
(invoke "./configure")) #$name "-" #$version)))
(with-directory-excursion "lmsensors" (chdir "..") ; we went into src above
(let ((base (assoc-ref inputs "lm-sensors"))) (for-each (lambda (file)
(invoke "./configure" (install-file file doc))
(string-append "--with-sensors_incdir=" '("README.md" "RELEASENOTES.txt"))))))))
base "/include/sensors")
(string-append "--with-sensors_libdir="
base "/lib")))))
#t))
(add-after 'install 'extra-doc
(lambda* (#:key outputs #:allow-other-keys)
(let ((doc (string-append (assoc-ref outputs "out")
"/share/doc/" ,name "-" ,version)))
(chdir "..") ; we went into src above
(for-each (lambda (file)
(install-file file doc))
'("README" "RELEASENOTES.txt"))
#t))))))
(home-page "https://icl.utk.edu/papi/") (home-page "https://icl.utk.edu/papi/")
(synopsis "Performance Application Programming Interface") (synopsis "Performance Application Programming Interface")
(description (description
@ -128,12 +134,9 @@ performance measurement opportunites across the hardware and software stack.")
. "http://icl.cs.utk.edu/papi/software/"))) . "http://icl.cs.utk.edu/papi/software/")))
;; See Debian papi copyright file. ;; See Debian papi copyright file.
(license (list license:bsd-3 (license (list license:bsd-3
license:lgpl2.1+ ;src/components/infiniband/pscanf.h license:lgpl2.1+ ;src/components/infiniband/pscanf.h
;; not used in output ;; not used in output
license:gpl2+ ;src/components/appio/tests/iozone/gengnuplot.sh license:gpl2+ ;src/components/appio/tests/iozone/gengnuplot.sh
;src/libpfm-3.y/*/multiplex*
;; "BSD-like": src/libpfm-3.y/*, src/libpfm4/*
;; lgpl2.1+: src/perfctr-2.*/*
)))) ))))
;; NB. there's a potential name clash with libotf. ;; NB. there's a potential name clash with libotf.