kumquat-buildroot/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
Valentin Korenblit fddf7a04a5 package/mesa3d: enable OpenCL support
This patch provides Clover, the OpenCL 1.1 API implementation by Mesa
for AMD GPUs. It generates libOpenCL.so.

Add --disable-opencl-icd because in Mesa 18 it defaults to on.  When
disabled, the shared library is named libOpenCL instead of
libMesaOpenCL and CL headers are installed.

Given that clc headers are being installed to a non-standard location,
it is necessary to specify this path in configure.ac. Otherwise,
pkg-config will output the absolute path to these headers located in
STAGING_DIR, which will cause a runtime error when calling
clBuildProgram.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
[Thomas:
 - improve the description of the patch, based on input from Romain
 - register as a libopencl provider]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Valentin Korenblit <a class="moz-txt-link-rfc2396E" href="mailto:valentin.korenblit@smile.fr">&lt;valentin.korenblit@smile.fr&gt;</a>
Signed-off-by: Valentin Korenblit <a class="moz-txt-link-rfc2396E" href="mailto:valentinkorenblit@gmail.com">&lt;valentinkorenblit@gmail.com&gt;</a>
Signed-off-by: Thomas Petazzoni <a class="moz-txt-link-rfc2396E" href="mailto:thomas.petazzoni@bootlin.com">&lt;thomas.petazzoni@bootlin.com&gt;</a>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-12-03 23:07:20 +01:00

38 lines
1.4 KiB
Diff

From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
From: Valentin Korenblit <valentinkorenblit@gmail.com>
Date: Sat, 20 Oct 2018 10:56:23 +0200
Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
will look for OpenCL "headers" on the target, when building the OpenCL
kernels.
The value returned by pkg-config for includedir is relevant when
cross-compiling, on the build machine. But in this specific case, we
really need a value that is valid on the target.
Those headers are installed by the libclc package in /usr/share so
that they are not removed by Buildroot target-finalize logic.
Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 864dcae..cc2390b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2429,7 +2429,7 @@ if test "x$enable_opencl" = xyes; then
PKG_CONFIG_PATH environment variable.
By default libclc.pc is installed to /usr/local/share/pkgconfig/])
else
- LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
+ LIBCLC_INCLUDEDIR="/usr/share"
LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
AC_SUBST([LIBCLC_INCLUDEDIR])
AC_SUBST([LIBCLC_LIBEXECDIR])
--
2.7.4