Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/rocm-comgr/, dev-libs/rocm-comgr/files/
Date: Mon, 24 Jan 2022 14:46:19
Message-Id: 1643035568.2748258294bd38ddfe450715bd5ff94e1dd41ffb.heroxbd@gentoo
1 commit: 2748258294bd38ddfe450715bd5ff94e1dd41ffb
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 24 14:41:45 2022 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 24 14:46:08 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27482582
7
8 dev-libs/rocm-comgr: strip off ROCM_PATH/include.
9
10 On Gentoo ROCM_PATH=/usr. We should not set the header path.
11
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
14
15 .../files/rocm-comgr-4.3.0_strip-usr-include.patch | 16 +++++++++
16 dev-libs/rocm-comgr/rocm-comgr-4.3.0-r1.ebuild | 39 ++++++++++++++++++++++
17 2 files changed, 55 insertions(+)
18
19 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-4.3.0_strip-usr-include.patch b/dev-libs/rocm-comgr/files/rocm-comgr-4.3.0_strip-usr-include.patch
20 new file mode 100644
21 index 000000000000..9d722a57d2a6
22 --- /dev/null
23 +++ b/dev-libs/rocm-comgr/files/rocm-comgr-4.3.0_strip-usr-include.patch
24 @@ -0,0 +1,16 @@
25 +On Gentoo, ROCM_PATH=/usr we do not need to set -I${ROCM_PATH}/include.
26 +Actually it is harmful to the `include_next`s.
27 +
28 +Index: ROCm-CompilerSupport-rocm-4.3.0/lib/comgr/src/comgr-compiler.cpp
29 +===================================================================
30 +--- comgr/src/comgr-compiler.cpp
31 ++++ comgr/src/comgr-compiler.cpp
32 +@@ -927,8 +927,6 @@ AMDGPUCompiler::addTargetIdentifierFlags
33 +
34 + amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
35 + HIPIncludePath = (Twine(env::getHIPPath()) + "/include").str();
36 +- // HIP headers depend on hsa.h which is in ROCM_DIR/include.
37 +- ROCMIncludePath = (Twine(env::getROCMPath()) + "/include").str();
38 + ClangIncludePath =
39 + (Twine(env::getLLVMPath()) + "/lib/clang/" + CLANG_VERSION_STRING).str();
40 + ClangIncludePath2 = (Twine(env::getLLVMPath()) + "/lib/clang/" +
41
42 diff --git a/dev-libs/rocm-comgr/rocm-comgr-4.3.0-r1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-4.3.0-r1.ebuild
43 new file mode 100644
44 index 000000000000..192ddca854e1
45 --- /dev/null
46 +++ b/dev-libs/rocm-comgr/rocm-comgr-4.3.0-r1.ebuild
47 @@ -0,0 +1,39 @@
48 +# Copyright 1999-2022 Gentoo Authors
49 +# Distributed under the terms of the GNU General Public License v2
50 +
51 +EAPI=7
52 +
53 +inherit cmake
54 +
55 +if [[ ${PV} == *9999 ]] ; then
56 + EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/"
57 + inherit git-r3
58 + S="${WORKDIR}/${P}/lib/comgr"
59 +else
60 + SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
61 + S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr"
62 + KEYWORDS="~amd64"
63 +fi
64 +
65 +PATCHES=(
66 + "${FILESDIR}"/${PN}-3.1.0-dependencies.patch
67 + "${FILESDIR}"/${PN}-4.3.0_strip-usr-include.patch
68 +)
69 +
70 +DESCRIPTION="Radeon Open Compute Code Object Manager"
71 +HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
72 +LICENSE="MIT"
73 +SLOT="0/$(ver_cut 1-2)"
74 +
75 +RDEPEND=">=dev-libs/rocm-device-libs-${PV}
76 + >=sys-devel/llvm-roc-${PV}:="
77 +DEPEND="${RDEPEND}"
78 +
79 +src_configure() {
80 + local mycmakeargs=(
81 + -DLLD_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/lld"
82 + -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/llvm"
83 + -DClang_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/clang"
84 + )
85 + cmake_src_configure
86 +}