diff options
Diffstat (limited to 'dev-libs/pocl')
-rw-r--r-- | dev-libs/pocl/Manifest | 2 | ||||
-rw-r--r-- | dev-libs/pocl/pocl-3.1.ebuild | 136 |
2 files changed, 138 insertions, 0 deletions
diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest index f9b8cac79d06..6fd7a30771f1 100644 --- a/dev-libs/pocl/Manifest +++ b/dev-libs/pocl/Manifest @@ -2,5 +2,7 @@ AUX pocl-3.0-cuda.patch 1611 BLAKE2B 6baaac79d0182ac91210c0be40239f7d955b57cb2ae AUX pocl-3.0-fix-version.patch 354 BLAKE2B 8e2b4570c204dc37bb70f20b01838f0c21a6aec57c258a206eb5e82bed69fe01d65f704cfd184c102102fd3a06eb75fb092a2ccfa4d8729192451fa894afc7e9 SHA512 bfe023132ab8080c8539a783586f9c556e7ae4cb8113c3c96b33ac02bd7d4044b36bf13e1556e181af9c12acb4b0e0778af25fd66df1fe6e7ab533c2b68108c4 AUX pocl-3.0-icd.patch 5679 BLAKE2B 4f9edba1e71afb8c059da8f1adcb59f0ccca1bb33ad0c05eb2d3b27c1e7ea6bfa3a2d60f6e6c83136146275aed35a6501713883dad72011379e0ed4ae64eba74 SHA512 436b7f6e53372f00a8c70bb00229d22d05f24687ba2822f4b26590cbdffe64e8c2909d2f1ab6e0650fe18db7507c6bba9f5bcee1a09ec1fe5b42955ddcb99db7 DIST pocl-3.0.tar.gz 1722809 BLAKE2B 095d3d1dca3fa7ebdf61e6e34bf444755dd6842c4f16e0f80895337e96508056465d332309d38ee4db6d6b0031e1dfce350485750e59bfe0dea5951eba5fd3e4 SHA512 dc02bdf259792edb5cb3c80cde5c5261e1e21219b4b31420a3b537abbca1bc478ce0ca0dfc622727088b67d580217d47566309de7c6114a24553de4496a209ea +DIST pocl-3.1.tar.gz 1928607 BLAKE2B 7044a96e361426408fabd973987a0d6956693e3c9095769ee94d7dac47a8841d7489933e94acd22451a1c8a2ca83cb8e6948aebe899b23a8a6080ef1b7b37e9c SHA512 40d17e81d715f6897aa1d97fd02834d45227d9d0bd4c70e76d727f9ad4df675c25b7158a862e20e63810182fdad82a3cb1e454668c3a6422a977e59c8325fa0c EBUILD pocl-3.0.ebuild 3696 BLAKE2B 352e60e2beb92a82af44eaf517afd6595b2e2049ba45b23fdcd2fe3ccd0945339a51c5c120ed699b20ac46120fff625bba7ac22e44f1039688278cf971be9eae SHA512 d6b6bc402ae1c5f87062b2aa36fb933ace430d6f87d0a33458cd2b7d444460b6ba0f9c601c047934ce1cb6163c4be9bd33a76e3011a018c9e0a2c67b5a92b149 +EBUILD pocl-3.1.ebuild 3556 BLAKE2B 7e905180cf23ea7f97183338656204cc3a3eb90072e5dfb03a7001e73a9752c38f13fe143fecdd91ea33e040dc97c8786c8133ceb65015a62d48020a1689eb82 SHA512 4b71408754a00c444942d279161ae45d4f04b3c23764dbe063c6cc8cf5a24bfaf8b750fe7b8a75939e170868640b56cf91be4000bf461476cd24bbfc48f7b851 MISC metadata.xml 1191 BLAKE2B 62b985abe8c99532cc20302846fe9e05c77bbc993ef38863d44bd754df2bc388e5d094917ad11d1b117e9dfda355e35f5592fc2ede5a3bc8e91939c9e6aef9e3 SHA512 a9cdbff5f2b2e2141c6299137baed08d1e8482f3b976ef494b595f58092761aab66f33e539d236d8b7f1c564d5fa2aac4855447b54bc189f1dd81faf25fc32ec diff --git a/dev-libs/pocl/pocl-3.1.ebuild b/dev-libs/pocl/pocl-3.1.ebuild new file mode 100644 index 000000000000..b850953e2668 --- /dev/null +++ b/dev-libs/pocl/pocl-3.1.ebuild @@ -0,0 +1,136 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DOCS_AUTODOC=0 +DOCS_BUILDER="sphinx" +DOCS_DIR="doc/sphinx/source" +PYTHON_COMPAT=( python3_{8..10} pypy3 ) +LLVM_MAX_SLOT=15 + +inherit cmake llvm python-any-r1 docs + +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 float-conversion hardening +hwloc memmanager lto test" +# Tests not yet passing, fragile in Portage environment(?) +RESTRICT="!test? ( test ) test" + +# TODO: add dependencies for cuda +# Note: No := on LLVM because it pulls in Clang +# see llvm.eclass for why +CLANG_DEPS="!cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):= ) + cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_NVPTX] )" +RDEPEND=" + dev-libs/libltdl + <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):* + virtual/opencl + + ${CLANG_DEPS} + debug? ( dev-util/lttng-ust:= ) + hwloc? ( sys-apps/hwloc:=[cuda?] ) +" +DEPEND="${RDEPEND}" +BDEPEND="${CLANG_DEPS} + virtual/pkgconfig + doc? ( + $(python_gen_any_dep '<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]') + )" + +python_check_deps() { + python_has_version "<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]" +} + +llvm_check_deps() { + local usedep=$(usex cuda "[llvm_targets_NVPTX]" '') + + # Clang is used at both build time (executed) and runtime + has_version -r "sys-devel/llvm:${LLVM_SLOT}${usedep}" && \ + has_version -r "sys-devel/clang:${LLVM_SLOT}${usedep}" && \ + has_version -b "sys-devel/clang:${LLVM_SLOT}${usedep}" +} + +pkg_setup() { + use doc && python-any-r1_pkg_setup + + llvm_pkg_setup +} + +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" + 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" + + -DENABLE_IPO=$(usex lto) + + -DENABLE_POCL_BUILDING=ON + -DKERNELLIB_HOST_CPU_VARIANTS="${host_cpu_variants}" + + -DSTATIC_LLVM=OFF + -DWITH_LLVM_CONFIG=$(get_llvm_prefix -d "${LLVM_MAX_SLOT}")/bin/llvm-config + + -DENABLE_ALMAIF_DEVICE=$(usex accel) + -DENABLE_CONFORMANCE=$(usex conformance) + -DENABLE_CUDA=$(usex cuda) + -DENABLE_HWLOC=$(usex hwloc) + -DENABLE_POCL_FLOAT_CONVERSION=$(usex float-conversion) + -DHARDENING_ENABLE=$(usex hardening) + -DPOCL_DEBUG_MESSAGES=$(usex debug) + -DUSE_POCL_MEMMANAGER=$(usex memmanager) + -DENABLE_TESTS=$(usex test) + ) + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + docs_compile +} + +src_test() { + export POCL_BUILDING=1 + export POCL_DEVICES=basic + export CTEST_OUTPUT_ON_FAILURE=1 + export TEST_VERBOSE=1 + + # Referenced https://github.com/pocl/pocl/blob/master/.drone.yml + # But couldn't seem to get tests working yet + cmake_src_test +} + +src_install() { + cmake_src_install + + if use doc; then + dodoc -r _build/html + docompress -x /usr/share/doc/${P}/html + fi + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${P}/examples + fi +} |