3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
PYTHON_COMPAT=( python3_{9..11} )
|
|
6 |
PYTHON_COMPAT=( python3_{10..11} )
|
7 |
7 |
|
8 |
|
inherit cmake prefix python-any-r1
|
|
8 |
ROCM_VERSION=${PV}
|
|
9 |
|
|
10 |
inherit cmake prefix python-any-r1 rocm
|
9 |
11 |
|
10 |
12 |
DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
|
11 |
13 |
HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer.git"
|
12 |
|
SRC_URI="https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
|
13 |
|
https://github.com/ROCm-Developer-Tools/rocprofiler/archive/rocm-${PV}.tar.gz -> rocprofiler-${PV}.tar.gz
|
14 |
|
https://github.com/ROCmSoftwarePlatform/hsa-class/archive/f8b387043b9f510afdf2e72e38a011900360d6ab.tar.gz -> hsa-class-f8b3870.tar.gz"
|
|
14 |
SRC_URI="https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz"
|
15 |
15 |
S="${WORKDIR}/roctracer-rocm-${PV}"
|
16 |
16 |
|
17 |
17 |
LICENSE="MIT"
|
18 |
18 |
SLOT="0/$(ver_cut 1-2)"
|
19 |
19 |
KEYWORDS="~amd64"
|
|
20 |
IUSE="test"
|
|
21 |
RESTRICT="!test? ( test )"
|
20 |
22 |
|
21 |
|
RDEPEND="dev-libs/rocr-runtime:${SLOT}
|
22 |
|
dev-util/hip:${SLOT}"
|
|
23 |
RDEPEND="dev-libs/rocr-runtime
|
|
24 |
dev-util/hip"
|
23 |
25 |
DEPEND="${RDEPEND}"
|
24 |
26 |
BDEPEND="
|
25 |
27 |
$(python_gen_any_dep '
|
... | ... | |
28 |
30 |
')
|
29 |
31 |
"
|
30 |
32 |
|
31 |
|
PATCHES=(
|
32 |
|
# https://github.com/ROCm-Developer-Tools/roctracer/pull/63
|
33 |
|
"${FILESDIR}"/${PN}-4.3.0-glibc-2.34.patch
|
34 |
|
"${FILESDIR}"/${PN}-5.0.2-Werror.patch
|
35 |
|
"${FILESDIR}"/${PN}-5.0.2-headers.patch
|
36 |
|
"${FILESDIR}"/${PN}-5.0.2-strip-license.patch
|
37 |
|
"${FILESDIR}"/${PN}-5.1.3-no-aqlprofile.patch
|
38 |
|
)
|
|
33 |
PATCHES=( "${FILESDIR}"/roctracer-5.3.3-flat-lib-layout.patch
|
|
34 |
"${FILESDIR}"/roctracer-5.3.3-do-not-install-test-files.patch
|
|
35 |
"${FILESDIR}"/roctracer-5.3.3-Werror.patch )
|
39 |
36 |
|
40 |
37 |
python_check_deps() {
|
41 |
38 |
python_has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" \
|
... | ... | |
45 |
42 |
src_prepare() {
|
46 |
43 |
cmake_src_prepare
|
47 |
44 |
|
48 |
|
mv "${WORKDIR}"/rocprofiler-rocm-${PV} "${WORKDIR}"/rocprofiler || die
|
49 |
|
mv "${WORKDIR}"/hsa-class-*/test/util "${S}"/inc/ || die
|
50 |
|
rm "${S}"/inc/util/hsa* || die
|
51 |
|
cp -a "${S}"/src/util/hsa* "${S}"/inc/util/ || die
|
52 |
|
|
53 |
|
# change destination for headers to include/roctracer;
|
54 |
|
|
55 |
|
sed -e "/LIBRARY DESTINATION/s,lib,$(get_libdir)," \
|
56 |
|
-e "/DESTINATION/s,\${DEST_NAME}/include,include/roctracer," \
|
57 |
|
-e "/install ( FILES \${PROJECT_BINARY_DIR}\/so/d" \
|
58 |
|
-e "/DESTINATION/s,\${DEST_NAME}/lib64,$(get_libdir),g" \
|
59 |
|
-i CMakeLists.txt || die
|
60 |
|
|
61 |
|
# do not download additional sources via git
|
62 |
|
sed -e "/execute_process ( COMMAND sh -xc \"if/d" \
|
63 |
|
-e "/add_subdirectory ( \${HSA_TEST_DIR} \${PROJECT_BINARY_DIR}/d" \
|
64 |
|
-e "/DESTINATION/s,\${DEST_NAME}/tool,$(get_libdir),g" \
|
65 |
|
-i test/CMakeLists.txt || die
|
66 |
|
|
67 |
45 |
hprefixify script/*.py
|
|
46 |
eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.3.3-rocm-path.patch)
|
68 |
47 |
}
|
69 |
48 |
|
70 |
49 |
src_configure() {
|
71 |
|
export HIP_PATH="$(hipconfig -p)"
|
72 |
|
|
|
50 |
export ROCM_PATH="$(hipconfig -p)"
|
73 |
51 |
local mycmakeargs=(
|
74 |
|
-DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa"
|
|
52 |
-DCMAKE_MODULE_PATH="${EPREFIX}/usr/lib64/cmake/hip"
|
|
53 |
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
|
54 |
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
|
|
55 |
-DHIP_CXX_COMPILER=hipcc
|
75 |
56 |
)
|
76 |
57 |
|
77 |
58 |
cmake_src_configure
|
78 |
59 |
}
|
|
60 |
|
|
61 |
src_test() {
|
|
62 |
check_amdgpu
|
|
63 |
cd "${BUILD_DIR}" || die
|
|
64 |
# if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
|
|
65 |
LD_LIBRARY_PATH="${EPREFIX}"/usr/lib64 bash run.sh || die
|
|
66 |
}
|