1 |
commit: 6172e7509687d5758e6294a511a153b81a665179 |
2 |
Author: Craig Andrews <candrews <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 30 15:18:28 2019 +0000 |
4 |
Commit: Craig Andrews <candrews <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 30 15:18:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6172e750 |
7 |
|
8 |
dev-libs/rocm-opencl-runtime: 2.8.0 version bump |
9 |
|
10 |
Package-Manager: Portage-2.3.76, Repoman-2.3.17 |
11 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
12 |
|
13 |
dev-libs/rocm-opencl-runtime/Manifest | 2 + |
14 |
.../rocm-opencl-runtime-2.8.0-amdocl64icd.patch | 13 ++ |
15 |
...-opencl-runtime-2.8.0-change-AMDCompilerh.patch | 79 +++++++++++ |
16 |
...ncl-runtime-2.8.0-change-install-location.patch | 146 +++++++++++++++++++++ |
17 |
.../rocm-opencl-runtime-2.8.0-change-opencl.patch | 70 ++++++++++ |
18 |
.../rocm-opencl-runtime-2.8.0-update-README.patch | 41 ++++++ |
19 |
.../rocm-opencl-runtime-2.8.0.ebuild | 57 ++++++++ |
20 |
7 files changed, 408 insertions(+) |
21 |
|
22 |
diff --git a/dev-libs/rocm-opencl-runtime/Manifest b/dev-libs/rocm-opencl-runtime/Manifest |
23 |
index 7d10d714262..1ac3a1de1bd 100644 |
24 |
--- a/dev-libs/rocm-opencl-runtime/Manifest |
25 |
+++ b/dev-libs/rocm-opencl-runtime/Manifest |
26 |
@@ -1,2 +1,4 @@ |
27 |
+DIST OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8.tar.gz 63248 BLAKE2B 7c311d98e5a209d01f1f1dbad7471ceb3de66e10f7cee48686ed176efcde1e7ba48ea12bdbf2af61d5f72e5b8eda69b2fae6829d265a8b88ad46c4ec4995d8d4 SHA512 5033d6fb0ef2515e56b0d9c31baf6fe02e90613989c417fbde20efd79e0ac2841df1a98ff799e60cc469b79244cdc756d15950df6c9baead7d31febe7cad0418 |
28 |
DIST OpenCL-ICD-Loader-bc9728edf8cace79cf33bf75560be88fc2432dc4.tar.gz 62858 BLAKE2B 931fb7ade12debda99512d8b9fbfb987f47e3b68568863e480de406f842a014d39f0321c44420fb8b68b8757d49cc02cadf82e767c9d2b71e53bdb8e9763cace SHA512 2ab9035fbc0a80a529d1b2f454b0b9a263b6eff601121750e81e2e32581f06189566cdcf201ab741ff3f1491ead825a7858000901f8042af67b1304be622e9fa |
29 |
DIST rocm-opencl-runtime-2.6.0.tar.gz 986155 BLAKE2B 43469ec3a368e2ee9716a38d08df48c28165a233bd80de54f286011df25782a197e252e8e41ffa8f59eecf93d6beae5434497e8d4b648676252d32a0859ba59a SHA512 bbbbd29bf23f93440135786600cca28a806714bb207b7ad0947d26471fa38470820e7801acc84380000d43d55ff2ec1d95cee9e64b500628b6a3b026744c67df |
30 |
+DIST rocm-opencl-runtime-2.8.0.tar.gz 976851 BLAKE2B 4191c2f027f615a8ba7a38d30364549df509e6bd432e5bfe3d30d40fb6bade15b58fe824b5aa9704e5d93421f28e1067d283738fa85e7ec59a444f5be25c963c SHA512 6c070d3e2f455d96f028f614f0562c0b8983b457c6295c398d6d4574133d4a7384573caa1f32e39550887861aa09aa19c9e34fc8bbae6ddc41ae395969d33540 |
31 |
|
32 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..f399f360c9c |
35 |
--- /dev/null |
36 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch |
37 |
@@ -0,0 +1,13 @@ |
38 |
+diff --git a/api/opencl/amdocl/CMakeLists.txt b/api/opencl/amdocl/CMakeLists.txt |
39 |
+index 8ea8517..d1223ed 100644 |
40 |
+--- a/api/opencl/amdocl/CMakeLists.txt |
41 |
++++ b/api/opencl/amdocl/CMakeLists.txt |
42 |
+@@ -82,3 +82,7 @@ if(${USE_COMGR_LIBRARY} MATCHES "yes") |
43 |
+ else() |
44 |
+ target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${ROCT_LIBRARIES} ${ROCR_LIBRARIES}) |
45 |
+ endif() |
46 |
++ |
47 |
++file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/amdocl64.icd" CONTENT "$<TARGET_FILE_NAME:amdocl64>") |
48 |
++install(FILES "${CMAKE_BINARY_DIR}/amdocl64.icd" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/OpenCL/vendors/") |
49 |
++ |
50 |
+ |
51 |
|
52 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch |
53 |
new file mode 100644 |
54 |
index 00000000000..796277e4672 |
55 |
--- /dev/null |
56 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch |
57 |
@@ -0,0 +1,79 @@ |
58 |
+diff --git a/runtime/device/device.hpp b/runtime/device/device.hpp |
59 |
+index 9eb45b2..a721463 100644 |
60 |
+--- a/runtime/device/device.hpp |
61 |
++++ b/runtime/device/device.hpp |
62 |
+@@ -21,7 +21,7 @@ |
63 |
+ |
64 |
+ #if defined(WITH_LIGHTNING_COMPILER) && !defined(USE_COMGR_LIBRARY) |
65 |
+ #include "caching/cache.hpp" |
66 |
+-#include "driver/AmdCompiler.h" |
67 |
++#include "AmdCompiler.h" |
68 |
+ #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY) |
69 |
+ #include "acl.h" |
70 |
+ |
71 |
+diff --git a/runtime/device/devprogram.cpp b/runtime/device/devprogram.cpp |
72 |
+index 587e950..dc233f3 100644 |
73 |
+--- a/runtime/device/devprogram.cpp |
74 |
++++ b/runtime/device/devprogram.cpp |
75 |
+@@ -14,7 +14,7 @@ |
76 |
+ |
77 |
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY) |
78 |
+ #ifndef USE_COMGR_LIBRARY |
79 |
+-#include "driver/AmdCompiler.h" |
80 |
++#include "AmdCompiler.h" |
81 |
+ #include "libraries.amdgcn.inc" |
82 |
+ #include "opencl1.2-c.amdgcn.inc" |
83 |
+ #include "opencl2.0-c.amdgcn.inc" |
84 |
+diff --git a/runtime/device/devprogram.hpp b/runtime/device/devprogram.hpp |
85 |
+index 68de7ba..8b91ba2 100644 |
86 |
+--- a/runtime/device/devprogram.hpp |
87 |
++++ b/runtime/device/devprogram.hpp |
88 |
+@@ -11,7 +11,7 @@ |
89 |
+ |
90 |
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY) |
91 |
+ #ifndef USE_COMGR_LIBRARY |
92 |
+-#include "driver/AmdCompiler.h" |
93 |
++#include "AmdCompiler.h" |
94 |
+ #else |
95 |
+ #include "amd_comgr.h" |
96 |
+ #endif |
97 |
+diff --git a/runtime/device/rocm/rocdevice.cpp b/runtime/device/rocm/rocdevice.cpp |
98 |
+index 4cba9d7..7ab30ed 100644 |
99 |
+--- a/runtime/device/rocm/rocdevice.cpp |
100 |
++++ b/runtime/device/rocm/rocdevice.cpp |
101 |
+@@ -20,7 +20,7 @@ |
102 |
+ #include "device/rocm/rocvirtual.hpp" |
103 |
+ #include "device/rocm/rocprogram.hpp" |
104 |
+ #if defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY) |
105 |
+-#include "driver/AmdCompiler.h" |
106 |
++#include "AmdCompiler.h" |
107 |
+ #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY) |
108 |
+ #include "device/rocm/rocmemory.hpp" |
109 |
+ #include "device/rocm/rocglinterop.hpp" |
110 |
+diff --git a/runtime/device/rocm/rockernel.cpp b/runtime/device/rocm/rockernel.cpp |
111 |
+index 8a28acc..7d5b62d 100644 |
112 |
+--- a/runtime/device/rocm/rockernel.cpp |
113 |
++++ b/runtime/device/rocm/rockernel.cpp |
114 |
+@@ -11,7 +11,7 @@ |
115 |
+ |
116 |
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY) |
117 |
+ #ifndef USE_COMGR_LIBRARY |
118 |
+-#include "driver/AmdCompiler.h" |
119 |
++#include "AmdCompiler.h" |
120 |
+ #endif |
121 |
+ #include "llvm/Support/AMDGPUMetadata.h" |
122 |
+ |
123 |
+diff --git a/runtime/device/rocm/rocprogram.cpp b/runtime/device/rocm/rocprogram.cpp |
124 |
+index 0155dc2..613d00d 100644 |
125 |
+--- a/runtime/device/rocm/rocprogram.cpp |
126 |
++++ b/runtime/device/rocm/rocprogram.cpp |
127 |
+@@ -10,7 +10,7 @@ |
128 |
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY) |
129 |
+ #include <gelf.h> |
130 |
+ #ifndef USE_COMGR_LIBRARY |
131 |
+-#include "driver/AmdCompiler.h" |
132 |
++#include "AmdCompiler.h" |
133 |
+ #include "libraries.amdgcn.inc" |
134 |
+ #endif |
135 |
+ #endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY) |
136 |
+ |
137 |
|
138 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch |
139 |
new file mode 100644 |
140 |
index 00000000000..0679da4d639 |
141 |
--- /dev/null |
142 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch |
143 |
@@ -0,0 +1,146 @@ |
144 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
145 |
+index 83575a3..a0526d1 100644 |
146 |
+--- a/CMakeLists.txt |
147 |
++++ b/CMakeLists.txt |
148 |
+@@ -28,12 +28,26 @@ endif() |
149 |
+ |
150 |
+ project(OpenCL-ROCm) |
151 |
+ |
152 |
++include (GNUInstallDirs) |
153 |
++ |
154 |
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") |
155 |
+ set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2" CACHE PATH "") |
156 |
+ |
157 |
+ find_package(ROCT REQUIRED) |
158 |
+ find_package(ROCR REQUIRED) |
159 |
+ |
160 |
++find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH) |
161 |
++set(USE_COMGR_LIBRARY "yes") |
162 |
++find_package(amd_comgr REQUIRED CONFIG) |
163 |
++add_definitions(-DUSE_COMGR_LIBRARY) |
164 |
++FOREACH(DIR ${LLVM_INCLUDE_DIRS}) |
165 |
++ include_directories("${DIR}") |
166 |
++ include_directories("${DIR}/clang") |
167 |
++ include_directories("${DIR}/lld") |
168 |
++ # TODO: move AMDGPU.h header to include folder |
169 |
++ include_directories("${DIR}/llvm/Target/AMDGPU") |
170 |
++ENDFOREACH() |
171 |
++ |
172 |
+ # FIXME: Remove following if block after enabling COMGR by default |
173 |
+ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
174 |
+ set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "") |
175 |
+@@ -46,29 +60,19 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
176 |
+ # override default option value in library and driver |
177 |
+ set(GENERIC_IS_ZERO ON CACHE BOOL ON FORCE) |
178 |
+ |
179 |
+- add_subdirectory(compiler/llvm EXCLUDE_FROM_ALL) |
180 |
+- |
181 |
+- find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_BINARY_DIR}/compiler/llvm NO_DEFAULT_PATH) |
182 |
++ find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH) |
183 |
+ |
184 |
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") |
185 |
+ include(AddLLVM) |
186 |
+ |
187 |
+ add_definitions(${LLVM_DEFINITIONS}) |
188 |
+- # TODO: add find_package for Clang and lld, and also use LLVM/Clang variables got from their config |
189 |
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/include) |
190 |
+- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/tools/clang/include) |
191 |
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/lld/include) |
192 |
+- |
193 |
+- # TODO: move AMDGPU.h header to include folder |
194 |
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/lib/Target/AMDGPU) |
195 |
+- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/lib/Target/AMDGPU) |
196 |
+ |
197 |
+ set(BUILD_HC_LIB OFF CACHE BOOL "") |
198 |
+ set(ROCM_DEVICELIB_INCLUDE_TESTS OFF CACHE BOOL "") |
199 |
+ set(AMDGCN_TARGETS_LIB_LIST "AMDGCN_LIB_TARGETS") |
200 |
+ set(AMDGCN_TARGETS_LIB_DEPS "AMDGCN_DEP_TARGETS") |
201 |
+ set(AMDGPU_TARGET_TRIPLE "amdgcn-amd-amdhsa") |
202 |
+- add_subdirectory(library/amdgcn EXCLUDE_FROM_ALL) |
203 |
++ |
204 |
+ add_subdirectory(compiler/driver EXCLUDE_FROM_ALL) |
205 |
+ |
206 |
+ install(PROGRAMS $<TARGET_FILE:clang> $<TARGET_FILE:lld> |
207 |
+@@ -84,51 +88,51 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
208 |
+ endforeach() |
209 |
+ endif() # if (${USE_COMGR_LIBRARY} STREQUAL "no") |
210 |
+ |
211 |
+-if(${USE_COMGR_LIBRARY} MATCHES "yes") |
212 |
+- set(COMGR_DYN_DLL "yes") |
213 |
+- add_definitions(-DCOMGR_DYN_DLL) |
214 |
+- add_definitions(-DUSE_COMGR_LIBRARY) |
215 |
+- if( ${BUILD_HIP} MATCHES "yes") |
216 |
+- add_subdirectory(api/hip) |
217 |
+- endif() |
218 |
+-endif() |
219 |
++#if(${USE_COMGR_LIBRARY} MATCHES "yes") |
220 |
++# set(COMGR_DYN_DLL "yes") |
221 |
++# add_definitions(-DCOMGR_DYN_DLL) |
222 |
++# add_definitions(-DUSE_COMGR_LIBRARY) |
223 |
++# if( ${BUILD_HIP} MATCHES "yes") |
224 |
++# add_subdirectory(api/hip) |
225 |
++# endif() |
226 |
++#endif() |
227 |
+ |
228 |
+ add_subdirectory(api/opencl/amdocl) |
229 |
+ add_subdirectory(compiler/lib/loaders/elf/utils/libelf) |
230 |
+ add_subdirectory(runtime) |
231 |
+-add_subdirectory(tools/clinfo) |
232 |
++#add_subdirectory(tools/clinfo) |
233 |
+ |
234 |
+ set(BUILD_SHARED_LIBS "Build shared libs" ON) |
235 |
+-add_subdirectory(api/opencl/khronos/icd) |
236 |
++#add_subdirectory(api/opencl/khronos/icd) |
237 |
+ |
238 |
+ ###--- Packaging ------------------------------------------------------------### |
239 |
+ |
240 |
+ # MAIN package |
241 |
+-install(PROGRAMS $<TARGET_FILE:clinfo> |
242 |
+- DESTINATION bin/x86_64 |
243 |
+- COMPONENT MAIN) |
244 |
++#install(PROGRAMS $<TARGET_FILE:clinfo> |
245 |
++# DESTINATION bin/x86_64 |
246 |
++# COMPONENT MAIN) |
247 |
+ install(PROGRAMS $<TARGET_FILE:amdocl64> |
248 |
+- DESTINATION lib/x86_64 |
249 |
+- COMPONENT MAIN) |
250 |
+-install(PROGRAMS $<TARGET_FILE:OpenCL> |
251 |
+- DESTINATION lib/x86_64 |
252 |
+- COMPONENT MAIN) |
253 |
+-install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL> |
254 |
+- DESTINATION lib/x86_64 |
255 |
++ DESTINATION lib64 |
256 |
+ COMPONENT MAIN) |
257 |
++#install(PROGRAMS $<TARGET_FILE:OpenCL> |
258 |
++# DESTINATION lib/x86_64 |
259 |
++# COMPONENT MAIN) |
260 |
++#install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL> |
261 |
++# DESTINATION lib/x86_64 |
262 |
++# COMPONENT MAIN) |
263 |
+ |
264 |
+ # DEV package |
265 |
+-install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL" |
266 |
+- DESTINATION include |
267 |
+- COMPONENT DEV |
268 |
+- USE_SOURCE_PERMISSIONS |
269 |
+- PATTERN cl_d3d10.h EXCLUDE |
270 |
+- PATTERN cl_d3d11.h EXCLUDE |
271 |
+- PATTERN cl_dx9_media_sharing.h EXCLUDE |
272 |
+- PATTERN cl_egl.h EXCLUDE) |
273 |
+-install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL> |
274 |
+- DESTINATION lib/x86_64 |
275 |
+- COMPONENT DEV) |
276 |
++#install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL" |
277 |
++# DESTINATION include |
278 |
++# COMPONENT DEV |
279 |
++# USE_SOURCE_PERMISSIONS |
280 |
++# PATTERN cl_d3d10.h EXCLUDE |
281 |
++# PATTERN cl_d3d11.h EXCLUDE |
282 |
++# PATTERN cl_dx9_media_sharing.h EXCLUDE |
283 |
++# PATTERN cl_egl.h EXCLUDE) |
284 |
++#install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL> |
285 |
++# DESTINATION lib/x86_64 |
286 |
++# COMPONENT DEV) |
287 |
+ |
288 |
+ # Generic CPACK variables |
289 |
+ set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators") |
290 |
|
291 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch |
292 |
new file mode 100644 |
293 |
index 00000000000..cd6695e2d4f |
294 |
--- /dev/null |
295 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch |
296 |
@@ -0,0 +1,70 @@ |
297 |
+diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt |
298 |
+index 2c9dfd6..863b4bf 100644 |
299 |
+--- a/runtime/CMakeLists.txt |
300 |
++++ b/runtime/CMakeLists.txt |
301 |
+@@ -23,7 +23,6 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
302 |
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/include) |
303 |
+ endif() # if (${USE_COMGR_LIBRARY} STREQUAL "no") |
304 |
+ |
305 |
+-include_directories(${CMAKE_SOURCE_DIR}/compiler/driver/src) |
306 |
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib) |
307 |
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/include) |
308 |
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/backends/common) |
309 |
+@@ -79,6 +78,8 @@ add_library(oclruntime OBJECT |
310 |
+ ${COMGR_CPP} |
311 |
+ ) |
312 |
+ set_target_properties(oclruntime PROPERTIES POSITION_INDEPENDENT_CODE ON) |
313 |
++#add_dependencies(oclruntime opencl1.2-c.amdgcn.inc_target) |
314 |
++#add_dependencies(oclruntime opencl2.0-c.amdgcn.inc_target) |
315 |
+ |
316 |
+ set(AMDGCN_DEP_LIST) |
317 |
+ if(AMDGCN_TARGETS_LIB_DEPS) |
318 |
+diff --git a/runtime/device/rocm/CMakeLists.txt b/runtime/device/rocm/CMakeLists.txt |
319 |
+index 5870b65..39166f3 100644 |
320 |
+--- a/runtime/device/rocm/CMakeLists.txt |
321 |
++++ b/runtime/device/rocm/CMakeLists.txt |
322 |
+@@ -1,3 +1,21 @@ |
323 |
++find_package(Clang REQUIRED CONFIG) |
324 |
++ |
325 |
++# FIXME: CLANG_CMAKE_DIR seems like the most stable way to find this, but |
326 |
++# really there is no way to reliably discover this header. |
327 |
++# |
328 |
++# We effectively back up to the Clang output directory (for the case of a build |
329 |
++# tree) or install prefix (for the case of an installed copy), and then search |
330 |
++# for a file named opencl-c.h anywhere below that. We take the first result in |
331 |
++# the case where there are multiple (e.g. if there is an installed copy nested |
332 |
++# in a build directory). This is a bit imprecise, but it covers cases like MSVC |
333 |
++# adding some additional configuration-specific subdirectories to the build |
334 |
++# tree but not to an installed copy. |
335 |
++file(GLOB_RECURSE OPENCL_C_H_LIST "${CLANG_CMAKE_DIR}/../../../*/opencl-c.h") |
336 |
++list(GET OPENCL_C_H_LIST 0 OPENCL_C_H) |
337 |
++if (NOT EXISTS "${OPENCL_C_H}" OR IS_DIRECTORY "${OPENCL_C_H}") |
338 |
++ message(FATAL_ERROR "Unable to locate opencl-c.h from the supplied Clang. The path '${CLANG_CMAKE_DIR}/../../../*' was searched.") |
339 |
++endif() |
340 |
++ |
341 |
+ include(bc2h) |
342 |
+ |
343 |
+ set(INC_SUFFIX "amdgcn.inc") |
344 |
+@@ -82,8 +100,8 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
345 |
+ |
346 |
+ # generating opencl*.inc files |
347 |
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch |
348 |
+- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h |
349 |
+- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h |
350 |
++ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${OPENCL_C_H} |
351 |
++ DEPENDS clang ${OPENCL_C_H} |
352 |
+ COMMENT "Generating opencl1.2-c.amdgcn.pch" |
353 |
+ ) |
354 |
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc |
355 |
+@@ -96,8 +114,8 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no") |
356 |
+ add_dependencies(oclrocm opencl1.2-c.amdgcn.inc_target) |
357 |
+ |
358 |
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch |
359 |
+- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h |
360 |
+- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h |
361 |
++ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${OPENCL_C_H} |
362 |
++ DEPENDS clang ${OPENCL_C_H} |
363 |
+ COMMENT "Generating opencl2.0-c.amdgcn.pch" |
364 |
+ ) |
365 |
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc |
366 |
+ |
367 |
|
368 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch |
369 |
new file mode 100644 |
370 |
index 00000000000..741faf20ca7 |
371 |
--- /dev/null |
372 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch |
373 |
@@ -0,0 +1,41 @@ |
374 |
+diff --git a/README.md b/README.md |
375 |
+index a834965..7fea026 100644 |
376 |
+--- a/README.md |
377 |
++++ b/README.md |
378 |
+@@ -8,12 +8,6 @@ Developer preview Version 2 of the new |
379 |
+ |
380 |
+ |
381 |
+ ## GETTING REPO |
382 |
+- |
383 |
+-Repo is a git wrapper that manages a collection of git repositories. Install this tool and add it to the command search PATH: |
384 |
+- |
385 |
+- curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo |
386 |
+- chmod a+x ~/bin/repo |
387 |
+- |
388 |
+ ## GETTING THE SOURCE CODE |
389 |
+ |
390 |
+ Main OpenCLâ„¢ Compatible Components: |
391 |
+@@ -26,11 +20,6 @@ Main OpenCLâ„¢ Compatible Components: |
392 |
+ * https://github.com/RadeonOpenCompute/lld |
393 |
+ * https://github.com/KhronosGroup/OpenCL-ICD-Loader |
394 |
+ |
395 |
+-Download the git projects with the following commands: |
396 |
+- |
397 |
+- ~/bin/repo init -u https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git -b master -m opencl.xml |
398 |
+- ~/bin/repo sync |
399 |
+- |
400 |
+ ## INSTALL ROCm |
401 |
+ |
402 |
+ Follow the instructions at https://rocm.github.io/install.html to install ROCm. |
403 |
+@@ -45,6 +34,11 @@ Copy the amdocl64.icd file to /etc/OpenCL/vendors |
404 |
+ |
405 |
+ To install additional dependencies: |
406 |
+ |
407 |
++* ROCm-OpenCL-Runtime |
408 |
++* ROCm-OpenCL-Driver |
409 |
++* ROC versions of LLVM, Clang, and lld |
410 |
++* ROCm-Device-Libs |
411 |
++* OpenCL-ICD-Loade |
412 |
+ * OCaml |
413 |
+ * findlib |
414 |
+ * A Python 2 environment or active virtualenv with the Microsoft Z3 package |
415 |
|
416 |
diff --git a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild |
417 |
new file mode 100644 |
418 |
index 00000000000..b576f463c54 |
419 |
--- /dev/null |
420 |
+++ b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild |
421 |
@@ -0,0 +1,57 @@ |
422 |
+# Copyright 1999-2019 Gentoo Authors |
423 |
+# Distributed under the terms of the GNU General Public License v2 |
424 |
+ |
425 |
+EAPI=7 |
426 |
+ |
427 |
+inherit cmake-utils |
428 |
+ |
429 |
+OPENCL_ICD_COMMIT="6c03f8b58fafd9dd693eaac826749a5cfad515f8" |
430 |
+SRC_URI="https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${OPENCL_ICD_COMMIT}.tar.gz -> OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}.tar.gz" |
431 |
+if [[ ${PV} == *9999 ]] ; then |
432 |
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/" |
433 |
+ inherit git-r3 |
434 |
+else |
435 |
+ SRC_URI+=" https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/roc-${PV}.tar.gz -> ${P}.tar.gz" |
436 |
+ KEYWORDS="~amd64" |
437 |
+ S="${WORKDIR}/ROCm-OpenCL-Runtime-roc-${PV}" |
438 |
+fi |
439 |
+ |
440 |
+DESCRIPTION="Radeon Open Compute OpenCL Compatible Runtime" |
441 |
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime" |
442 |
+ |
443 |
+LICENSE="Apache-2.0 MIT" |
444 |
+SLOT="0/$(ver_cut 1-2)" |
445 |
+ |
446 |
+RDEPEND=">=dev-libs/rocr-runtime-${PV} |
447 |
+ >=dev-libs/rocm-comgr-${PV} |
448 |
+ >=dev-libs/rocm-device-libs-${PV} |
449 |
+ >=dev-libs/rocm-opencl-driver-${PV} |
450 |
+ dev-libs/ocl-icd[khronos-headers]" |
451 |
+DEPEND="${RDEPEND} |
452 |
+ dev-lang/ocaml |
453 |
+ dev-ml/findlib" |
454 |
+ |
455 |
+PATCHES=( |
456 |
+ "${FILESDIR}/${P}-change-install-location.patch" |
457 |
+ "${FILESDIR}/${P}-change-AMDCompilerh.patch" |
458 |
+ "${FILESDIR}/${P}-change-opencl.patch" |
459 |
+ "${FILESDIR}/${P}-update-README.patch" |
460 |
+ "${FILESDIR}/${P}-amdocl64icd.patch" |
461 |
+) |
462 |
+ |
463 |
+src_prepare() { |
464 |
+ mkdir -p "${S}"/api/opencl/khronos/ || die |
465 |
+ mv "${WORKDIR}/OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}" "${S}"/api/opencl/khronos/icd || die |
466 |
+ [ -d tools/clinfo ] && rm -rf tools/clinfo || die |
467 |
+ cmake-utils_src_prepare |
468 |
+} |
469 |
+ |
470 |
+src_configure() { |
471 |
+ local mycmakeargs=( |
472 |
+ -DUSE_COMGR_LIBRARY=yes |
473 |
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/" |
474 |
+ -DClang_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/clang/" |
475 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/" |
476 |
+ ) |
477 |
+ cmake-utils_src_configure |
478 |
+} |