summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2021-06-30 05:38:27 +0000
committerPatrick Lauer <patrick@gentoo.org>2021-06-30 05:39:44 +0000
commitef8e8e2845f17f827461f86f37c415a02d842f4b (patch)
tree264292e174b38964aa6c7054d161ef67c0019cc0 /dev-libs
parentsys-cluster/charliecloud: Drop old. (diff)
downloadgentoo-ef8e8e2845f17f827461f86f37c415a02d842f4b.tar.gz
gentoo-ef8e8e2845f17f827461f86f37c415a02d842f4b.tar.bz2
gentoo-ef8e8e2845f17f827461f86f37c415a02d842f4b.zip
dev-libs/rocm-opencl-runtime: Fix building with newer opencl-headers
Bug: https://bugs.gentoo.org/789717 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch65
-rw-r--r--dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-4.2.0.ebuild1
2 files changed, 66 insertions, 0 deletions
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch
new file mode 100644
index 000000000000..14191adb5d0c
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch
@@ -0,0 +1,65 @@
+See bug #789717.
+
+Once opencl-headers is upgraded to 3.0 or higher this package starts
+complaining left and right about missing header definitions for
+CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR. The correct header for this
+definiton did move as of opencl-headers 3.0 so this makes some sense.
+(Actually I suspect there is a header-guard mismatch behind this problem).
+
+Most of this can be fixed by using -isystem instead of -I for the opencl
+headers. Although not terribly well documented, -isystem in lieu of -I
+comports with best practices for overriding 3rd-party header files in
+system include directories according to the gcc info pages. Why and how
+are apparently undocumented and appear to be somewhere inside the gcc
+fixincludes rabbit-hole.
+
+This still leaves a similar issue compiling the amdocl files which
+is addressed here with an extra #include.
+
+-gmt
+
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/CMakeLists.txt ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/CMakeLists.txt
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/CMakeLists.txt 2021-06-26 14:52:32.446875129 -0700
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/CMakeLists.txt 2021-06-26 15:00:30.401582470 -0700
+@@ -19,10 +19,10 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
+ add_definitions(-DDEBUG)
+ endif()
+
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/..)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/..)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos/headers)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2)
+ include_directories(/usr/include/rocclr)
+ include_directories(/usr/include/rocclr/compiler/lib/include/)
+ include_directories(/usr/include/rocclr/elf/)
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/khronos/icd/CMakeLists.txt ROCm-OpenCL-Runtime-rocm-4.1.0/khronos/icd/CMakeLists.txt
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/khronos/icd/CMakeLists.txt 2021-06-26 14:52:32.445875109 -0700
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/khronos/icd/CMakeLists.txt 2021-06-26 14:59:01.600778554 -0700
+@@ -121,10 +121,10 @@ else()
+ endif ()
+ endif ()
+
+-include_directories (${OPENCL_ICD_LOADER_HEADERS_DIR})
++include_directories (SYSTEM ${OPENCL_ICD_LOADER_HEADERS_DIR})
+ add_definitions (-DCL_TARGET_OPENCL_VERSION=220)
+
+-target_include_directories (OpenCL PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader)
++target_include_directories (OpenCL SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader)
+ target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
+
+ include (CTest)
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/cl_common.hpp ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/cl_common.hpp 2021-02-02 10:01:38.000000000 -0800
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp 2021-06-26 15:40:57.584449532 -0700
+@@ -21,6 +21,7 @@
+ #ifndef CL_COMMON_HPP_
+ #define CL_COMMON_HPP_
+
++#include <CL/cl_gl_ext.h>
+ #ifdef _WIN32
+ #include <CL/cl_d3d11.h>
+ #include <CL/cl_d3d10.h>
diff --git a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-4.2.0.ebuild b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-4.2.0.ebuild
index d3a5d3f5ef89..45d99cb43091 100644
--- a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-4.2.0.ebuild
+++ b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-4.2.0.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
"${FILESDIR}/${PN}-3.5.0-do-not-install-libopencl.patch"
"${FILESDIR}/${PN}-3.10.0-add-rocclr-include-directories.patch"
"${FILESDIR}/${PN}-3.7.0-amdocl64icd.patch"
+ "${FILESDIR}/${P}-opencl3-header.patch"
)
src_prepare() {