Gentoo Archives: gentoo-commits

From: Christoph Junghans <ottxor@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/fftw/
Date: Mon, 01 Aug 2016 20:41:18
Message-Id: 1470084028.b280a257d28f038d034b690c645e6d9e363db88e.ottxor@gentoo
1 commit: b280a257d28f038d034b690c645e6d9e363db88e
2 Author: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 1 20:40:28 2016 +0000
4 Commit: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 1 20:40:28 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b280a257
7
8 sci-libs/fftw: live ebuild update
9
10 Package-Manager: portage-2.2.28
11
12 sci-libs/fftw/fftw-9999.ebuild | 194 +++++++++++++++++++++--------------------
13 1 file changed, 98 insertions(+), 96 deletions(-)
14
15 diff --git a/sci-libs/fftw/fftw-9999.ebuild b/sci-libs/fftw/fftw-9999.ebuild
16 index ec07ce4..bb09666 100644
17 --- a/sci-libs/fftw/fftw-9999.ebuild
18 +++ b/sci-libs/fftw/fftw-9999.ebuild
19 @@ -2,46 +2,43 @@
20 # Distributed under the terms of the GNU General Public License v2
21 # $Id$
22
23 -EAPI=5
24 +EAPI=6
25
26 FORTRAN_NEEDED=fortran
27
28 -inherit autotools-multilib eutils flag-o-matic fortran-2 multibuild toolchain-funcs versionator
29 +inherit flag-o-matic fortran-2 toolchain-funcs versionator multibuild multilib-minimal
30
31 DESCRIPTION="Fast C library for the Discrete Fourier Transform"
32 HOMEPAGE="http://www.fftw.org/"
33
34 if [[ ${PV} = *9999 ]]; then
35 - inherit git-r3
36 + inherit autotools git-r3
37 EGIT_REPO_URI="https://github.com/FFTW/fftw3.git"
38 - KEYWORDS=""
39 - AUTOTOOLS_AUTORECONF=1
40 else
41 SRC_URI="http://www.fftw.org/${P}.tar.gz"
42 - KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
43 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
44 fi
45
46 -LICENSE="GPL-2"
47 +LICENSE="GPL-2+"
48 SLOT="3.0/3"
49 -IUSE="altivec cpu_flags_x86_avx doc cpu_flags_x86_fma3 cpu_flags_x86_fma4 fortran mpi neon openmp quad cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs test threads zbus"
50 +IUSE="altivec cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_fma3 cpu_flags_x86_fma4 cpu_flags_x86_sse cpu_flags_x86_sse2 doc fortran mpi openmp quad static-libs test threads zbus"
51
52 -RDEPEND="mpi? ( virtual/mpi )"
53 +RDEPEND="
54 + mpi? ( virtual/mpi )"
55 DEPEND="${RDEPEND}
56 test? ( dev-lang/perl )"
57
58 -#can go once mpi is multlib
59 -MULTILIB_WRAPPED_HEADERS=(
60 - /usr/include/fftw3-mpi.h
61 - /usr/include/fftw3l-mpi.f03
62 - /usr/include/fftw3-mpi.f03
63 - /usr/include/fftw3q.f03
64 -)
65 -
66 pkg_setup() {
67 if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
68 - if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
69 - ewarn "OpenMP is not available in your current selected gcc"
70 - die "need openmp capable gcc"
71 + if ! tc-has-openmp; then
72 + ewarn "OpenMP is not available in your current selected compiler"
73 +
74 + if tc-is-clang; then
75 + ewarn "OpenMP support in sys-devel/clang is provided by sys-libs/libomp,"
76 + ewarn "which you will need to build ${CATEGORY}/${PN} with USE=\"openmp\""
77 + fi
78 +
79 + die "need openmp capable compiler"
80 fi
81 FORTRAN_NEED_OPENMP=1
82 fi
83 @@ -50,7 +47,7 @@ pkg_setup() {
84
85 MULTIBUILD_VARIANTS=( single double longdouble )
86 if use quad; then
87 - if [[ $(tc-getCC) == *gcc ]] && ! version_is_at_least 4.6 $(gcc-version); then
88 + if tc-is-gcc && ! version_is_at_least 4.6 $(gcc-version); then
89 ewarn "quad precision only available for gcc >= 4.6"
90 die "need quad precision capable gcc"
91 fi
92 @@ -59,123 +56,128 @@ pkg_setup() {
93 }
94
95 src_prepare() {
96 + default
97 +
98 # fix info file for category directory
99 - [[ ${PV} = *9999 ]] || sed -i \
100 - -e 's/Texinfo documentation system/Libraries/' \
101 - doc/fftw3."info" || die "failed to fix info file"
102 + if [[ ${PV} = *9999 ]]; then
103 + sed -i -e
104 + 's/Texinfo documentation system/Libraries/' \
105 + doc/fftw3."info" || die "failed to fix info file"
106
107 - autotools-utils_src_prepare
108 + eautoreconf
109 + fi
110 }
111
112 -src_configure() {
113 - local x
114 -
115 - # filter -Os according to docs
116 - replace-flags -Os -O2
117 -
118 - my_configure() {
119 - #a bit hacky improve after #483758 is solved
120 - local x=${BUILD_DIR%-${ABI}}
121 - x=${x##*-}
122 - # there is no abi_x86_32 port of virtual/mpi right now
123 - local enable_mpi=$(use_enable mpi)
124 - multilib_is_native_abi || enable_mpi="--disable-mpi"
125 -
126 - #jlec reported USE=quad on abi_x86_32 has too less registers
127 - #stub Makefiles
128 - if use amd64 && ! multilib_is_native_abi && [[ $x = quad ]]; then
129 - mkdir -p "${BUILD_DIR}/tests" || die
130 - echo "all: ;" > "${BUILD_DIR}/Makefile" || die
131 - echo "install: ;" >> "${BUILD_DIR}/Makefile" || die
132 - echo "smallcheck: ;" > "${BUILD_DIR}/tests/Makefile" || die
133 - return 0
134 - fi
135 +multilib_src_configure() {
136 + # there is no abi_x86_32 port of virtual/mpi right now, bug 519700
137 + local enable_mpi=$(multilib_native_use_enable mpi)
138 +
139 + # jlec reported USE=quad on abi_x86_32 has too few registers
140 + # stub Makefiles
141 + if [[ ${MULTILIB_ABI_FLAG} == abi_x86_32 && ${MULTIBUILD_ID} == quad-* ]]; then
142 + mkdir -p "${BUILD_DIR}/tests" || die
143 + echo "all: ;" > "${BUILD_DIR}/Makefile" || die
144 + echo "install: ;" >> "${BUILD_DIR}/Makefile" || die
145 + echo "smallcheck: ;" > "${BUILD_DIR}/tests/Makefile" || die
146 + return 0
147 + fi
148
149 - myeconfargs=(
150 - $(use_enable "cpu_flags_x86_fma$(usex cpu_flags_x86_fma3 3 4)" fma)
151 - $(use_enable fortran)
152 - $(use_enable zbus mips-zbus-timer)
153 - $(use_enable threads)
154 - $(use_enable openmp)
155 - )
156 - if [[ $x == single ]]; then
157 + local myconf=(
158 + $(use_enable "cpu_flags_x86_fma$(usex cpu_flags_x86_fma3 3 4)" fma)
159 + $(use_enable fortran)
160 + $(use_enable zbus mips-zbus-timer)
161 + $(use_enable threads)
162 + $(use_enable openmp)
163 + )
164 + case "${MULTIBUILD_ID}" in
165 + single-*)
166 #altivec, sse, single-paired only work for single
167 - myeconfargs+=(
168 + myconf+=(
169 --enable-single
170 $(use_enable altivec)
171 $(use_enable cpu_flags_x86_avx avx)
172 + $(use_enable cpu_flags_x86_avx2 avx2)
173 $(use_enable cpu_flags_x86_sse sse)
174 + $(use_enable cpu_flags_x86_sse2 sse2)
175 ${enable_mpi}
176 - $(use_enable neon)
177 )
178 - elif [[ $x == double ]]; then
179 - myeconfargs+=(
180 + ;;
181 +
182 + double-*)
183 + myconf+=(
184 $(use_enable cpu_flags_x86_avx avx)
185 + $(use_enable cpu_flags_x86_avx2 avx2)
186 $(use_enable cpu_flags_x86_sse2 sse2)
187 ${enable_mpi}
188 )
189 - elif [[ $x == longdouble ]]; then
190 - myeconfargs+=(
191 + ;;
192 +
193 + longdouble-*)
194 + myconf+=(
195 --enable-long-double
196 ${enable_mpi}
197 - )
198 - elif [[ $x == quad ]]; then
199 + )
200 + ;;
201 +
202 + quad-*)
203 #quad does not support mpi
204 - myeconfargs+=( --enable-quad-precision )
205 - else
206 - die "${x} precision not implemented in this ebuild"
207 - fi
208 + myconf+=(
209 + --enable-quad-precision
210 + )
211 + ;;
212
213 - autotools-utils_src_configure
214 - }
215 + *)
216 + die "${MULTIBUILD_ID%-*} precision not implemented in this ebuild"
217 + ;;
218 + esac
219
220 - multibuild_foreach_variant multilib_parallel_foreach_abi my_configure
221 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
222 +}
223 +
224 +src_configure() {
225 + multibuild_foreach_variant multilib-minimal_src_configure
226 }
227
228 src_compile() {
229 - multibuild_foreach_variant autotools-multilib_src_compile
230 + multibuild_foreach_variant multilib-minimal_src_compile
231 }
232
233 -src_test () {
234 +multilib_src_test() {
235 + emake -C tests smallcheck
236 +}
237 +
238 +src_test() {
239 # We want this to be a reasonably quick test, but that is still hard...
240 ewarn "This test series will take 30 minutes on a modern 2.5Ghz machine"
241 # Do not increase the number of threads, it will not help your performance
242 - #local testbase="perl check.pl --nthreads=1 --estimate"
243 - # ${testbase} -${p}d || die "Failure: $n"
244 - multibuild_foreach_variant autotools-multilib_src_compile -C tests smallcheck
245 + # local testbase="perl check.pl --nthreads=1 --estimate"
246 + # ${testbase} -${p}d || die "Failure: $n"
247 +
248 + multibuild_foreach_variant multilib-minimal_src_test
249 }
250
251 -src_install () {
252 - local u x
253 +src_install() {
254 DOCS=( AUTHORS ChangeLog NEWS README TODO COPYRIGHT CONVENTIONS )
255 HTML_DOCS=( doc/html/ )
256
257 - #copied from autotools-multilib_secure_install
258 - my_abi_src_install() {
259 - autotools-utils_src_install
260 - #https://github.com/FFTW/fftw3/pull/6
261 - # f03 are installed unconditionally, not a big problem as the quad
262 - # header is the only one to be wrapped.
263 - [[ ${BUILD_DIR} = *-quad* ]] || rm -f "${ED}/usr/include/fftw3q.f03"
264 - if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
265 - multilib_prepare_wrappers
266 - multilib_check_headers
267 - fi
268 - }
269 - multibuild_foreach_variant multilib_foreach_abi my_abi_src_install
270 - multilib_install_wrappers
271 + multibuild_foreach_variant multilib-minimal_src_install
272
273 if use doc; then
274 dodoc doc/*.pdf
275 - insinto /usr/share/doc/${PF}/faq
276 - doins -r doc/FAQ/fftw-faq.html/*
277 + docinto faq
278 + dodoc -r doc/FAQ/fftw-faq.html/.
279 else
280 - rm -r "${ED}"/usr/share/doc/${PF}/html
281 + rm -r "${ED}"/usr/share/doc/${PF}/html || die
282 fi
283
284 + local x
285 for x in "${ED}"/usr/lib*/pkgconfig/*.pc; do
286 + local u
287 for u in $(usev mpi) $(usev threads) $(usex openmp omp ""); do
288 - sed -e "s|-lfftw3[flq]\?|&_$u &|" "$x" > "${x%.pc}_$u.pc" || die
289 + sed -e "s|-lfftw3[flq]\?|&_${u} &|" "$x" > "${x%.pc}_${u}.pc" || die
290 done
291 done
292 +
293 + # fftw uses pkg-config to record its private dependencies
294 + find "${ED}" -name '*.la' -delete || die
295 }