1 |
commit: e9b38e06367dd47eb4500f847f9348013c160268 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 13 01:09:48 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 13 01:12:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9b38e06 |
7 |
|
8 |
dev-libs/pocl: add 1.8 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
dev-libs/pocl/Manifest | 1 + |
13 |
dev-libs/pocl/pocl-1.8.ebuild | 126 ++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 127 insertions(+) |
15 |
|
16 |
diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest |
17 |
index 4ac613d41bb..4f3243ab7a6 100644 |
18 |
--- a/dev-libs/pocl/Manifest |
19 |
+++ b/dev-libs/pocl/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST pocl-1.7.tar.gz 1577676 BLAKE2B 50d4f50236b1c81f319b5559ca2b1df529209f07899acf51c487820d97cc6766c5130a55afca910517c7db63d8041ac8306062880c3a821cbc1bf9108bf13d65 SHA512 23bb82b25a222186c001b2ed413f26253e1e0e16518e98c95173f51491e15d107e6ab1b334ffd490b41199743267d9ad64882a22fea327e17ec9604f9847fc38 |
22 |
+DIST pocl-1.8.tar.gz 1614545 BLAKE2B b0ccc08d1f899719f5def731c61727440035a879ebeebae89dd406423eba6c12b866f34cd47dd0e0f944b7f0c4569c57c44a9a62bf02552de5c4c3b8c9fb3b48 SHA512 bcbb3fa3d2234d4c5b0c17863eba0bc4c8f13f863cc58cfd1de49e21fa7bf0aec82b81aec143c81885e3a39274c8ae783b2f03b9a12846e024204d6ed0e59a9d |
23 |
|
24 |
diff --git a/dev-libs/pocl/pocl-1.8.ebuild b/dev-libs/pocl/pocl-1.8.ebuild |
25 |
new file mode 100644 |
26 |
index 00000000000..6f112bf4913 |
27 |
--- /dev/null |
28 |
+++ b/dev-libs/pocl/pocl-1.8.ebuild |
29 |
@@ -0,0 +1,126 @@ |
30 |
+# Copyright 1999-2021 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=7 |
34 |
+ |
35 |
+DOCS_AUTODOC=0 |
36 |
+DOCS_BUILDER="sphinx" |
37 |
+DOCS_DIR="doc/sphinx/source" |
38 |
+PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
39 |
+LLVM_MAX_SLOT=13 |
40 |
+ |
41 |
+inherit cmake llvm python-any-r1 docs |
42 |
+ |
43 |
+DESCRIPTION="Portable Computing Language (an implementation of OpenCL)" |
44 |
+HOMEPAGE="http://portablecl.org https://github.com/pocl/pocl" |
45 |
+SRC_URI="https://github.com/pocl/pocl/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
46 |
+ |
47 |
+LICENSE="GPL-2" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="~amd64" |
50 |
+# TODO: hsa tce |
51 |
+IUSE="accel cl20 +conformance cuda debug examples float-conversion hardening +hwloc memmanager test" |
52 |
+# Tests not yet passing, fragile in Portage environment(?) |
53 |
+RESTRICT="!test? ( test ) test" |
54 |
+ |
55 |
+# TODO: add dependencies for cuda |
56 |
+# Note: No := on LLVM because it pulls in Clang |
57 |
+# see llvm.eclass for why |
58 |
+CLANG_DEPS="!cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):= ) |
59 |
+ cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_NVPTX] )" |
60 |
+RDEPEND=" |
61 |
+ dev-libs/libltdl |
62 |
+ <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):* |
63 |
+ virtual/opencl |
64 |
+ |
65 |
+ ${CLANG_DEPS} |
66 |
+ debug? ( dev-util/lttng-ust ) |
67 |
+ hwloc? ( sys-apps/hwloc[cuda?] ) |
68 |
+" |
69 |
+DEPEND="${RDEPEND}" |
70 |
+BDEPEND="${CLANG_DEPS} |
71 |
+ virtual/pkgconfig |
72 |
+ doc? ( |
73 |
+ $(python_gen_any_dep '<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]') |
74 |
+ )" |
75 |
+ |
76 |
+PATCHES=( |
77 |
+ "${FILESDIR}/vendor_opencl_libs_location.patch" |
78 |
+) |
79 |
+ |
80 |
+python_check_deps() { |
81 |
+ has_version -b "<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]" |
82 |
+} |
83 |
+ |
84 |
+llvm_check_deps() { |
85 |
+ local usedep=$(usex cuda "[llvm_targets_NVPTX]" '') |
86 |
+ |
87 |
+ # Clang is used at both build time (executed) and runtime |
88 |
+ has_version -r "sys-devel/llvm:${LLVM_SLOT}${usedep}" && \ |
89 |
+ has_version -r "sys-devel/clang:${LLVM_SLOT}${usedep}" && \ |
90 |
+ has_version -b "sys-devel/clang:${LLVM_SLOT}${usedep}" |
91 |
+} |
92 |
+ |
93 |
+pkg_setup() { |
94 |
+ use doc && python-any-r1_pkg_setup |
95 |
+ |
96 |
+ llvm_pkg_setup |
97 |
+} |
98 |
+ |
99 |
+src_configure() { |
100 |
+ local mycmakeargs=( |
101 |
+ -DBUILD_SHARED_LIBS=ON |
102 |
+ -DENABLE_HSA=OFF |
103 |
+ -DENABLE_ICD=ON |
104 |
+ -DENABLE_POCL_BUILDING=ON |
105 |
+ -DKERNELLIB_HOST_CPU_VARIANTS=native |
106 |
+ -DPOCL_ICD_ABSOLUTE_PATH=ON |
107 |
+ -DSTATIC_LLVM=OFF |
108 |
+ -DWITH_LLVM_CONFIG=$(get_llvm_prefix -d "${LLVM_MAX_SLOT}")/bin/llvm-config |
109 |
+ |
110 |
+ -DENABLE_ACCEL_DEVICE=$(usex accel) |
111 |
+ -DENABLE_CONFORMANCE=$(usex conformance) |
112 |
+ -DENABLE_CUDA=$(usex cuda) |
113 |
+ -DENABLE_HOST_CPU_DEVICE_CL20=$(usex cl20) |
114 |
+ -DENABLE_HWLOC=$(usex hwloc) |
115 |
+ -DENABLE_POCL_FLOAT_CONVERSION=$(usex float-conversion) |
116 |
+ -DHARDENING_ENABLE=$(usex hardening) |
117 |
+ -DPOCL_DEBUG_MESSAGES=$(usex debug) |
118 |
+ -DUSE_POCL_MEMMANAGER=$(usex memmanager) |
119 |
+ -DENABLE_TESTS=$(usex test) |
120 |
+ ) |
121 |
+ |
122 |
+ cmake_src_configure |
123 |
+} |
124 |
+ |
125 |
+src_compile() { |
126 |
+ cmake_src_compile |
127 |
+ docs_compile |
128 |
+} |
129 |
+ |
130 |
+src_test() { |
131 |
+ export POCL_BUILDING=1 |
132 |
+ export POCL_DEVICES=basic |
133 |
+ export CTEST_OUTPUT_ON_FAILURE=1 |
134 |
+ export TEST_VERBOSE=1 |
135 |
+ |
136 |
+ # Referenced https://github.com/pocl/pocl/blob/master/.drone.yml |
137 |
+ # But couldn't seem to get tests working yet |
138 |
+ cmake_src_test |
139 |
+} |
140 |
+ |
141 |
+src_install() { |
142 |
+ cmake_src_install |
143 |
+ |
144 |
+ dodoc CREDITS README CHANGES |
145 |
+ |
146 |
+ if use doc; then |
147 |
+ dodoc -r _build/html |
148 |
+ docompress -x /usr/share/doc/${P}/html |
149 |
+ fi |
150 |
+ |
151 |
+ if use examples; then |
152 |
+ dodoc -r examples |
153 |
+ docompress -x /usr/share/doc/${P}/examples |
154 |
+ fi |
155 |
+} |