summaryrefslogtreecommitdiff
path: root/dev-libs/pocl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-25 20:21:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-25 20:21:45 +0100
commitc719fdcee603a5a706a45d10cb598762d56a727d (patch)
tree620cbf137661399a3fb1eff92914204f9a970713 /dev-libs/pocl
parentcc4618c9ba3d974948ebf340b542d8cb01db2f55 (diff)
gentoo resync : 25.09.2021
Diffstat (limited to 'dev-libs/pocl')
-rw-r--r--dev-libs/pocl/Manifest4
-rw-r--r--dev-libs/pocl/files/vendor_opencl_libs_location.patch20
-rw-r--r--dev-libs/pocl/metadata.xml21
-rw-r--r--dev-libs/pocl/pocl-1.7-r2.ebuild120
4 files changed, 165 insertions, 0 deletions
diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest
new file mode 100644
index 000000000000..408e746b4f44
--- /dev/null
+++ b/dev-libs/pocl/Manifest
@@ -0,0 +1,4 @@
+AUX vendor_opencl_libs_location.patch 962 BLAKE2B 6d0e3f070fa2022d95d35fb1563f72f5dc1b544c7f83417dbb5e3d100dad07bdf3365a48ee92e856de4edc4b7c25674b45efd6d0ace1ac559273641ca175a269 SHA512 2ae144e7590049cc1eac8fa30e360cd511331abba0dfe683867d6a089742ea12cc3bc48dafe41a1c1c9b891fdf35aaac8b14cc1e10a78d2ab49b5e14635bb258
+DIST pocl-1.7.tar.gz 1577676 BLAKE2B 50d4f50236b1c81f319b5559ca2b1df529209f07899acf51c487820d97cc6766c5130a55afca910517c7db63d8041ac8306062880c3a821cbc1bf9108bf13d65 SHA512 23bb82b25a222186c001b2ed413f26253e1e0e16518e98c95173f51491e15d107e6ab1b334ffd490b41199743267d9ad64882a22fea327e17ec9604f9847fc38
+EBUILD pocl-1.7-r2.ebuild 2862 BLAKE2B 23f201f50ac726297c8bfdc3408c3f1741989f78d8dfdccf566759fa3fd362127c28f524f6752f0f2fe882aeb431352af1f0fbc891a297c26fd66edfd44f04d4 SHA512 e7587d0f337b12e22e408b30f55b2a5ca887697529a1be5f734edf2ff37ea10c671002b7ef6e17569cd7deacfa8d37a097ff3b86f8538b47fab7f25446483d34
+MISC metadata.xml 1199 BLAKE2B 90d31048bcc33a76837977547ba818b2d2a268c408e7ad40eb157864d7c561d0bbc8ad40a013e28c74092f27f7fc3d23ae52322a2ca2d681c109ace154e29214 SHA512 98341aa0795cf9439ed4c0b8e2575657eaa5898e21b64d7d73592badac0b2a82fe061005a6adcf4e9d3318a4f20b80c62bd379f587dd4fcf993a95017f8ce867
diff --git a/dev-libs/pocl/files/vendor_opencl_libs_location.patch b/dev-libs/pocl/files/vendor_opencl_libs_location.patch
new file mode 100644
index 000000000000..548589ca41bc
--- /dev/null
+++ b/dev-libs/pocl/files/vendor_opencl_libs_location.patch
@@ -0,0 +1,20 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -125,7 +125,7 @@
+ endif()
+
+ # for libpocl.so
+-set(POCL_INSTALL_PUBLIC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "POCL public libdir")
++set(POCL_INSTALL_PUBLIC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/OpenCL/vendors/pocl" CACHE PATH "POCL public libdir")
+
+ # for llvmopencl.so
+ set(POCL_INSTALL_PRIVATE_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pocl" CACHE PATH "POCL private libdir")
+@@ -134,7 +134,7 @@
+ if(UNIX AND NOT CMAKE_CROSSCOMPILING AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(POCL_INSTALL_ICD_VENDORDIR "/etc/OpenCL/vendors" CACHE PATH "POCL ICD file destination")
+ else()
+- set(POCL_INSTALL_ICD_VENDORDIR "${CMAKE_INSTALL_PREFIX}/etc/OpenCL/vendors" CACHE PATH "POCL ICD file destination")
++ set(POCL_INSTALL_ICD_VENDORDIR "${SYSCONFDIR}/etc/OpenCL/vendors" CACHE PATH "POCL ICD file destination")
+ endif()
+
+ # for kernel-<target>.bc
diff --git a/dev-libs/pocl/metadata.xml b/dev-libs/pocl/metadata.xml
new file mode 100644
index 000000000000..1e1a7087abb5
--- /dev/null
+++ b/dev-libs/pocl/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <use>
+ <flag name="accel">Enable the generic hardware accelerator device driver</flag>
+ <flag name="cl20">Enable reporting OpenCL 2.0 for the CPU device</flag>
+ <flag name="conformance">Ensures that certain build options which would result in non-conformant pocl build stay disabled. Note that this does not quarantee a fully conformant build of pocl.</flag>
+ <flag name="cuda">Enable the CUDA backend for NVIDIA GPUs</flag>
+ <flag name="float-conversion">When enabled, OpenCL printf() call's f/e/g formatters are handled by pocl. When disabled, these are handled by system C library.</flag>
+ <flag name="hardening">Enable hardening against various attacks. May worsen performance</flag>
+ <!--<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>
+ </use>
+ <upstream>
+ <remote-id type="github">pocl/pocl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-libs/pocl/pocl-1.7-r2.ebuild b/dev-libs/pocl/pocl-1.7-r2.ebuild
new file mode 100644
index 000000000000..be663cd6f58d
--- /dev/null
+++ b/dev-libs/pocl/pocl-1.7-r2.ebuild
@@ -0,0 +1,120 @@
+# 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 )
+
+inherit cmake llvm python-any-r1 docs
+
+LLVM_MAX_SLOT=12
+
+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"
+IUSE="accel cl20 +conformance cuda debug examples float-conversion hardening +hwloc memmanager test" #hsa tce
+
+RESTRICT="!test? ( test ) mirror"
+
+# 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)
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ docs_compile
+}
+
+src_test() {
+ export POCL_BUILDING=1
+ export CTEST_OUTPUT_ON_FAILURE=1
+ 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
+}