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
[boost-ublas] Add opencl feature #29325
Conversation
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.
- Changes that affect boost need to touch
scripts/boost/generate-ports.ps1
; the changes here will be overwritten next time that script is called. - The feature needs to actually be hooked up to something. That is:
and
vcpkg install boost-ublas[core] vcpkg install boost-compute
need to give you the same results but it looks like you're saying the latter would causevcpkg install boost-compute vcpkg install boost-ublas[core]
boost-ublas
to do something else.
Probably makes sense to add right below vcpkg/scripts/boost/generate-ports.ps1 Line 136 in 74e940f
|
I've made the suggested change to Also, I don't quite follow the point about getting different results depending on the order of installing |
Should be fixed by #29338 :)
There's no code here to hook the feature selection into boost's build system, so it looks like you're relying on some form of autodetection going on inside b2. That is, it looks like:
Gives you a
would effectively give you |
Cancelled the PR build because the fleet is very behind today and there are merge conflicts with this PR outstanding. |
I've rebased my branch on master (not yet pushed) and now the problem with the if ($dependency.StartsWith("boost")) {
$dependency = @{
"name" = $dependency
"version>=" = MakePortVersionString $dependency
}
} It seems to me that |
Unfortunately you just have to list all of them :( I can help with the generate-ports part but I'm not helpful with the feature binding part; if you could look at that it'd be a more effective way to move this submission forward. |
Pinging @sweemer for response. Is work still being done for this PR? |
HI @FrankXie05 yes I am still planning to work on this, but it is taking longer than I expected to fully understand how the boost build configurations work. If you want then I can close this pull request and open it back up later once I've figured out the solution. |
@sweemer You can convert to draft. :) |
ffddb65
to
6984810
Compare
I've rebased this branch onto master and have removed the draft status.
I still don't fully understand what you're trying to say here. The "opencl feature" is nothing more than just pulling in some more dependencies, thirteen to be precise: $ ./vcpkg depend-info boost-ublas[core] | wc -l
67
$ ./vcpkg depend-info boost-ublas[opencl] | wc -l
80 As far as I am concerned, there's nothing more to it than that. If the user also installs |
That is, in fact, the problem. Whether the feature is on needs to be controlled by whether the feature is on, not based on which dependencies happen to be installed first. If those 13 dependencies happen to be installed first and the feature is off, the feature needs to be off. Otherwise:
and
would give different answers because we aren't rerunning the boost-ublas build because dependencies it did not declare changed. |
Mind the binary caching. The cache key can only consider explicit dependencies. Any dependencies which are picked by accident at build time make the binary artifact unusable because the dependencies won't be installed when the artifact is reused. |
Why isn't that the case now? I'm usually not this dull, I promise, but it seems that I'm missing something basic despite my best efforts to understand how this works.
I wasn't aware that this was possible. How might it happen? At this point I feel like it might be worthwhile for me to take a step back and restate what my original goal is: I don't want |
Everything that is installed before a port is available for consumption by that port, which means any 'optional try to detect what's available' in ports is problematic. If there's a feature to control the behavior, it needs to explicitly control the behavior, not make stuff available and expect the build system to do something reasonable with that. How does boost-ublas control this behavior before this PR?
You need both this change and something that actually connects the feature. That is, if the feature is off, boost-ublas needs to behave as if boost-compute is not installed, even if it actually is installed. |
As far as I can tell,
So to recap, here is the situation for users of the OpenCL functionality before my PR:
The only difference in the behavior of Are you suggesting that when the |
Temporarily converted to draft, waiting for BillyONeal re-review. |
Hi @FrankXie05 why does this PR have to be converted to a draft? I'm still working on it actively and hope it can be merged soon. |
@sweemer |
I have converted back to ready for review, and will await a response from @BillyONeal on the questions above. |
Hi @BillyONeal can you help me move this PR forward by responding to my latest post #29325 (comment)? |
In that case I'm not seeing why this is a feature; it seems like opencl users should be adding the opencl dependency themselves? |
It may not be clear to users which dependencies are required to use opencl with boost-ublas, so I can see value in providing the feature for users. Having said that, removing the feature makes things easier for me, as it reduces my PR to simply removing boost-compute as a dependency, because as mentioned in my original description, this dependency is already broken. Please let me know if you still prefer to remove the feature and I will make the change. Or if you'd rather keep it, then please help merge my changes. |
If the feature doesn't control anything about this port then I don't think it should be a feature of this port. |
c534435
to
536e075
Compare
Ok, fair enough. I have simply removed |
AFAIU the current behaviour of the port is already broken. Users can't control the installation order (unless using an overlay i.e. fixed port). The feature would only fix the case when it is actually use. Without a configuration option in the package, or a patch, the only consistent implementation would be permanent dependencies on the packages which are otherwise picked up randomly. I don't know if this desired. To make it clear: there is no blame on your contribution. The problem is in the upstream package and/or our incomplete understanding how to actively control its dependencies. |
I have rebased my branch on the latest master. @BillyONeal Please help merge as soon as you get a chance. |
Thanks, and sorry for the confusion and delay on my part :) |
./vcpkg x-add-version --all
and committing the result.boost-ublas
has a dependency on clBLAS but this dependency is not reflected in vcpkg.json. Furthermore, the existing dependency onboost-compute
is only required when clBLAS is used. To make this dependency clear, I am adding theopencl
feature, which is off by default to preserve the current behavior.