commit: 24c13e62e80277379e5d58cedc6a189593159c01 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Thu Jun 5 22:36:36 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Jun 5 22:38:09 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24c13e62
dev-libs/pocl: add 7.0 Thanks to Patrick for the initial patch for wiring up SPIR-V. On top of that: * Drop obsolete configure arg (float-conversion) * Drop USE=hardening (was going to rename to USE=hardened but it enables sanitizers which aren't appropriate for hardened) * Make some progress on tests & unrestrict them, but may need to limit the ones we run (see comments in src_test) * Tweak SPIR-V deps to respect LLVM_SLOT Closes: https://bugs.gentoo.org/956434 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/pocl/Manifest | 1 + dev-libs/pocl/metadata.xml | 1 + dev-libs/pocl/pocl-7.0.ebuild | 143 +++++++++++++++++++++++++++ profiles/arch/powerpc/ppc64/package.use.mask | 4 + 4 files changed, 149 insertions(+) diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest index b203f45d594c..130ed992076e 100644 --- a/dev-libs/pocl/Manifest +++ b/dev-libs/pocl/Manifest @@ -1 +1,2 @@ DIST pocl-6.0.tar.gz 2466652 BLAKE2B e074f35bfe8ccd70038fe05ca01da033849bed83075330f1149597455a5892281d4d09b8db5b4731e7e0c248d1ffdc8e8707c1ebe53d50624294ad92aa886be6 SHA512 a24efadbbb81c810cd5c4bbb8abfa75b9bbdfeca786e8471dd75d40a78024d04c1b5c5a7114e75e1eb70a1b6a3756bb47ba741de0f1c4d1416fbce4688d62cc0 +DIST pocl-7.0.tar.gz 3766036 BLAKE2B 83bf4417fb0e2b00971c570f2df746cc33ee64df5ae64eea5e50066cef0a33fd45e39ff0e9817ac86dfb775b913623b08367e615296f020832b95cd861791d86 SHA512 cbf0da705eef41d3b1c0710b3d19b2f72ab63acd0a16cea2251ddf796e66b13d38fff97a154f618a38333a121db82e497eb17fa4b45c2a50eb8968786fca7b55 diff --git a/dev-libs/pocl/metadata.xml b/dev-libs/pocl/metadata.xml index 385844d354c1..d537cb3431ef 100644 --- a/dev-libs/pocl/metadata.xml +++ b/dev-libs/pocl/metadata.xml @@ -12,6 +12,7 @@ <!--<flag name="hsa">Enable the HSA base profile runtime device driver</flag>--> <flag name="hwloc">Enable hwloc support</flag> <flag name="memmanager">Enables custom memory manager. Except for special circumstances, this should be disabled</flag> + <flag name="spirv">Build SPIR-V support</flag> </use> <upstream> <remote-id type="github">pocl/pocl</remote-id> diff --git a/dev-libs/pocl/pocl-7.0.ebuild b/dev-libs/pocl/pocl-7.0.ebuild new file mode 100644 index 000000000000..ec9d292a840c --- /dev/null +++ b/dev-libs/pocl/pocl-7.0.ebuild @@ -0,0 +1,143 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {18..20} ) +inherit cmake cuda llvm-r1 + +DESCRIPTION="Portable Computing Language (an implementation of OpenCL)" +HOMEPAGE="http://portablecl.org https://github.com/pocl/pocl" +SRC_URI="https://github.com/pocl/pocl/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc64" +# TODO: hsa tce +IUSE="accel +conformance cuda debug examples +hwloc memmanager spirv test" +RESTRICT="!test? ( test )" + +CLANG_DEPS=" + $(llvm_gen_dep ' + !cuda? ( + llvm-core/clang:${LLVM_SLOT}= + llvm-core/llvm:${LLVM_SLOT}= + ) + cuda? ( + llvm-core/clang:${LLVM_SLOT}=[llvm_targets_NVPTX] + llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_NVPTX] + ) + spirv? ( + dev-util/spirv-tools + dev-util/spirv-llvm-translator:${LLVM_SLOT}= + ) + ') +" +RDEPEND=" + ${CLANG_DEPS} + dev-libs/libltdl + dev-util/opencl-headers + virtual/opencl + debug? ( dev-util/lttng-ust:= ) + cuda? ( dev-util/nvidia-cuda-toolkit:= ) + hwloc? ( sys-apps/hwloc:=[cuda?] ) +" + +DEPEND="${RDEPEND}" +BDEPEND=" + ${CLANG_DEPS} + virtual/pkgconfig +" + +src_prepare() { + use cuda && cuda_src_prepare + cmake_src_prepare +} + +src_configure() { + local host_cpu_variants="generic" + + if use amd64 ; then + # Use pocl's curated list of CPU variants which should contain a good match for any given amd64 CPU + host_cpu_variants="distro" + elif use ppc64 ; then + # A selection of architectures in which new Altivec / VSX features were added + # This attempts to recreate the amd64 "distro" option for ppc64 + # See discussion in bug #831859 + host_cpu_variants="pwr10;pwr9;pwr8;pwr7;pwr6;g5;a2;generic" + elif use riscv; then + host_cpu_variants="generic-rv64" + fi + + local mycmakeargs=( + -DENABLE_HSA=OFF + + -DENABLE_ICD=ON + -DPOCL_ICD_ABSOLUTE_PATH=ON + -DPOCL_INSTALL_PUBLIC_LIBDIR="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/pocl" + + # only appends -flto + -DENABLE_IPO=OFF + + -DENABLE_POCL_BUILDING=ON + -DKERNELLIB_HOST_CPU_VARIANTS="${host_cpu_variants}" + + -DENABLE_LLVM=ON + -DSTATIC_LLVM=OFF + -DWITH_LLVM_CONFIG=$(get_llvm_prefix -d)/bin/llvm-config + + -DENABLE_ALMAIF_DEVICE=$(usex accel) + -DENABLE_CONFORMANCE=$(usex conformance) + -DENABLE_CUDA=$(usex cuda) + -DENABLE_HWLOC=$(usex hwloc) + # Adds sanitizers(!) which aren't suitable for production + -DHARDENING_ENABLE=OFF + -DPOCL_DEBUG_MESSAGES=$(usex debug) + -DUSE_POCL_MEMMANAGER=$(usex memmanager) + -DENABLE_EXAMPLES=$(usex examples) + -DENABLE_TESTS=$(usex test) + -DENABLE_SPIRV=$(usex spirv) + ) + + cmake_src_configure +} + +src_test() { + local -x POCL_BUILDING=1 + local -x POCL_DEVICES=basic + local -x CTEST_OUTPUT_ON_FAILURE=1 + local -x TEST_VERBOSE=1 + + local CMAKE_SKIP_TESTS=( + # These tests hang (or are very slow) + regression/infinite_loop_cbs + regression/passing_a_constant_array_as_an_arg_loopvec + regression/infinite_loop_loopvec + regression/passing_a_constant_array_as_an_arg_cbs + + # Failures + kernel/test_halfs_loopvec + kernel/test_halfs_cbs + kernel/test_printf_vectors_halfn_loopvec + kernel/test_printf_vectors_halfn_cbs + workgroup/conditional_barrier_dynamic + workgroup/ballot_loopvec + workgroup/ballot_cbs + regression/test_rematerialized_alloca_load_with_outside_pr_users + ) + + # https://github.com/pocl/pocl/blob/main/.github/workflows/build_linux.yml#L148 + # There are various CTest labels available, we may want to run just + # a subset of those rather than having a large set where we're chasing + # random failures from tinderboxing... + cmake_src_test +} + +src_install() { + cmake_src_install + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${P}/examples + fi +} diff --git a/profiles/arch/powerpc/ppc64/package.use.mask b/profiles/arch/powerpc/ppc64/package.use.mask index 77304afe5ac9..347894735862 100644 --- a/profiles/arch/powerpc/ppc64/package.use.mask +++ b/profiles/arch/powerpc/ppc64/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Sam James <[email protected]> (2025-06-05) +# dev-util/spirv-llvm-translator not keyworded here +dev-libs/pocl spirv + # Sam James <[email protected]> (2025-05-16) # gpio: dev-libs/libgpiod not keyworded here sys-power/nut gpio
