Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831859 - dev-libs/pocl keywording request for ppc64
Summary: dev-libs/pocl keywording request for ppc64
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Keywording (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sam James
URL:
Whiteboard:
Keywords: KEYWORDREQ, PATCH
Depends on:
Blocks:
 
Reported: 2022-01-23 07:37 UTC by Chris Kerr
Modified: 2022-06-17 00:04 UTC (History)
1 user (show)

See Also:
Package list:
dev-libs/pocl ppc64 virtual/opencl ^ dev-libs/ocl-icd ^ dev-libs/opencl-icd-loader ^ dev-util/opencl-headers ^
Runtime testing required: ---
nattka: sanity-check+


Attachments
Patch for pocl ebuild to make flag conditional on ARCH=amd64 (pocl-ppc64.patch,1.02 KB, patch)
2022-01-23 07:39 UTC, Chris Kerr
no flags Details | Diff
New patch using CPU_FLAGS_PPC (pocl-ppc64.patch,2.00 KB, patch)
2022-01-29 09:22 UTC, Chris Kerr
no flags Details | Diff
Alternative patch choosing a generic set of host_cpu_variants (pocl-ppc64.patch,1.38 KB, patch)
2022-05-27 15:18 UTC, Chris Kerr
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kerr 2022-01-23 07:37:50 UTC
pocl builds and runs OK on POWER9 if I patch the ebuild file to remove the X86-only "-DKERNELLIB_HOST_CPU_VARIANTS=distro" CMake flag.

See http://portablecl.org/docs/html/install.html#cmake-other-options-features

Reproducible: Always
Comment 1 Chris Kerr 2022-01-23 07:39:23 UTC
Created attachment 763306 [details, diff]
Patch for pocl ebuild to make flag conditional on ARCH=amd64
Comment 2 Chris Kerr 2022-01-23 07:41:21 UTC
The elog message in virtual/opencl should also possibly be altered to mention dev-libs/pocl as an alternative OpenCL implementation.
Comment 3 Chris Kerr 2022-01-23 07:46:14 UTC
It also might be worth reconsidering whether "-DKERNELLIB_HOST_CPU_VARIANTS=distro" is needed on amd64 - according to the documentation, this option is supposed to be used when building packages for binary distros that should work on a wide range of CPUs.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-26 19:35:18 UTC
(In reply to Chris Kerr from comment #3)
> It also might be worth reconsidering whether
> "-DKERNELLIB_HOST_CPU_VARIANTS=distro" is needed on amd64 - according to the
> documentation, this option is supposed to be used when building packages for
> binary distros that should work on a wide range of CPUs.

The problem is, as mentioned in https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-libs/pocl?id=c127713269a116c187d54663e0523b9f79f11886 / bug 829128, baking in assumptions about the host (other than through *FLAGS) is a pain for binpkgs.
Comment 5 Chris Kerr 2022-01-27 16:12:51 UTC
(In reply to Sam James from comment #4)
> The problem is, as mentioned in
> https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-libs/
> pocl?id=c127713269a116c187d54663e0523b9f79f11886 / bug 829128, baking in
> assumptions about the host (other than through *FLAGS) is a pain for binpkgs.

Good point. Is there a USE flag or other setting that would be appropriate here, to mark the resulting build as not suitable for redistribution?

Another option would be to hand-pick a list of architectures for the LLC_HOST_CPU_VARIANTS on ppc64 to replace the "distro" option on amd64, since there are not so many variants out there anyway. What matters for pocl is the vector extensions so we would only need "generic,pwr7,pwr8,pwr9" matching to altivec,vsx1,vsx2,vsx3 (if my quick glance at Wikipedia is correct).
Comment 6 Chris Kerr 2022-01-27 16:23:10 UTC
I just remembered about CPU_FLAGS_PPC - would it be OK to determine the CPU variants based on that?
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-28 01:42:10 UTC
(In reply to Chris Kerr from comment #6)
> I just remembered about CPU_FLAGS_PPC - would it be OK to determine the CPU
> variants based on that?

Yes, that'd be great.

Any chance I could tempt you into cooking up a patch? (ideally for amd64 too)
Comment 8 Chris Kerr 2022-01-29 09:22:49 UTC
Created attachment 763875 [details, diff]
New patch using CPU_FLAGS_PPC

Here is a new attempt using CPU_FLAGS_PPC to set the HOST_CPU_VARIANTS configuration setting. It looks rather ugly though, and compiling extra variants doesn't take very long, so maybe a static selection would make more sense.
Comment 9 Chris Kerr 2022-05-27 15:18:30 UTC
Created attachment 781085 [details, diff]
Alternative patch choosing a generic set of host_cpu_variants

The extra compile time and disk space required to use a larger set of host_cpu_variants is negligible, so it is probably better to compile all of them unconditionally rather than using the CPU_FLAGS_PPC variable to select the applicable ones.