1 |
commit: a7db6f594b175eebbf00de4ad8af0280198eae72 |
2 |
Author: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 6 23:58:10 2022 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 7 01:56:43 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7db6f59 |
7 |
|
8 |
dev-cpp/abseil-cpp: Fix build with CUDA nvcc |
9 |
|
10 |
Minor patch needed for tensorflow to unbundle abseil. |
11 |
Acked by gyakovlev on IRC. |
12 |
|
13 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
14 |
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org> |
15 |
|
16 |
dev-cpp/abseil-cpp/abseil-cpp-20211102.0-r1.ebuild | 72 ++++++++++++++++++++++ |
17 |
...abseil-cpp-20211102.0-fix-cuda-nvcc-build.patch | 58 +++++++++++++++++ |
18 |
2 files changed, 130 insertions(+) |
19 |
|
20 |
diff --git a/dev-cpp/abseil-cpp/abseil-cpp-20211102.0-r1.ebuild b/dev-cpp/abseil-cpp/abseil-cpp-20211102.0-r1.ebuild |
21 |
new file mode 100644 |
22 |
index 000000000000..9873c85b8ee8 |
23 |
--- /dev/null |
24 |
+++ b/dev-cpp/abseil-cpp/abseil-cpp-20211102.0-r1.ebuild |
25 |
@@ -0,0 +1,72 @@ |
26 |
+# Copyright 2020-2022 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+ |
29 |
+EAPI=7 |
30 |
+ |
31 |
+PYTHON_COMPAT=( python3_{7..10} ) |
32 |
+ |
33 |
+inherit cmake python-any-r1 |
34 |
+ |
35 |
+# yes, it needs SOURCE, not just installed one |
36 |
+# and no, 1.11.0 is not enough |
37 |
+GTEST_COMMIT="1b18723e874b256c1e39378c6774a90701d70f7a" |
38 |
+GTEST_FILE="gtest-${GTEST_COMMIT}.tar.gz" |
39 |
+ |
40 |
+DESCRIPTION="Abseil Common Libraries (C++), LTS Branch" |
41 |
+HOMEPAGE="https://abseil.io" |
42 |
+SRC_URI="https://github.com/abseil/abseil-cpp/archive/${PV}.tar.gz -> ${P}.tar.gz |
43 |
+ test? ( https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE} )" |
44 |
+ |
45 |
+LICENSE=" |
46 |
+ Apache-2.0 |
47 |
+ test? ( BSD ) |
48 |
+" |
49 |
+SLOT="0/${PV%%.*}" |
50 |
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" |
51 |
+IUSE="test" |
52 |
+ |
53 |
+DEPEND="" |
54 |
+RDEPEND="${DEPEND}" |
55 |
+ |
56 |
+BDEPEND=" |
57 |
+ ${PYTHON_DEPS} |
58 |
+ test? ( sys-libs/timezone-data ) |
59 |
+" |
60 |
+ |
61 |
+RESTRICT="!test? ( test )" |
62 |
+ |
63 |
+PATCHES=( |
64 |
+ "${FILESDIR}/${PN}-20211102.0-fix-cuda-nvcc-build.patch" |
65 |
+) |
66 |
+ |
67 |
+src_prepare() { |
68 |
+ cmake_src_prepare |
69 |
+ |
70 |
+ # un-hardcode abseil compiler flags |
71 |
+ sed -i \ |
72 |
+ -e '/"-maes",/d' \ |
73 |
+ -e '/"-msse4.1",/d' \ |
74 |
+ -e '/"-mfpu=neon"/d' \ |
75 |
+ -e '/"-march=armv8-a+crypto"/d' \ |
76 |
+ absl/copts/copts.py || die |
77 |
+ |
78 |
+ # now generate cmake files |
79 |
+ python_fix_shebang absl/copts/generate_copts.py |
80 |
+ absl/copts/generate_copts.py || die |
81 |
+ |
82 |
+ if use test; then |
83 |
+ sed -i 's/-Werror//g' \ |
84 |
+ "${WORKDIR}/googletest-${GTEST_COMMIT}"/googletest/cmake/internal_utils.cmake || die |
85 |
+ fi |
86 |
+} |
87 |
+ |
88 |
+src_configure() { |
89 |
+ local mycmakeargs=( |
90 |
+ -DABSL_ENABLE_INSTALL=TRUE |
91 |
+ -DABSL_LOCAL_GOOGLETEST_DIR="${WORKDIR}/googletest-${GTEST_COMMIT}" |
92 |
+ -DCMAKE_CXX_STANDARD=17 |
93 |
+ -DABSL_PROPAGATE_CXX_STD=TRUE |
94 |
+ $(usex test -DBUILD_TESTING=ON '') #intentional usex |
95 |
+ ) |
96 |
+ cmake_src_configure |
97 |
+} |
98 |
|
99 |
diff --git a/dev-cpp/abseil-cpp/files/abseil-cpp-20211102.0-fix-cuda-nvcc-build.patch b/dev-cpp/abseil-cpp/files/abseil-cpp-20211102.0-fix-cuda-nvcc-build.patch |
100 |
new file mode 100644 |
101 |
index 000000000000..45a9fc5406e8 |
102 |
--- /dev/null |
103 |
+++ b/dev-cpp/abseil-cpp/files/abseil-cpp-20211102.0-fix-cuda-nvcc-build.patch |
104 |
@@ -0,0 +1,58 @@ |
105 |
+Fixes compile failure with CUDA nvcc |
106 |
+https://github.com/abseil/abseil-cpp/commit/5202173ca7671ebe241cb4d9447dc4b1f2d3ec10 |
107 |
+https://github.com/tensorflow/tensorflow/commit/e45ca6adf2458d4759e5c40f1f27bbf9505a3c79#diff-b79a9a542260a33fd122a5d1cdb923e08e16cbe321d69c014a9acdde34052b3dR235 |
108 |
+ |
109 |
+From 5202173ca7671ebe241cb4d9447dc4b1f2d3ec10 Mon Sep 17 00:00:00 2001 |
110 |
+From: Abseil Team <absl-team@××××××.com> |
111 |
+Date: Tue, 1 Feb 2022 13:52:49 -0800 |
112 |
+Subject: [PATCH] Export of internal Abseil changes |
113 |
+ |
114 |
+-- |
115 |
+121db1a08321eaa3006726cc32b459cf17880e35 by Derek Mauro <dmauro@××××××.com>: |
116 |
+ |
117 |
+Internal change |
118 |
+ |
119 |
+PiperOrigin-RevId: 425707805 |
120 |
+ |
121 |
+-- |
122 |
+0dec484389bbb75aae0a412146e3564bf833a739 by Derek Mauro <dmauro@××××××.com>: |
123 |
+ |
124 |
+macOS CI: Avoid depending on external sites like GitHub by prepopulating |
125 |
+dependencies and setting --distdir |
126 |
+ |
127 |
+Our Linux CI does this, but for some reason was never enabled on macOS |
128 |
+ |
129 |
+PiperOrigin-RevId: 425668638 |
130 |
+GitOrigin-RevId: 121db1a08321eaa3006726cc32b459cf17880e35 |
131 |
+Change-Id: Id51645df90b6a0808dd5b18eb636a10f798e24ea |
132 |
+--- |
133 |
+ absl/container/internal/inlined_vector.h | 8 ++++---- |
134 |
+ ci/macos_xcode_bazel.sh | 10 +++++++++- |
135 |
+ 2 files changed, 13 insertions(+), 5 deletions(-) |
136 |
+ |
137 |
+diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h |
138 |
+index cd34a413a..2baf26f3e 100644 |
139 |
+--- a/absl/container/internal/inlined_vector.h |
140 |
++++ b/absl/container/internal/inlined_vector.h |
141 |
+@@ -925,8 +925,8 @@ auto Storage<T, N, A>::Swap(Storage* other_storage_ptr) -> void { |
142 |
+ inlined_ptr->GetSize()); |
143 |
+ } |
144 |
+ ABSL_INTERNAL_CATCH_ANY { |
145 |
+- allocated_ptr->SetAllocation( |
146 |
+- {allocated_storage_view.data, allocated_storage_view.capacity}); |
147 |
++ allocated_ptr->SetAllocation(Allocation<A>{ |
148 |
++ allocated_storage_view.data, allocated_storage_view.capacity}); |
149 |
+ ABSL_INTERNAL_RETHROW; |
150 |
+ } |
151 |
+ |
152 |
+@@ -934,8 +934,8 @@ auto Storage<T, N, A>::Swap(Storage* other_storage_ptr) -> void { |
153 |
+ inlined_ptr->GetInlinedData(), |
154 |
+ inlined_ptr->GetSize()); |
155 |
+ |
156 |
+- inlined_ptr->SetAllocation( |
157 |
+- {allocated_storage_view.data, allocated_storage_view.capacity}); |
158 |
++ inlined_ptr->SetAllocation(Allocation<A>{allocated_storage_view.data, |
159 |
++ allocated_storage_view.capacity}); |
160 |
+ } |
161 |
+ |
162 |
+ swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated()); |