1 |
commit: 49fe1591b8692a955419f9bd944aa51b5e4f19b4 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 8 10:18:39 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 8 10:34:28 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49fe1591 |
7 |
|
8 |
sys-libs/libomp: Selectively enable deviceRTLs based on CHOST |
9 |
|
10 |
deviceRTLs are only supported on amd64, aarch64 and ppc64le, and trying |
11 |
to build them elsewhere may cause CMake failures. Check CHOST |
12 |
to determine whether to enable them. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/822369 |
15 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
16 |
|
17 |
sys-libs/libomp/libomp-13.0.0-r1.ebuild | 32 +++++++++++++++++-------------- |
18 |
sys-libs/libomp/libomp-13.0.0.9999.ebuild | 32 +++++++++++++++++-------------- |
19 |
sys-libs/libomp/libomp-14.0.0.9999.ebuild | 32 +++++++++++++++++-------------- |
20 |
3 files changed, 54 insertions(+), 42 deletions(-) |
21 |
|
22 |
diff --git a/sys-libs/libomp/libomp-13.0.0-r1.ebuild b/sys-libs/libomp/libomp-13.0.0-r1.ebuild |
23 |
index 9009d8a8295..e7e848f2cb2 100644 |
24 |
--- a/sys-libs/libomp/libomp-13.0.0-r1.ebuild |
25 |
+++ b/sys-libs/libomp/libomp-13.0.0-r1.ebuild |
26 |
@@ -93,20 +93,24 @@ multilib_src_configure() { |
27 |
# disable unnecessary hack copying stuff back to srcdir |
28 |
-DLIBOMP_COPY_EXPORTS=OFF |
29 |
) |
30 |
- use offload && mycmakeargs+=( |
31 |
- # this is non-fatal and libomp checks for CUDA conditionally |
32 |
- # to ABI, so we can just ignore passing the wrong value |
33 |
- # on non-amd64 ABIs |
34 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
35 |
- |
36 |
- -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
37 |
- -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
38 |
- # a cheap hack to force clang |
39 |
- -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
40 |
- # upstream defaults to looking for it in clang dir |
41 |
- # this fails when ccache is being used |
42 |
- -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
43 |
- ) |
44 |
+ if use offload && has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then |
45 |
+ mycmakeargs+=( |
46 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
47 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
48 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
49 |
+ # a cheap hack to force clang |
50 |
+ -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
51 |
+ # upstream defaults to looking for it in clang dir |
52 |
+ # this fails when ccache is being used |
53 |
+ -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
54 |
+ ) |
55 |
+ else |
56 |
+ mycmakeargs+=( |
57 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
58 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF |
59 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=OFF |
60 |
+ ) |
61 |
+ fi |
62 |
use test && mycmakeargs+=( |
63 |
# this project does not use standard LLVM cmake macros |
64 |
-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" |
65 |
|
66 |
diff --git a/sys-libs/libomp/libomp-13.0.0.9999.ebuild b/sys-libs/libomp/libomp-13.0.0.9999.ebuild |
67 |
index 8ff1b93cd2f..28c0f1fb620 100644 |
68 |
--- a/sys-libs/libomp/libomp-13.0.0.9999.ebuild |
69 |
+++ b/sys-libs/libomp/libomp-13.0.0.9999.ebuild |
70 |
@@ -92,20 +92,24 @@ multilib_src_configure() { |
71 |
# disable unnecessary hack copying stuff back to srcdir |
72 |
-DLIBOMP_COPY_EXPORTS=OFF |
73 |
) |
74 |
- use offload && mycmakeargs+=( |
75 |
- # this is non-fatal and libomp checks for CUDA conditionally |
76 |
- # to ABI, so we can just ignore passing the wrong value |
77 |
- # on non-amd64 ABIs |
78 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
79 |
- |
80 |
- -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
81 |
- -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
82 |
- # a cheap hack to force clang |
83 |
- -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
84 |
- # upstream defaults to looking for it in clang dir |
85 |
- # this fails when ccache is being used |
86 |
- -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
87 |
- ) |
88 |
+ if use offload && has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then |
89 |
+ mycmakeargs+=( |
90 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
91 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
92 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
93 |
+ # a cheap hack to force clang |
94 |
+ -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
95 |
+ # upstream defaults to looking for it in clang dir |
96 |
+ # this fails when ccache is being used |
97 |
+ -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
98 |
+ ) |
99 |
+ else |
100 |
+ mycmakeargs+=( |
101 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
102 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF |
103 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=OFF |
104 |
+ ) |
105 |
+ fi |
106 |
use test && mycmakeargs+=( |
107 |
# this project does not use standard LLVM cmake macros |
108 |
-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" |
109 |
|
110 |
diff --git a/sys-libs/libomp/libomp-14.0.0.9999.ebuild b/sys-libs/libomp/libomp-14.0.0.9999.ebuild |
111 |
index 8ff1b93cd2f..28c0f1fb620 100644 |
112 |
--- a/sys-libs/libomp/libomp-14.0.0.9999.ebuild |
113 |
+++ b/sys-libs/libomp/libomp-14.0.0.9999.ebuild |
114 |
@@ -92,20 +92,24 @@ multilib_src_configure() { |
115 |
# disable unnecessary hack copying stuff back to srcdir |
116 |
-DLIBOMP_COPY_EXPORTS=OFF |
117 |
) |
118 |
- use offload && mycmakeargs+=( |
119 |
- # this is non-fatal and libomp checks for CUDA conditionally |
120 |
- # to ABI, so we can just ignore passing the wrong value |
121 |
- # on non-amd64 ABIs |
122 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
123 |
- |
124 |
- -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
125 |
- -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
126 |
- # a cheap hack to force clang |
127 |
- -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
128 |
- # upstream defaults to looking for it in clang dir |
129 |
- # this fails when ccache is being used |
130 |
- -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
131 |
- ) |
132 |
+ if use offload && has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then |
133 |
+ mycmakeargs+=( |
134 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) |
135 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU) |
136 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX) |
137 |
+ # a cheap hack to force clang |
138 |
+ -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")" |
139 |
+ # upstream defaults to looking for it in clang dir |
140 |
+ # this fails when ccache is being used |
141 |
+ -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)" |
142 |
+ ) |
143 |
+ else |
144 |
+ mycmakeargs+=( |
145 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
146 |
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF |
147 |
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=OFF |
148 |
+ ) |
149 |
+ fi |
150 |
use test && mycmakeargs+=( |
151 |
# this project does not use standard LLVM cmake macros |
152 |
-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" |