diff options
author | 2021-10-13 02:09:48 +0100 | |
---|---|---|
committer | 2021-10-13 02:12:39 +0100 | |
commit | e9b38e06367dd47eb4500f847f9348013c160268 (patch) | |
tree | 7b33738ad035fc6f18cdd3ce09664f9d2815873a /dev-libs/pocl | |
parent | net-irc/quassel: add spell support without full kde (diff) | |
download | gentoo-e9b38e06367dd47eb4500f847f9348013c160268.tar.gz gentoo-e9b38e06367dd47eb4500f847f9348013c160268.tar.bz2 gentoo-e9b38e06367dd47eb4500f847f9348013c160268.zip |
dev-libs/pocl: add 1.8
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/pocl')
-rw-r--r-- | dev-libs/pocl/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/pocl/pocl-1.8.ebuild | 126 |
2 files changed, 127 insertions, 0 deletions
diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest index 4ac613d41bba..4f3243ab7a6f 100644 --- a/dev-libs/pocl/Manifest +++ b/dev-libs/pocl/Manifest @@ -1 +1,2 @@ DIST pocl-1.7.tar.gz 1577676 BLAKE2B 50d4f50236b1c81f319b5559ca2b1df529209f07899acf51c487820d97cc6766c5130a55afca910517c7db63d8041ac8306062880c3a821cbc1bf9108bf13d65 SHA512 23bb82b25a222186c001b2ed413f26253e1e0e16518e98c95173f51491e15d107e6ab1b334ffd490b41199743267d9ad64882a22fea327e17ec9604f9847fc38 +DIST pocl-1.8.tar.gz 1614545 BLAKE2B b0ccc08d1f899719f5def731c61727440035a879ebeebae89dd406423eba6c12b866f34cd47dd0e0f944b7f0c4569c57c44a9a62bf02552de5c4c3b8c9fb3b48 SHA512 bcbb3fa3d2234d4c5b0c17863eba0bc4c8f13f863cc58cfd1de49e21fa7bf0aec82b81aec143c81885e3a39274c8ae783b2f03b9a12846e024204d6ed0e59a9d diff --git a/dev-libs/pocl/pocl-1.8.ebuild b/dev-libs/pocl/pocl-1.8.ebuild new file mode 100644 index 000000000000..6f112bf49132 --- /dev/null +++ b/dev-libs/pocl/pocl-1.8.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DOCS_AUTODOC=0 +DOCS_BUILDER="sphinx" +DOCS_DIR="doc/sphinx/source" +PYTHON_COMPAT=( python3_{8..10} pypy3 ) +LLVM_MAX_SLOT=13 + +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" +# TODO: hsa tce +IUSE="accel cl20 +conformance cuda debug examples float-conversion hardening +hwloc memmanager 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}]') + )" + +PATCHES=( + "${FILESDIR}/vendor_opencl_libs_location.patch" +) + +python_check_deps() { + has_version -b "<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 mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + -DENABLE_HSA=OFF + -DENABLE_ICD=ON + -DENABLE_POCL_BUILDING=ON + -DKERNELLIB_HOST_CPU_VARIANTS=native + -DPOCL_ICD_ABSOLUTE_PATH=ON + -DSTATIC_LLVM=OFF + -DWITH_LLVM_CONFIG=$(get_llvm_prefix -d "${LLVM_MAX_SLOT}")/bin/llvm-config + + -DENABLE_ACCEL_DEVICE=$(usex accel) + -DENABLE_CONFORMANCE=$(usex conformance) + -DENABLE_CUDA=$(usex cuda) + -DENABLE_HOST_CPU_DEVICE_CL20=$(usex cl20) + -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 + + dodoc CREDITS README CHANGES + + 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 +} |