Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/rocm-comgr/files/, dev-libs/rocm-comgr/
Date: Wed, 07 Aug 2019 17:39:01
Message-Id: 1565199526.c0aa27dab035db39ddc15bc22c0aba651513fead.candrews@gentoo
1 commit: c0aa27dab035db39ddc15bc22c0aba651513fead
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 31 15:53:28 2019 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 7 17:38:46 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0aa27da
7
8 dev-libs/rocm-comgr: Radeon Open Compute Code Object Manager
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
12
13 dev-libs/rocm-comgr/Manifest | 1 +
14 .../files/rocm-comgr-2.6.0-correctly-install.patch | 44 +++++++++++++++
15 .../files/rocm-comgr-2.6.0-dependencies.patch | 63 ++++++++++++++++++++++
16 .../files/rocm-comgr-2.6.0-find-clang.patch | 26 +++++++++
17 .../files/rocm-comgr-2.6.0-find-lld-includes.patch | 43 +++++++++++++++
18 dev-libs/rocm-comgr/metadata.xml | 14 +++++
19 dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild | 45 ++++++++++++++++
20 7 files changed, 236 insertions(+)
21
22 diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest
23 new file mode 100644
24 index 00000000000..8e7150e7fd2
25 --- /dev/null
26 +++ b/dev-libs/rocm-comgr/Manifest
27 @@ -0,0 +1 @@
28 +DIST rocm-comgr-2.6.0.tar.gz 1484343 BLAKE2B fcb496b4997d672640e3f75622e74085eeb9dfe83c88ae025530389d3cdca7628155168060e71f7a3ff915e933ffe70c7026720dc124d128d16ef4df397525e7 SHA512 b14e90603d2b6e17f6b0335ea35da2e5d7e31710f301d7a7f7751a45d996e3dbbfbf84a03e2e911e8798e72e77b87b5cd88317e897cb4de3ee5cf0e7c3222d68
29
30 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
31 new file mode 100644
32 index 00000000000..74206760f39
33 --- /dev/null
34 +++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
35 @@ -0,0 +1,44 @@
36 +From 98f589636729b1e25625db6880fbd7820dcf9e40 Mon Sep 17 00:00:00 2001
37 +From: Craig Andrews <candrews@××××××××××××.com>
38 +Date: Wed, 31 Jul 2019 10:04:11 -0400
39 +Subject: [PATCH] Install to standard locations using GNUInstallDirs
40 +
41 +Some distributions require 64 bit libraries to be installed to lib64, for example.
42 +Using GNUInstallDirs ensures that files are installed to the expected locations.
43 +---
44 + CMakeLists.txt | 8 +++++---
45 + 1 file changed, 5 insertions(+), 3 deletions(-)
46 +
47 +diff --git a/CMakeLists.txt b/CMakeLists.txt
48 +index 454b830..a89af16 100644
49 +--- a/CMakeLists.txt
50 ++++ b/CMakeLists.txt
51 +@@ -1,5 +1,7 @@
52 + cmake_minimum_required(VERSION 3.2.0)
53 +
54 ++include (GNUInstallDirs)
55 ++
56 + # Build ROCM-Compiler-Support with ccache if the package is present.
57 + set(ROCM_COMPILER_SUPPORT_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
58 + if(ROCM_COMPILER_SUPPORT_CCACHE_BUILD)
59 +@@ -146,17 +148,17 @@ configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
60 +
61 + install(TARGETS amd_comgr
62 + EXPORT amd_comgr_export
63 +- DESTINATION lib)
64 ++ DESTINATION ${CMAKE_INSTALL_LIBDIR})
65 +
66 + install(FILES
67 + "include/amd_comgr.h"
68 +- DESTINATION include)
69 ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
70 +
71 + install(FILES
72 + "README.md"
73 + "LICENSE.txt"
74 + "NOTICES.txt"
75 +- DESTINATION share/amd_comgr)
76 ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/amd_comgr)
77 +
78 + # Generate the install-tree package.
79 + set(AMD_COMGR_PREFIX_CODE "
80
81 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
82 new file mode 100644
83 index 00000000000..47f03716829
84 --- /dev/null
85 +++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
86 @@ -0,0 +1,63 @@
87 +https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/19
88 +
89 +--- comgr/CMakeLists.old 2019-07-19 17:19:26.080276421 +0200
90 ++++ comgr/CMakeLists.txt 2019-07-19 18:17:25.780163592 +0200
91 +@@ -185,7 +185,11 @@
92 + include_directories(./yaml-cpp/include)
93 +
94 + set(CLANG_LIBS
95 +- clangFrontendTool)
96 ++ clangFrontendTool
97 ++ clangFrontend
98 ++ clangBasic
99 ++ clangDriver
100 ++ clangSerialization)
101 +
102 + set(LLD_LIBS
103 + lldELF
104 +@@ -193,8 +197,19 @@
105 +
106 + llvm_map_components_to_libnames(LLVM_LIBS
107 + ${LLVM_TARGETS_TO_BUILD}
108 ++ Option
109 + DebugInfoDWARF
110 +- Symbolize)
111 ++ Symbolize
112 ++ Support
113 ++ Object
114 ++ BitWriter
115 ++ MC
116 ++ MCParser
117 ++ MCDisassembler
118 ++ Core
119 ++ IRReader
120 ++ CodeGen
121 ++ Linker)
122 +
123 + target_link_libraries(amd_comgr
124 + PUBLIC
125 +@@ -203,8 +218,8 @@
126 + ${AMD_COMGR_PRIVATE_LINKER_OPTIONS}
127 + yaml-cpp
128 + ${CLANG_LIBS}
129 +- ${LLD_LIBS}
130 + ${LLVM_LIBS}
131 ++ ${LLD_LIBS}
132 + )
133 +
134 + if (NOT UNIX)
135 +@@ -238,3 +253,14 @@
136 + if (NOT CPack_CMake_INCLUDED)
137 + include(CPack)
138 + endif()
139 ++
140 ++MESSAGE(STATUS "<<< Gentoo configuration >>>
141 ++Build type ${CMAKE_BUILD_TYPE}
142 ++Install path ${CMAKE_INSTALL_PREFIX}
143 ++Compiler flags:
144 ++C ${CMAKE_C_FLAGS}
145 ++C++ ${CMAKE_CXX_FLAGS}
146 ++Linker flags:
147 ++Executable ${CMAKE_EXE_LINKER_FLAGS}
148 ++Module ${CMAKE_MODULE_LINKER_FLAGS}
149 ++Shared ${CMAKE_SHARED_LINKER_FLAGS}\n")
150
151 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
152 new file mode 100644
153 index 00000000000..dda005ab7a2
154 --- /dev/null
155 +++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
156 @@ -0,0 +1,26 @@
157 +https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/16
158 +
159 +From 09eb70afa22e2d6066a5f29888158c6005170ca6 Mon Sep 17 00:00:00 2001
160 +From: Craig Andrews <candrews@××××××××××××.com>
161 +Date: Wed, 31 Jul 2019 10:13:30 -0400
162 +Subject: [PATCH] Find Clang avoiding the system (non-ROC) LLVM
163 +
164 +Use NO_DEFAULT_PATH to avoid finding the system (non-ROC) LLVM.
165 +Use /opt/rocm/llvm as an additional hint to be consistent with the build systems of other ROC projects (such as ROCm-OpenCL-Driver)
166 +---
167 + CMakeLists.txt | 2 +-
168 + 1 file changed, 1 insertion(+), 1 deletion(-)
169 +
170 +diff --git a/CMakeLists.txt b/CMakeLists.txt
171 +index 454b830..8642c98 100644
172 +--- a/CMakeLists.txt
173 ++++ b/CMakeLists.txt
174 +@@ -13,7 +13,7 @@ endif()
175 +
176 + project(code_object_manager)
177 +
178 +-find_package(Clang REQUIRED CONFIG)
179 ++find_package(Clang REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
180 + add_definitions(${LLVM_DEFINITIONS})
181 + include_directories(${LLVM_INCLUDE_DIRS})
182 + link_directories(${LLVM_LIBRARY_DIRS})
183
184 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
185 new file mode 100644
186 index 00000000000..5b44feaf1b3
187 --- /dev/null
188 +++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
189 @@ -0,0 +1,43 @@
190 +https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/17
191 +
192 +From 4588c1a5aad3edae9d3e121685d8d1f5fddd54ba Mon Sep 17 00:00:00 2001
193 +From: Craig Andrews <candrews@××××××××××××.com>
194 +Date: Wed, 31 Jul 2019 10:45:01 -0400
195 +Subject: [PATCH] Find lld includes in LLVM_INCLUDE_DIRS
196 +
197 +Allows building against an LLVM build tree
198 +---
199 + CMakeLists.txt | 20 ++------------------
200 + 1 file changed, 2 insertions(+), 18 deletions(-)
201 +
202 +diff --git a/CMakeLists.txt b/CMakeLists.txt
203 +index 454b830..db28533 100644
204 +--- a/CMakeLists.txt
205 ++++ b/CMakeLists.txt
206 +@@ -19,24 +19,8 @@ include_directories(${LLVM_INCLUDE_DIRS})
207 + link_directories(${LLVM_LIBRARY_DIRS})
208 + include_directories(${CLANG_INCLUDE_DIRS})
209 +
210 +-# FIXME: There is no way to directly determine the include paths for LLD when
211 +-# working with an LLVM build tree, but we want to avoid having to install LLVM
212 +-# to build Comgr. This should eventually be fixed in usptream LLD so this can
213 +-# be removed.
214 +-if(DEFINED LLVM_BUILD_MAIN_SRC_DIR)
215 +- set(INTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/tools/lld/include")
216 +- set(EXTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/../lld/include")
217 +- if (EXISTS "${INTERNAL_LLD_INCLUDE_DIRS}"
218 +- AND IS_DIRECTORY "${INTERNAL_LLD_INCLUDE_DIRS}")
219 +- set(LLD_INCLUDE_DIRS "${INTERNAL_LLD_INCLUDE_DIRS}")
220 +- elseif (EXISTS "${EXTERNAL_LLD_INCLUDE_DIRS}"
221 +- AND IS_DIRECTORY "${EXTERNAL_LLD_INCLUDE_DIRS}")
222 +- set(LLD_INCLUDE_DIRS "${EXTERNAL_LLD_INCLUDE_DIRS}")
223 +- else()
224 +- message(FATAL_ERROR "You are attempting to compile using an LLVM build tree, but the LLD include directory could not be located. The paths '${INTERNAL_LLD_INCLUDE_DIRS}' and '${EXTERNAL_LLD_INCLUDE_DIRS}' were tried.")
225 +- endif()
226 +- include_directories(${LLD_INCLUDE_DIRS})
227 +-endif()
228 ++set(LLD_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS}/lld")
229 ++include_directories(${LLD_INCLUDE_DIRS})
230 +
231 + find_package(AMDDeviceLibs CONFIG)
232 +
233
234 diff --git a/dev-libs/rocm-comgr/metadata.xml b/dev-libs/rocm-comgr/metadata.xml
235 new file mode 100644
236 index 00000000000..20237687f91
237 --- /dev/null
238 +++ b/dev-libs/rocm-comgr/metadata.xml
239 @@ -0,0 +1,14 @@
240 +<?xml version="1.0" encoding="UTF-8"?>
241 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
242 +<pkgmetadata>
243 + <maintainer type="person">
244 + <email>candrews@g.o</email>
245 + <name>Craig Andrews</name>
246 + </maintainer>
247 + <upstream>
248 + <remote-id type="github">RadeonOpenCompute/ROCm-CompilerSupport</remote-id>
249 + </upstream>
250 + <longdescription lang="en">
251 + Radeon Open Compute Code Object Manager
252 + </longdescription>
253 +</pkgmetadata>
254
255 diff --git a/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild
256 new file mode 100644
257 index 00000000000..0f058da194b
258 --- /dev/null
259 +++ b/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild
260 @@ -0,0 +1,45 @@
261 +# Copyright 1999-2019 Gentoo Authors
262 +# Distributed under the terms of the GNU General Public License v2
263 +
264 +EAPI=7
265 +
266 +inherit cmake-utils
267 +
268 +if [[ ${PV} == *9999 ]] ; then
269 + EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/"
270 + inherit git-r3
271 + S="${WORKDIR}/${P}/lib/comgr"
272 +else
273 + SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
274 + S="${WORKDIR}/ROCm-CompilerSupport-roc-${PV}/lib/comgr"
275 + KEYWORDS="~amd64"
276 +fi
277 +PATCHES=(
278 + "${FILESDIR}/${P}-correctly-install.patch"
279 + "${FILESDIR}/${P}-find-clang.patch"
280 + "${FILESDIR}/${P}-find-lld-includes.patch"
281 + "${FILESDIR}/${P}-dependencies.patch"
282 +)
283 +
284 +DESCRIPTION="Radeon Open Compute Code Object Manager"
285 +HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
286 +LICENSE="MIT"
287 +SLOT="0/$(ver_cut 1-2)"
288 +
289 +RDEPEND="dev-libs/rocm-device-libs
290 + dev-cpp/yaml-cpp
291 + sys-devel/llvm-roc"
292 +DEPEND="${RDEPEND}"
293 +
294 +src_prepare() {
295 +# rm -rf yaml-cpp || die
296 + cmake-utils_src_prepare
297 +}
298 +
299 +src_configure() {
300 + local mycmakeargs=(
301 + -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
302 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
303 + )
304 + cmake-utils_src_configure
305 +}