-
Notifications
You must be signed in to change notification settings - Fork 165
Added OpenCL.pc file. #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bashbaug
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a pkgconfig expert so please bear with my (probably basic) questions.
Should we also have a dependency on a similar OpenCL headers package?
|
|
||
| Name: OpenCL | ||
| Description: Khronos OpenCL ICD Loader | ||
| Version: 3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming: It's OK if this version number is different than our SOVERSION?
If so, this is another place that would be great to automate with #182!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming: It's OK if this version number is different than our SOVERSION?
This mimics what ocl-icd does here: https://github.com/OCL-dev/ocl-icd/blob/master/OpenCL.pc.in where @OPENCL_VERSION@ is currently evaluated to 3.0
If so, this is another place that would be great to automate with #182!
Indeed
My knowledge is very basic as well.
Excellent question. Here, the .pc file is for both library and headers assuming both are installed using the same prefix. This is the same in I assume we could split it in two, one for the headers and one for the library and make the latter one depend on the former. I'll try experimenting with this. |
|
Probably a good idea to get input from @MathiasMagnus before we go too far. I'm not sure if it makes sense to have multiple pkgconfig files for each of the OpenCL components, or a single pkgconfig file for the OpenCL SDK, or both. |
Indeed. I tested and split the .pc file between the Headers and Loader, and it worked as expected. I made a PR for the Header as well should we want to take this route: KhronosGroup/OpenCL-Headers#213 |
Co-authored-by: Markus Mützel <[email protected]>
|
I have less experience with pkg-config (because I mostly use Windows), but I do understand some users would appreciate this. My only input here is that whatever type of consumption we envision using I would feel comfortable approving once CI is in place for this. We can do so without it and say it's a "best effort" basis, but that may invite lots of issues from people wanting to use it in territories which we could otherwise cover in CI. |
|
A test in CI could maybe look similar to something like this: It might also be worth to check what those commands return. But that might depend a lot on the platform, install prefix, ... |
MathiasMagnus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would've aimed at tests which don't just run a regular expression on the output of pkg-config, but actually try to compile something with them. The same pkgconfig.c source file can be used for that which we have both here and in the OpenCL-Headers repo. pkg-config also exists on Windows, albeit nobody uses it, so the lack of support for that shouldn't be a dealbreaker. We may want to open an issue so we don't lose sight of that feature missing.
Otherwise I wouldn't want to block this, as it's already useful to some, and we do have deployment tests for the .pc files so at least that won't be broken by mistake, and the c
I do just want to point out that Meson, which is typically used for Linux projects, does also have pretty decent Windows support, and does use pkg-config as one of its core dependency lookup methods. So, yeah we do actually use pkg-config on Windows for a few dependencies, specifically libclc from LLVM, and SPIRV-Tools. That said, I don't have a stake in whether this project supports it on Windows or not. |
|
@MathiasMagnus, @jenatali thanks for the feedback. As I see it we have 3 remaining questions:
|
|
Sure, I can help test it. |
7b522eb to
edd5223
Compare
|
@MathiasMagnus any idea of what could be wrong with the cmake minimum? I don't see anything in the documentation that implies a change in the variables I am using. |
|
@Kerilk Take a look at this PR to your branch. I believe it should solve the issue. Mind you, I went ahead and tested in a container where I cloned the Headers working branch of pkg-config support. I don't know if merging all the components into the OpenCL pkg-config (including the include dir, which is set to |
This reverts commit 72f8e04.
Fix CI thanks to @MathiasMagnus.
|
I haven't followed the detail of the discussion here, but see If this isn't sufficient for OpenCL, then I would ask why that is:
|
|
@StuartDBrady Thanks for the insights. I have reached out to the Debian OpenCL maintainer mailing list:
I think in this case the difference comes from two aspects:
Other libraries have usually a single source for headers and libraries, or ship their own headers with their implementation (see MPI). If we wanted to take this route, then the headers should become a sub-module of the loader and always be installed side by side. This is not the choice we have currently made, and even not how distributions handle OpenCL headers and loaders as headers are shared between loaders (see https://packages.debian.org/stretch/opencl-dev for how it used to be done in debian, only ocl-icd remains nowadays) |
|
Merging as discussed in the OpenCL teleconferences. This will give time for testing before the next release. |
This adds pkg-config support to the OpenCL ICD Loader package.
This fixes #187