Bug 271255 - devel/ocl-icd: Broken after devel/opencl update
Summary: devel/ocl-icd: Broken after devel/opencl update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-05 07:41 UTC by Fernando Apesteguía
Modified: 2023-05-07 16:27 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ohartmann)


Attachments
Patch to fix build (1.09 KB, patch)
2023-05-05 07:41 UTC, Fernando Apesteguía
no flags Details | Diff
Patch to pick up correct OpenCL headers from Khronos (2.03 KB, patch)
2023-05-05 16:34 UTC, O. Hartmann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando Apesteguía freebsd_committer freebsd_triage 2023-05-05 07:41:36 UTC
Created attachment 241989 [details]
Patch to fix build

devel/ocl-icd is broken after the update in 0eb6406f6594c96bef9b692cd7e4fa763a653cd7.

ocl_icd_loader.c:895:3: error: expected identifier
   CL_ICDL_OCL_VERSION=1,
   ^
/usr/local/include/CL/cl_ext.h:3181:61: note: expanded from macro
'CL_ICDL_OCL_VERSION'
#define CL_ICDL_OCL_VERSION                                 1
                                                             ^
ocl_icd_loader.c:896:3: error: expected identifier
   CL_ICDL_VERSION=2,
   ^
/usr/local/include/CL/cl_ext.h:3182:61: note: expanded from macro
'CL_ICDL_VERSION'
#define CL_ICDL_VERSION                                     2
                                                             ^
ocl_icd_loader.c:897:3: error: expected identifier
   CL_ICDL_NAME=3,
   ^
/usr/local/include/CL/cl_ext.h:3183:61: note: expanded from macro
'CL_ICDL_NAME'
#define CL_ICDL_NAME                                        3
                                                             ^
ocl_icd_loader.c:898:3: error: expected identifier
   CL_ICDL_VENDOR=4,
   ^
/usr/local/include/CL/cl_ext.h:3184:61: note: expanded from macro
'CL_ICDL_VENDOR'
#define CL_ICDL_VENDOR                                      4
                                                             ^
ocl_icd_loader.c:899:3: error: typedef redefinition with different types
('enum cl_icdl_info' vs 'cl_uint' (aka 'unsigned int'))
} cl_icdl_info;
   ^
/usr/local/include/CL/cl_ext.h:3178:29: note: previous definition is here
typedef cl_uint             cl_icdl_info;
                             ^
ocl_icd_loader.c:901:15: error: static declaration of
'clGetICDLoaderInfoOCLICD' follows non-static declaration
static cl_int clGetICDLoaderInfoOCLICD(
               ^
/usr/local/include/CL/cl_ext.h:3197:1: note: previous declaration is here
clGetICDLoaderInfoOCLICD(
^
6 errors generated.

The attached patch fixes the build in 12.4 {adm64,i386}, {13.1,13.2} amd64 and -current amd64
Comment 1 O. Hartmann 2023-05-05 14:42:31 UTC
I will check on this shortly.
Thank you very much.
Comment 2 O. Hartmann 2023-05-05 16:34:13 UTC
Created attachment 241999 [details]
Patch to pick up correct OpenCL headers from Khronos

ocl-icd comes with a copy of Khrono's OpenCL headers. ocl-icd hasn't been updated since 8/2021, the copy of OpenCL headers is outdated and results in a compile error while compiling the port with most recent OpenCL headers 3.0.14 provided by Khronos.
The patch simply provides withj the correct 

CONFIGURE_ARGS=--enable-official-khronos-headers

to ensure the pickup of devel/opencl headers.

Hopefully this will fix the problem in a more general manner.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-06 13:04:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a8a9e7bbcea77ea4ce13972cf66e323b2a8adb56

commit a8a9e7bbcea77ea4ce13972cf66e323b2a8adb56
Author:     O. Hartmann <ohartmann@walstatt.org>
AuthorDate: 2023-05-05 21:33:44 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-05-06 12:59:23 +0000

    devel/ocl-icd: Fix build after devel/opencl update

    ocl-icd comes with a copy of Khrono's OpenCL headers. ocl-icd hasn't been
    updated since 8/2021, the copy of OpenCL headers is outdated and results in a
    compile error while compiling the port with most recent OpenCL headers 3.0.14
    provided by Khronos.
    The patch simply provides withj the correct

    CONFIGURE_ARGS=--enable-official-khronos-headers

    to ensure the pickup of devel/opencl headers.

    PR:             271255
    Reported by:    leres@
    Fixes:          0eb6406f6594

 devel/ocl-icd/Makefile | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2023-05-06 13:04:55 UTC
Committed,

Thanks!