1 |
commit: 36781efd38eb25f8e0d4643af2c44029f61f702c |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 23 17:06:47 2020 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 27 01:55:26 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36781efd |
7 |
|
8 |
dev-util/hip: C++ Heterogeneous-Compute Interface for Portability. |
9 |
|
10 |
This ebuild is adopted from that of https://github.com/justxi/rocm. |
11 |
|
12 |
1. change hip location from /usr/lib/hip/<ver> to /usr/lib/hip. We do |
13 |
not have plans to support multiple hip versions at once. |
14 |
|
15 |
2. turn the hipify function off as it does not work. We will |
16 |
re-enable it as a USE flag when possible. |
17 |
|
18 |
3. properly prefixify the source code making use of hprefixify(). |
19 |
|
20 |
4. migrate from cmake-utils to cmake eclass. |
21 |
|
22 |
Closes: https://github.com/gentoo/gentoo/pull/18787 |
23 |
Suggested-by: Wilfried Holzke <gentoo <AT> holzke.net> |
24 |
Suggested-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
25 |
Package-Manager: Portage-3.0.12, Repoman-3.0.1 |
26 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
27 |
|
28 |
dev-util/hip/Manifest | 1 + |
29 |
dev-util/hip/files/hip-3.5.1-config-cmake-in.patch | 28 ++++++ |
30 |
...p-3.5.1-detect_offload-arch_for_clang-roc.patch | 21 ++++ |
31 |
.../hip/files/hip-3.5.1-hip_vector_types.patch | 10 ++ |
32 |
dev-util/hip/files/hip-3.9.0-DisableTest.patch | 87 +++++++++++++++++ |
33 |
.../files/hip-3.9.0-add-include-directories.patch | 13 +++ |
34 |
.../hip/files/hip-3.9.0-lpl_ca-add-include.patch | 10 ++ |
35 |
dev-util/hip/hip-4.0.0.ebuild | 107 +++++++++++++++++++++ |
36 |
dev-util/hip/metadata.xml | 19 ++++ |
37 |
9 files changed, 296 insertions(+) |
38 |
|
39 |
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest |
40 |
new file mode 100644 |
41 |
index 00000000000..5081a96f35a |
42 |
--- /dev/null |
43 |
+++ b/dev-util/hip/Manifest |
44 |
@@ -0,0 +1 @@ |
45 |
+DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6 |
46 |
|
47 |
diff --git a/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch b/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch |
48 |
new file mode 100644 |
49 |
index 00000000000..f3b5ac9c19e |
50 |
--- /dev/null |
51 |
+++ b/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch |
52 |
@@ -0,0 +1,28 @@ |
53 |
+--- a/hip-config.cmake.in 2020-06-21 21:17:35.576297760 +0200 |
54 |
++++ b/hip-config.cmake.in 2020-06-21 21:17:59.861296628 +0200 |
55 |
+@@ -123,8 +123,10 @@ |
56 |
+ ) |
57 |
+ set_target_properties(hip::device PROPERTIES |
58 |
+ INTERFACE_COMPILE_DEFINITIONS "__HIP_ROCclr__=1" |
59 |
+- INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include" |
60 |
+- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include" |
61 |
++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" |
62 |
++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" |
63 |
++# INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include" |
64 |
++# INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include" |
65 |
+ ) |
66 |
+ else() |
67 |
+ set_target_properties(hip::hip_hcc_static PROPERTIES |
68 |
+@@ -156,9 +158,9 @@ |
69 |
+ INTERFACE_LINK_LIBRARIES --hip-device-lib-path=${AMD_DEVICE_LIBS_PREFIX}/lib --hip-link |
70 |
+ ) |
71 |
+ |
72 |
+- set_property(TARGET hip::device APPEND PROPERTY |
73 |
+- INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.." |
74 |
+- ) |
75 |
++# set_property(TARGET hip::device APPEND PROPERTY |
76 |
++# INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.." |
77 |
++# ) |
78 |
+ |
79 |
+ set_property(TARGET hip::device APPEND PROPERTY |
80 |
+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.." |
81 |
|
82 |
diff --git a/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch |
83 |
new file mode 100644 |
84 |
index 00000000000..7997e292966 |
85 |
--- /dev/null |
86 |
+++ b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch |
87 |
@@ -0,0 +1,21 @@ |
88 |
+diff -uprN HIP-rocm-3.5.1/bin/hipcc patched/bin/hipcc |
89 |
+--- HIP-rocm-3.5.1/bin/hipcc 2020-07-21 14:29:11.625878447 +0800 |
90 |
++++ patched/bin/hipcc 2020-07-21 14:34:11.454395203 +0800 |
91 |
+@@ -675,7 +675,7 @@ foreach $arg (@ARGV) |
92 |
+ $prevArg = $arg; |
93 |
+ } |
94 |
+ |
95 |
+-if($HIP_PLATFORM eq "hcc"){ |
96 |
++if($HIP_PLATFORM eq "hcc" || $HIP_PLATFORM eq "rocclr"){ |
97 |
+ # No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET |
98 |
+ if($default_amdgpu_target eq 1) { |
99 |
+ if (defined $ENV{HCC_AMDGPU_TARGET}) { |
100 |
+@@ -694,6 +694,8 @@ if($HIP_PLATFORM eq "hcc"){ |
101 |
+ |
102 |
+ if($HIP_COMPILER eq "hcc") { |
103 |
+ $GPU_ARCH_OPT = " --amdgpu-target="; |
104 |
++ } elsif($HIP_COMPILER eq "clang") { |
105 |
++ $GPU_ARCH_OPT = " --offload-arch="; |
106 |
+ } else { |
107 |
+ $GPU_ARCH_OPT = " --cuda-gpu-arch="; |
108 |
+ } |
109 |
|
110 |
diff --git a/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch b/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch |
111 |
new file mode 100644 |
112 |
index 00000000000..382ed52f692 |
113 |
--- /dev/null |
114 |
+++ b/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch |
115 |
@@ -0,0 +1,10 @@ |
116 |
+--- a/include/hip/hcc_detail/hip_vector_types.h |
117 |
++++ b/include/hip/hcc_detail/hip_vector_types.h |
118 |
+@@ -42,6 +42,7 @@ |
119 |
+ #endif |
120 |
+ |
121 |
+ #if defined(__cplusplus) |
122 |
++ #include <new> |
123 |
+ #include <array> |
124 |
+ #include <iosfwd> |
125 |
+ #include <type_traits> |
126 |
|
127 |
diff --git a/dev-util/hip/files/hip-3.9.0-DisableTest.patch b/dev-util/hip/files/hip-3.9.0-DisableTest.patch |
128 |
new file mode 100644 |
129 |
index 00000000000..3fc787a7354 |
130 |
--- /dev/null |
131 |
+++ b/dev-util/hip/files/hip-3.9.0-DisableTest.patch |
132 |
@@ -0,0 +1,87 @@ |
133 |
+--- a/CMakeLists.txt 2020-11-15 11:26:09.747793881 +0100 |
134 |
++++ b/CMakeLists.txt 2020-11-15 11:28:45.289793287 +0100 |
135 |
+@@ -676,45 +676,45 @@ |
136 |
+ # Target: test |
137 |
+ set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}) |
138 |
+ set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}) |
139 |
+-if(HIP_PLATFORM STREQUAL "nvcc") |
140 |
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
141 |
+-endif() |
142 |
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
143 |
+-if(${RUN_HIT} EQUAL 0) |
144 |
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
145 |
+-endif() |
146 |
+-if(${RUN_HIT} EQUAL 0) |
147 |
+- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH}) |
148 |
+- include(${HIP_SRC_PATH}/tests/hit/HIT.cmake) |
149 |
+- |
150 |
+- # Add tests |
151 |
+- include_directories(${HIP_SRC_PATH}/tests/src) |
152 |
+- hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests") |
153 |
+- |
154 |
+- # Add unit tests |
155 |
+- include_directories(${HIP_SRC_PATH}/tests/unit) |
156 |
+- hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests") |
157 |
+- |
158 |
+- # Add performance tests |
159 |
+- include_directories(${HIP_SRC_PATH}/tests/performance) |
160 |
+- hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests") |
161 |
+- |
162 |
+- # Add top-level tests to build_tests |
163 |
+- add_custom_target(build_tests DEPENDS directed_tests unit_tests) |
164 |
+- |
165 |
+- # Add top-level tests to build performance_tests. |
166 |
+- # To build performance tests, just run "make build_perf" |
167 |
+- add_custom_target(build_perf DEPENDS performance_tests) |
168 |
+- |
169 |
+- # Add custom target: perf. |
170 |
+- # To run performance tests, just run "make perf" |
171 |
+- add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose) |
172 |
+- |
173 |
+- # Add custom target: check |
174 |
+- add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests) |
175 |
+-else() |
176 |
+- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location") |
177 |
+-endif() |
178 |
++#if(HIP_PLATFORM STREQUAL "nvcc") |
179 |
++# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
180 |
++#endif() |
181 |
++#execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
182 |
++#if(${RUN_HIT} EQUAL 0) |
183 |
++# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET) |
184 |
++#endif() |
185 |
++#if(${RUN_HIT} EQUAL 0) |
186 |
++# set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH}) |
187 |
++# include(${HIP_SRC_PATH}/tests/hit/HIT.cmake) |
188 |
++# |
189 |
++# # Add tests |
190 |
++# include_directories(${HIP_SRC_PATH}/tests/src) |
191 |
++# hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests") |
192 |
++# |
193 |
++# # Add unit tests |
194 |
++# include_directories(${HIP_SRC_PATH}/tests/unit) |
195 |
++# hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests") |
196 |
++# |
197 |
++# # Add performance tests |
198 |
++# include_directories(${HIP_SRC_PATH}/tests/performance) |
199 |
++# hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests") |
200 |
++# |
201 |
++# # Add top-level tests to build_tests |
202 |
++# add_custom_target(build_tests DEPENDS directed_tests unit_tests) |
203 |
++# |
204 |
++# # Add top-level tests to build performance_tests. |
205 |
++# # To build performance tests, just run "make build_perf" |
206 |
++# add_custom_target(build_perf DEPENDS performance_tests) |
207 |
++# |
208 |
++# # Add custom target: perf. |
209 |
++# # To run performance tests, just run "make perf" |
210 |
++# add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose) |
211 |
++# |
212 |
++# # Add custom target: check |
213 |
++# add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests) |
214 |
++#else() |
215 |
++# message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location") |
216 |
++#endif() |
217 |
+ |
218 |
+ ############################# |
219 |
+ # Code analysis |
220 |
|
221 |
diff --git a/dev-util/hip/files/hip-3.9.0-add-include-directories.patch b/dev-util/hip/files/hip-3.9.0-add-include-directories.patch |
222 |
new file mode 100644 |
223 |
index 00000000000..42bd9736ee2 |
224 |
--- /dev/null |
225 |
+++ b/dev-util/hip/files/hip-3.9.0-add-include-directories.patch |
226 |
@@ -0,0 +1,13 @@ |
227 |
+--- a/rocclr/CMakeLists.txt 2020-08-23 11:45:13.148817894 +0200 |
228 |
++++ b/rocclr/CMakeLists.txt 2020-08-23 11:50:12.409816752 +0200 |
229 |
+@@ -139,6 +139,10 @@ |
230 |
+ target_compile_definitions(hip64 |
231 |
+ PRIVATE |
232 |
+ $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_COMPILE_DEFINITIONS>) |
233 |
++ |
234 |
++ include_directories(/usr/include/rocclr) |
235 |
++ include_directories(/usr/include/rocclr/elf) |
236 |
++ include_directories(/usr/include/rocclr/compiler/lib/include/) |
237 |
+ endif() |
238 |
+ |
239 |
+ # Enable profiling API |
240 |
|
241 |
diff --git a/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch b/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch |
242 |
new file mode 100644 |
243 |
index 00000000000..bebe6f0f4ec |
244 |
--- /dev/null |
245 |
+++ b/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch |
246 |
@@ -0,0 +1,10 @@ |
247 |
+--- a/lpl_ca/CMakeLists.txt 2020-11-15 11:47:55.091788901 +0100 |
248 |
++++ b/lpl_ca/CMakeLists.txt 2020-11-15 11:49:14.881788597 +0100 |
249 |
+@@ -17,6 +17,7 @@ |
250 |
+ ${PROJECT_SOURCE_DIR}/src |
251 |
+ PRIVATE |
252 |
+ $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_INCLUDE_DIRECTORIES>) |
253 |
++target_include_directories(lpl SYSTEM PUBLIC /usr/include/rocclr/elf) |
254 |
+ |
255 |
+ target_compile_options(lpl PUBLIC -Wall) |
256 |
+ target_link_libraries(lpl PUBLIC pthread) |
257 |
|
258 |
diff --git a/dev-util/hip/hip-4.0.0.ebuild b/dev-util/hip/hip-4.0.0.ebuild |
259 |
new file mode 100644 |
260 |
index 00000000000..ae96dbdc84e |
261 |
--- /dev/null |
262 |
+++ b/dev-util/hip/hip-4.0.0.ebuild |
263 |
@@ -0,0 +1,107 @@ |
264 |
+# Copyright 1999-2020 Gentoo Authors |
265 |
+# Distributed under the terms of the GNU General Public License v2 |
266 |
+ |
267 |
+EAPI=7 |
268 |
+inherit cmake flag-o-matic prefix |
269 |
+ |
270 |
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability" |
271 |
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP" |
272 |
+SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz" |
273 |
+ |
274 |
+KEYWORDS="~amd64" |
275 |
+LICENSE="MIT" |
276 |
+SLOT="0/$(ver_cut 1-2)" |
277 |
+ |
278 |
+IUSE="debug profile" |
279 |
+ |
280 |
+# Don't strip to prevent some tests from failing. |
281 |
+RESTRICT="strip" |
282 |
+ |
283 |
+DEPEND=">=dev-libs/rocclr-$(ver_cut 1-2) |
284 |
+ >=dev-util/rocminfo-$(ver_cut 1-2) |
285 |
+ =sys-devel/llvm-roc-${PV}*[runtime]" |
286 |
+RDEPEND="${DEPEND}" |
287 |
+ |
288 |
+PATCHES=( |
289 |
+ "${FILESDIR}/${PN}-3.9.0-DisableTest.patch" |
290 |
+ "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch" |
291 |
+ "${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch" |
292 |
+ "${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch" |
293 |
+ "${FILESDIR}/${PN}-3.5.1-detect_offload-arch_for_clang-roc.patch" |
294 |
+ "${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch" |
295 |
+) |
296 |
+ |
297 |
+S="${WORKDIR}/HIP-rocm-${PV}" |
298 |
+ |
299 |
+src_prepare() { |
300 |
+ cmake_src_prepare |
301 |
+ eapply_user |
302 |
+ |
303 |
+ # disable PCH, because it results in a build error in ROCm 4.0.0 |
304 |
+ sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i "${S}/CMakeLists.txt" || die |
305 |
+ |
306 |
+ # "hcc" is deprecated and not installed, new platform is "rocclr"; |
307 |
+ # Due to setting HAS_PATH to "/usr", this results in setting "-isystem /usr/include" |
308 |
+ # which results in a e.g. "stdlib.h" not found when using "#include_next" in header files; |
309 |
+ sed -e "s:\$HIP_PLATFORM eq \"hcc\" and \$HIP_COMPILER eq \"clang\":\$HIP_PLATFORM eq \"rocclr\" and \$HIP_COMPILER eq \"clang\":" \ |
310 |
+ -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \ |
311 |
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \ |
312 |
+ -i bin/hipcc || die |
313 |
+ |
314 |
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs" |
315 |
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \ |
316 |
+ -i "${S}/hip-config.cmake.in" || die |
317 |
+ |
318 |
+ einfo "prefixing hipcc and its utils..." |
319 |
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}") |
320 |
+} |
321 |
+ |
322 |
+src_configure() { |
323 |
+ strip-flags |
324 |
+ if ! use debug; then |
325 |
+ append-cflags "-DNDEBUG" |
326 |
+ append-cxxflags "-DNDEBUG" |
327 |
+ buildtype="Release" |
328 |
+ else |
329 |
+ buildtype="Debug" |
330 |
+ fi |
331 |
+ |
332 |
+ # TODO: Currently a GENTOO configuration is build, |
333 |
+ # this is also used in the cmake configuration files |
334 |
+ # which will be installed to find HIP; |
335 |
+ # Other ROCm packages expect a "RELEASE" configuration, |
336 |
+ # see "hipBLAS" |
337 |
+ local mycmakeargs=( |
338 |
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc" |
339 |
+ -DCMAKE_BUILD_TYPE=${buildtype} |
340 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip" |
341 |
+ -DBUILD_HIPIFY_CLANG=OFF |
342 |
+ -DHIP_PLATFORM=rocclr |
343 |
+ -DHIP_RUNTIME=ROCclr |
344 |
+ -DHIP_COMPILER=clang |
345 |
+ -DROCM_PATH="${EPREFIX}/usr" |
346 |
+ -DHSA_PATH="${EPREFIX}/usr" |
347 |
+ -DUSE_PROF_API=$(usex profile 1 0) |
348 |
+ -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr |
349 |
+ ) |
350 |
+ |
351 |
+ cmake_src_configure |
352 |
+} |
353 |
+ |
354 |
+src_install() { |
355 |
+ echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die |
356 |
+ echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die |
357 |
+ echo "HIP_PLATFORM=rocclr" >> 99hip || die |
358 |
+ echo "HIP_RUNTIME=ROCclr" >> 99hip || die |
359 |
+ echo "HIP_COMPILER=clang" >> 99hip || die |
360 |
+ echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die |
361 |
+ |
362 |
+ echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die |
363 |
+ echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 99hip || die |
364 |
+ echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die |
365 |
+ echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die |
366 |
+ |
367 |
+ doenvd 99hip |
368 |
+ |
369 |
+ cmake_src_install |
370 |
+} |
371 |
|
372 |
diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml |
373 |
new file mode 100644 |
374 |
index 00000000000..db491e13a34 |
375 |
--- /dev/null |
376 |
+++ b/dev-util/hip/metadata.xml |
377 |
@@ -0,0 +1,19 @@ |
378 |
+<?xml version="1.0" encoding="UTF-8"?> |
379 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
380 |
+<pkgmetadata> |
381 |
+ <maintainer type="project"> |
382 |
+ <email>sci@g.o</email> |
383 |
+ <name>Gentoo Science Project</name> |
384 |
+ </maintainer> |
385 |
+ <maintainer type="person"> |
386 |
+ <email>candrews@g.o</email> |
387 |
+ <name>Craig Andrews</name> |
388 |
+ </maintainer> |
389 |
+ <maintainer type="person"> |
390 |
+ <email>gentoo@××××××.net</email> |
391 |
+ <name>Wilfried Holzke</name> |
392 |
+ </maintainer> |
393 |
+ <upstream> |
394 |
+ <remote-id type="github">ROCm-Developer-Tools/HIP</remote-id> |
395 |
+ </upstream> |
396 |
+</pkgmetadata> |