Skip to content

Conversation

@eddelbuettel
Copy link
Contributor

This one is more borderline, and @rcurtin already provided sage advice ... but without it the damn build is very very noisy.

I would understand if you said 'cannot pick a version' and close this.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a default OpenCL version macro to reduce build warnings/noise from the OpenCL library. However, the chosen version (3.0) is higher than the package's documented minimum requirement.

  • Sets CL_TARGET_OPENCL_VERSION=300 (OpenCL 3.0) in build configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## It includes GPU backend configuration (OpenCL, CUDA) and other settings

PKG_CPPFLAGS = -I../inst/include
PKG_CPPFLAGS = -I../inst/include -DCL_TARGET_OPENCL_VERSION=300
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OpenCL version is set to 300 (OpenCL 3.0), which is higher than the package's documented minimum requirement of OpenCL 1.2 (stated in both DESCRIPTION and README.md). This could break compatibility with systems that have OpenCL versions 1.2-2.2 installed.

The value should be set to 120 to match the minimum requirement:

PKG_CPPFLAGS = -I../inst/include -DCL_TARGET_OPENCL_VERSION=120

Note: In OpenCL versioning, the macro value format is: major * 100 + minor * 10, so 120 = OpenCL 1.2, 300 = OpenCL 3.0.

Suggested change
PKG_CPPFLAGS = -I../inst/include -DCL_TARGET_OPENCL_VERSION=300
PKG_CPPFLAGS = -I../inst/include -DCL_TARGET_OPENCL_VERSION=120

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddelbuettel we need to target v1.2 since the version of OpenCL supported on macOS is 1.2 (November 14, 2012!!!) due to Apple deprecating it in favor of Metal.

https://developer.apple.com/opencl/

If needed, I'm happy to move toward newer headers released by khronos.org/registry/OpenCL/

https://formulae.brew.sh/formula/opencl-headers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a peace offering? If we are on that special OS identifying after a long-dead biologist we use 120 else we default to 300? Would that be viable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants