1 |
commit: a2a65086a7c75f96b501b601006a6712d64ad04c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 30 11:16:43 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 30 18:14:00 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2a65086 |
7 |
|
8 |
sys-libs/libomp: Bump live to 14* |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libomp/libomp-14.0.0.9999.ebuild | 106 ++++++++++++++++++++++++++++++ |
13 |
1 file changed, 106 insertions(+) |
14 |
|
15 |
diff --git a/sys-libs/libomp/libomp-14.0.0.9999.ebuild b/sys-libs/libomp/libomp-14.0.0.9999.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..5adaa0dfbca |
18 |
--- /dev/null |
19 |
+++ b/sys-libs/libomp/libomp-14.0.0.9999.ebuild |
20 |
@@ -0,0 +1,106 @@ |
21 |
+# Copyright 1999-2021 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=7 |
25 |
+ |
26 |
+CMAKE_ECLASS=cmake |
27 |
+PYTHON_COMPAT=( python3_{8..10} ) |
28 |
+inherit cmake-multilib linux-info llvm.org python-any-r1 |
29 |
+ |
30 |
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" |
31 |
+HOMEPAGE="https://openmp.llvm.org" |
32 |
+ |
33 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
34 |
+SLOT="0" |
35 |
+KEYWORDS="" |
36 |
+IUSE="cuda hwloc kernel_linux offload ompt test" |
37 |
+# CUDA works only with the x86_64 ABI |
38 |
+REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )" |
39 |
+RESTRICT="!test? ( test )" |
40 |
+ |
41 |
+RDEPEND=" |
42 |
+ hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] ) |
43 |
+ offload? ( |
44 |
+ virtual/libelf:=[${MULTILIB_USEDEP}] |
45 |
+ dev-libs/libffi:=[${MULTILIB_USEDEP}] |
46 |
+ cuda? ( dev-util/nvidia-cuda-toolkit:= ) |
47 |
+ )" |
48 |
+# tests: |
49 |
+# - dev-python/lit provides the test runner |
50 |
+# - sys-devel/llvm provide test utils (e.g. FileCheck) |
51 |
+# - sys-devel/clang provides the compiler to run tests |
52 |
+DEPEND="${RDEPEND}" |
53 |
+BDEPEND="dev-lang/perl |
54 |
+ offload? ( virtual/pkgconfig ) |
55 |
+ test? ( |
56 |
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
57 |
+ >=sys-devel/clang-6 |
58 |
+ )" |
59 |
+ |
60 |
+LLVM_COMPONENTS=( openmp llvm/include ) |
61 |
+llvm.org_set_globals |
62 |
+ |
63 |
+python_check_deps() { |
64 |
+ has_version "dev-python/lit[${PYTHON_USEDEP}]" |
65 |
+} |
66 |
+ |
67 |
+kernel_pds_check() { |
68 |
+ if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then |
69 |
+ local CONFIG_CHECK="~!SCHED_PDS" |
70 |
+ local ERROR_SCHED_PDS="\ |
71 |
+PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11 |
72 |
+< 4.14-pf9) do not implement sched_yield() call which may result in horrible |
73 |
+performance problems with libomp. If you are using one of the specified |
74 |
+kernel versions, you may want to disable the PDS scheduler." |
75 |
+ |
76 |
+ check_extra_config |
77 |
+ fi |
78 |
+} |
79 |
+ |
80 |
+pkg_pretend() { |
81 |
+ kernel_pds_check |
82 |
+} |
83 |
+ |
84 |
+pkg_setup() { |
85 |
+ use test && python-any-r1_pkg_setup |
86 |
+} |
87 |
+ |
88 |
+multilib_src_configure() { |
89 |
+ local libdir="$(get_libdir)" |
90 |
+ local mycmakeargs=( |
91 |
+ -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" |
92 |
+ |
93 |
+ -DLIBOMP_USE_HWLOC=$(usex hwloc) |
94 |
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt) |
95 |
+ |
96 |
+ -DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload) |
97 |
+ |
98 |
+ # do not install libgomp.so & libiomp5.so aliases |
99 |
+ -DLIBOMP_INSTALL_ALIASES=OFF |
100 |
+ # disable unnecessary hack copying stuff back to srcdir |
101 |
+ -DLIBOMP_COPY_EXPORTS=OFF |
102 |
+ ) |
103 |
+ use offload && mycmakeargs+=( |
104 |
+ # this is non-fatal and libomp checks for CUDA conditionally |
105 |
+ # to ABI, so we can just ignore passing the wrong value |
106 |
+ # on non-amd64 ABIs |
107 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
108 |
+ ) |
109 |
+ use test && mycmakeargs+=( |
110 |
+ # this project does not use standard LLVM cmake macros |
111 |
+ -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" |
112 |
+ -DOPENMP_LIT_ARGS="$(get_lit_flags)" |
113 |
+ |
114 |
+ -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" |
115 |
+ -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" |
116 |
+ ) |
117 |
+ addpredict /dev/nvidiactl |
118 |
+ cmake_src_configure |
119 |
+} |
120 |
+ |
121 |
+multilib_src_test() { |
122 |
+ # respect TMPDIR! |
123 |
+ local -x LIT_PRESERVES_TMP=1 |
124 |
+ |
125 |
+ cmake_build check-libomp |
126 |
+} |