1 |
|
# Copyright 1999-2020 Gentoo Authors
|
|
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
FORTRAN_NEEDED=fortran
|
7 |
|
LUA_COMPAT=( lua5-{2..3} )
|
8 |
|
#PYTHON_COMPAT=( python3_{6,7} )
|
9 |
7 |
|
10 |
|
# 4.3.4 will need python-single-r1
|
11 |
|
inherit fcaps fortran-2 linux-info lua-single toolchain-funcs
|
|
8 |
inherit fcaps fortran-2 linux-info toolchain-funcs
|
12 |
9 |
|
13 |
10 |
DESCRIPTION="A performance-oriented tool suite for x86 multicore environments"
|
14 |
11 |
HOMEPAGE="https://github.com/rrze-likwid/likwid"
|
15 |
12 |
SRC_URI="https://ftp.fau.de/pub/likwid/${P}.tar.gz"
|
16 |
13 |
|
17 |
|
LICENSE="GPL-3+ BSD"
|
|
14 |
LICENSE="GPL-3+ BSD MIT"
|
18 |
15 |
|
19 |
16 |
SLOT="0"
|
20 |
17 |
KEYWORDS="~amd64" # upstream partial support exists for x86 arm arm64
|
21 |
18 |
IUSE="fortran"
|
22 |
19 |
|
23 |
|
REQUIRED_USE="${LUA_REQUIRED_USE}" # ${PYTHON_REQUIRED_USE}
|
|
20 |
CDEPEND="dev-lang/perl"
|
24 |
21 |
|
25 |
|
# lua:
|
26 |
|
# likwid's primary functionality is driven by a set of lua scripts installed in
|
27 |
|
# /usr/bin/
|
28 |
|
# likwid bundles lua-5.3.2, AND supports using a system copy of lua-5.2 or
|
29 |
|
# lua-5.3.
|
30 |
|
#
|
31 |
|
# hwloc:
|
32 |
|
# likwid bundles a MODIFIED copy of hwloc-2.0.0a1 with specific configuration
|
33 |
|
# for CPU probing & access
|
34 |
|
#
|
35 |
|
# Perl:
|
36 |
|
# likwid uses Perl to convert from an internal text format to ASM listings
|
37 |
|
# likwid also uses perl for some installed helper scripts
|
38 |
|
# The build system bundles some Perl modules, that are not removed at this time:
|
39 |
|
# Parse-RecDescent
|
40 |
|
# Template
|
41 |
|
#
|
42 |
|
# Python:
|
43 |
|
# Python3 is used for one helper script, filter/json, added after 4.3.3
|
44 |
|
CDEPEND="dev-lang/perl
|
45 |
|
${LUA_DEPS}"
|
46 |
|
|
47 |
|
# filter/json uses Python3
|
48 |
22 |
RDEPEND="${CDEPEND}"
|
49 |
|
#${PYTHON_DEPS}"
|
50 |
|
|
51 |
|
# Part of the build process depends on Data::Dumper
|
52 |
|
# perl-core/Data-Dumper"
|
53 |
23 |
DEPEND="${CDEPEND}"
|
54 |
24 |
|
55 |
25 |
CONFIG_CHECK="~X86_MSR"
|
... | ... | |
62 |
32 |
|
63 |
33 |
PATCHES=(
|
64 |
34 |
"${FILESDIR}/${PN}-4.3.1-fix-gnustack.patch"
|
65 |
|
# Old patches are obsolete:
|
66 |
|
#"${FILESDIR}/${PN}-4.3.1-Makefile.patch"
|
67 |
|
#"${FILESDIR}/${PN}-4.3.1-config.mk.patch"
|
68 |
35 |
)
|
69 |
36 |
|
70 |
37 |
pkg_setup() {
|
71 |
38 |
fortran-2_pkg_setup
|
72 |
|
lua-single_pkg_setup
|
73 |
|
#python-single-r1_pkg_setup
|
74 |
39 |
}
|
75 |
40 |
|
76 |
41 |
src_prepare() {
|
... | ... | |
106 |
71 |
local INSTALLED_PREFIX=/usr
|
107 |
72 |
local INSTALLED_LIBPREFIX=/usr/$(get_libdir) # upstream is '$(INSTALLED_PREFIX)/lib'
|
108 |
73 |
local INSTALLED_MANPREFIX=/usr/share/man # upstream has it as used but undefined variable.
|
109 |
|
# WARNING: setting LUA_LIB_NAME=${ELUA} does *not* work with LuaJIT, keep this on mind
|
110 |
|
# should likwid upstream ever begin to support it.
|
111 |
74 |
# If the build is too loud, pass 'Q=@'
|
112 |
75 |
src_compile_opts=(
|
113 |
76 |
"Q="
|
... | ... | |
120 |
83 |
"CC=$(tc-getCC)"
|
121 |
84 |
"ANSI_CFLAGS=${CFLAGS}"
|
122 |
85 |
"INSTRUMENT_BENCH=true"
|
123 |
|
"LUA_INCLUDE_DIR=$(lua_get_include_dir)"
|
124 |
|
"LUA_LIB_DIR=$(dirname "$(lua_get_shared_lib)")"
|
125 |
|
"LUA_LIB_NAME=${ELUA}"
|
126 |
|
"LUA_BIN=/usr/bin"
|
127 |
86 |
"FORTRAN_INTERFACE=$(usex fortran likwid.mod false)"
|
128 |
87 |
"FC=$(usex fortran "${FC}" false)"
|
129 |
88 |
"FCFLAGS=-J ./ -fsyntax-only" # needed for building correctly
|
... | ... | |
138 |
97 |
src_compile() {
|
139 |
98 |
export_emake_opts
|
140 |
99 |
emake \
|
141 |
|
"${src_compile_opts[@]}"
|
|
100 |
"${src_compile_opts[@]}" \
|
|
101 |
|| die 'emake failed'
|
142 |
102 |
}
|
143 |
103 |
|
144 |
|
src_install() {
|
|
104 |
src_install () {
|
145 |
105 |
export_emake_opts
|
146 |
106 |
emake \
|
147 |
107 |
"${src_compile_opts[@]}" \
|
148 |
108 |
"${src_install_opts[@]}" \
|
149 |
109 |
DESTDIR="${D}" \
|
150 |
|
install
|
|
110 |
install || die 'emake install failed'
|
151 |
111 |
|
152 |
112 |
use fortran && doheader likwid.mod
|
153 |
113 |
|
... | ... | |
157 |
117 |
# Do NOT use 'doman'! The upstream 'make install' target does a sed as it's
|
158 |
118 |
# generating the final manpage to the real install dir; and the copies in
|
159 |
119 |
# ${S} are unmodified.
|
160 |
|
dodoc README.md CHANGELOG doc/logo.png
|
|
120 |
dodoc README.md CHANGELOG
|
161 |
121 |
dodoc doc/*.txt
|
162 |
122 |
dodoc doc/*.md
|
163 |
123 |
dodoc -r doc/applications doc/archs
|