Gentoo Archives: gentoo-commits

From: Christoph Junghans <ottxor@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/fftw/files/, sci-libs/fftw/
Date: Sun, 01 Sep 2013 18:08:34
Message-Id: 1378058894.26069113fdc938df674f1aa53393cc0b3841a02f.ottxor@gentoo
1 commit: 26069113fdc938df674f1aa53393cc0b3841a02f
2 Author: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 1 18:08:14 2013 +0000
4 Commit: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 1 18:08:14 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=26069113
7
8 import from gx86
9
10 Package-Manager: portage-2.2.1
11
12 ---
13 sci-libs/fftw/ChangeLog | 10 ++
14 sci-libs/fftw/fftw-3.3.3-r3.ebuild | 197 +++++++++++++++++++++
15 sci-libs/fftw/fftw-9999.ebuild | 197 +++++++++++++++++++++
16 .../fftw/files/fftw-3.3.3-install-header.patch | 35 ++++
17 sci-libs/fftw/metadata.xml | 23 +++
18 5 files changed, 462 insertions(+)
19
20 diff --git a/sci-libs/fftw/ChangeLog b/sci-libs/fftw/ChangeLog
21 new file mode 100644
22 index 0000000..d82a81d
23 --- /dev/null
24 +++ b/sci-libs/fftw/ChangeLog
25 @@ -0,0 +1,10 @@
26 +# ChangeLog for sci-libs/fftw
27 +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 +# $Header: $
29 +
30 +*fftw-3.3.3-r3 (01 Sep 2013)
31 +*fftw-9999 (01 Sep 2013)
32 +
33 + 01 Sep 2013; Christoph Junghans <ottxor@g.o> +fftw-3.3.3-r3.ebuild,
34 + +fftw-9999.ebuild, +files/fftw-3.3.3-install-header.patch, +metadata.xml:
35 + import from gx86
36
37 diff --git a/sci-libs/fftw/fftw-3.3.3-r3.ebuild b/sci-libs/fftw/fftw-3.3.3-r3.ebuild
38 new file mode 100644
39 index 0000000..9af7694
40 --- /dev/null
41 +++ b/sci-libs/fftw/fftw-3.3.3-r3.ebuild
42 @@ -0,0 +1,197 @@
43 +# Copyright 1999-2013 Gentoo Foundation
44 +# Distributed under the terms of the GNU General Public License v2
45 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-3.3.3-r2.ebuild,v 1.3 2013/06/27 14:30:29 aballier Exp $
46 +
47 +EAPI=5
48 +
49 +#AUTOTOOLS_AUTORECONF=1
50 +FORTRAN_NEEDED=fortran
51 +
52 +inherit autotools-multilib eutils flag-o-matic fortran-2 multibuild toolchain-funcs versionator
53 +
54 +DESCRIPTION="Fast C library for the Discrete Fourier Transform"
55 +HOMEPAGE="http://www.fftw.org/"
56 +
57 +if [[ ${PV} = *9999 ]]; then
58 + inherit git-2
59 + EGIT_REPO_URI="https://github.com/FFTW/fftw3.git"
60 + KEYWORDS=""
61 + AUTOTOOLS_AUTORECONF=1
62 +else
63 + SRC_URI="http://www.fftw.org/${P}.tar.gz"
64 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
65 + PATCHES=( "${FILESDIR}/${P}-install-header.patch" )
66 + AUTOTOOLS_AUTORECONF=1
67 +fi
68 +
69 +LICENSE="GPL-2"
70 +SLOT="3.0"
71 +IUSE="altivec avx doc fma fortran mpi neon openmp quad sse sse2 static-libs test threads zbus"
72 +
73 +RDEPEND="
74 + mpi? ( virtual/mpi )
75 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r2
76 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
77 +DEPEND="${RDEPEND}
78 + test? ( dev-lang/perl )"
79 +
80 +#can go once mpi is multlib
81 +MULTILIB_WRAPPED_HEADERS=(
82 + /usr/include/fftw3-mpi.h
83 + /usr/include/fftw3l-mpi.f03
84 + /usr/include/fftw3-mpi.f03
85 + /usr/include/fftw3q.f03
86 +)
87 +
88 +pkg_setup() {
89 + # XXX: this looks like it should be used with BUILD_TYPE!=binary
90 +
91 + if use openmp; then
92 + if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
93 + ewarn "OpenMP is not available in your current selected gcc"
94 + die "need openmp capable gcc"
95 + fi
96 + FORTRAN_NEED_OPENMP=1
97 + fi
98 +
99 + fortran-2_pkg_setup
100 +
101 + MULTIBUILD_VARIANTS=( single double longdouble )
102 + if use quad; then
103 + if [[ $(tc-getCC) == *gcc ]] && ! version_is_at_least 4.6 $(gcc-version); then
104 + ewarn "quad precision only available for gcc >= 4.6"
105 + die "need quad precision capable gcc"
106 + fi
107 + MULTIBUILD_VARIANTS+=( quad )
108 + fi
109 +}
110 +
111 +src_prepare() {
112 + local ext="info"
113 + [[ ${PV} = *9999 ]] && ext="texi"
114 + # fix info file for category directory
115 + sed -i \
116 + -e 's/Texinfo documentation system/Libraries/' \
117 + doc/fftw3."${ext}" || die "failed to fix info file"
118 +
119 + autotools-utils_src_prepare
120 +}
121 +
122 +src_configure() {
123 + local x
124 +
125 + # filter -Os according to docs
126 + replace-flags -Os -O2
127 +
128 + my_configure() {
129 + local x=${FFTW_PRECISION}
130 + # there is no abi_x86_32 port of virtual/mpi right now
131 + local enable_mpi=$(use_enable mpi)
132 + multilib_is_native_abi || enable_mpi="--disable-mpi"
133 +
134 + #jlec reported USE=quad on abi_x86_32 has too less registers
135 + multilib_is_native_abi || [[ $x != quad ]] || return 0
136 +
137 + myeconfargs=(
138 + $(use_enable fma)
139 + $(use_enable fortran)
140 + $(use_enable zbus mips-zbus-timer)
141 + $(use_enable threads)
142 + $(use_enable openmp)
143 + )
144 + if [[ $x == single ]]; then
145 + #altivec, sse, single-paired only work for single
146 + myeconfargs+=(
147 + --enable-single
148 + $(use_enable altivec)
149 + $(use_enable avx)
150 + $(use_enable sse)
151 + ${enable_mpi}
152 + $(use_enable neon)
153 + )
154 + elif [[ $x == double ]]; then
155 + myeconfargs+=(
156 + $(use_enable avx)
157 + $(use_enable sse2)
158 + ${enable_mpi}
159 + )
160 + elif [[ $x == longdouble ]]; then
161 + myeconfargs+=(
162 + --enable-long-double
163 + ${enable_mpi}
164 + )
165 + elif [[ $x == quad ]]; then
166 + #quad does not support mpi
167 + myeconfargs+=( --enable-quad-precision )
168 + else
169 + die "${x} precision not implemented in this ebuild"
170 + fi
171 +
172 + autotools-utils_src_configure
173 + }
174 +
175 + my_abi_configure() {
176 + #multilib_parallel_foreach_abi changes MULTIBUILD_VARIANT
177 + export FFTW_PRECISION=${MULTIBUILD_VARIANT}
178 + multilib_parallel_foreach_abi my_configure
179 + unset FFTW_PRECISION
180 + }
181 +
182 + multibuild_foreach_variant my_abi_configure
183 +}
184 +
185 +abi_has_precision() {
186 + #not all abi have all precisions
187 + [[ -f ${BUILD_DIR}/Makefile ]] || return 0
188 + "$@"
189 +}
190 +
191 +src_compile() {
192 + multibuild_foreach_variant multilib_foreach_abi abi_has_precision autotools-utils_src_compile
193 +}
194 +
195 +src_test () {
196 + # We want this to be a reasonably quick test, but that is still hard...
197 + ewarn "This test series will take 30 minutes on a modern 2.5Ghz machine"
198 + # Do not increase the number of threads, it will not help your performance
199 + #local testbase="perl check.pl --nthreads=1 --estimate"
200 + # ${testbase} -${p}d || die "Failure: $n"
201 + multibuild_foreach_variant multilib_foreach_abi abi_has_precision autotools-utils_src_compile -C tests smallcheck
202 +}
203 +
204 +src_install () {
205 + local u x
206 + DOCS=( AUTHORS ChangeLog NEWS README TODO COPYRIGHT CONVENTIONS )
207 + HTML_DOCS=( doc/html/ )
208 +
209 + #copied from autotools-multilib_secure_install
210 + my_abi_src_install() {
211 + my_abi_secure_install() {
212 + autotools-utils_src_install
213 + if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
214 + multilib_prepare_wrappers
215 + multilib_check_headers
216 + fi
217 + }
218 +
219 + multilib_foreach_abi abi_has_precision my_abi_secure_install
220 + #don't mix checksum of different precisions
221 + rm -f "${T}"/.multilib_header_cksum
222 + }
223 + multibuild_foreach_variant my_abi_src_install
224 + multilib_install_wrappers
225 +
226 + if use doc; then
227 + dodoc doc/*.pdf
228 + insinto /usr/share/doc/${PF}/faq
229 + doins -r doc/FAQ/fftw-faq.html/*
230 + else
231 + rm -r "${ED}"/usr/share/doc/${PF}/html
232 + fi
233 +
234 + for x in "${ED}"/usr/lib*/pkgconfig/*.pc; do
235 + for u in $(usev mpi) $(usev threads) $(usex openmp omp ""); do
236 + sed -e "s|-lfftw3[flq]\?|&_$u &|" "$x" > "${x%.pc}_$u.pc" || die
237 + done
238 + done
239 +}
240
241 diff --git a/sci-libs/fftw/fftw-9999.ebuild b/sci-libs/fftw/fftw-9999.ebuild
242 new file mode 100644
243 index 0000000..9af7694
244 --- /dev/null
245 +++ b/sci-libs/fftw/fftw-9999.ebuild
246 @@ -0,0 +1,197 @@
247 +# Copyright 1999-2013 Gentoo Foundation
248 +# Distributed under the terms of the GNU General Public License v2
249 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-3.3.3-r2.ebuild,v 1.3 2013/06/27 14:30:29 aballier Exp $
250 +
251 +EAPI=5
252 +
253 +#AUTOTOOLS_AUTORECONF=1
254 +FORTRAN_NEEDED=fortran
255 +
256 +inherit autotools-multilib eutils flag-o-matic fortran-2 multibuild toolchain-funcs versionator
257 +
258 +DESCRIPTION="Fast C library for the Discrete Fourier Transform"
259 +HOMEPAGE="http://www.fftw.org/"
260 +
261 +if [[ ${PV} = *9999 ]]; then
262 + inherit git-2
263 + EGIT_REPO_URI="https://github.com/FFTW/fftw3.git"
264 + KEYWORDS=""
265 + AUTOTOOLS_AUTORECONF=1
266 +else
267 + SRC_URI="http://www.fftw.org/${P}.tar.gz"
268 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
269 + PATCHES=( "${FILESDIR}/${P}-install-header.patch" )
270 + AUTOTOOLS_AUTORECONF=1
271 +fi
272 +
273 +LICENSE="GPL-2"
274 +SLOT="3.0"
275 +IUSE="altivec avx doc fma fortran mpi neon openmp quad sse sse2 static-libs test threads zbus"
276 +
277 +RDEPEND="
278 + mpi? ( virtual/mpi )
279 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r2
280 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
281 +DEPEND="${RDEPEND}
282 + test? ( dev-lang/perl )"
283 +
284 +#can go once mpi is multlib
285 +MULTILIB_WRAPPED_HEADERS=(
286 + /usr/include/fftw3-mpi.h
287 + /usr/include/fftw3l-mpi.f03
288 + /usr/include/fftw3-mpi.f03
289 + /usr/include/fftw3q.f03
290 +)
291 +
292 +pkg_setup() {
293 + # XXX: this looks like it should be used with BUILD_TYPE!=binary
294 +
295 + if use openmp; then
296 + if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
297 + ewarn "OpenMP is not available in your current selected gcc"
298 + die "need openmp capable gcc"
299 + fi
300 + FORTRAN_NEED_OPENMP=1
301 + fi
302 +
303 + fortran-2_pkg_setup
304 +
305 + MULTIBUILD_VARIANTS=( single double longdouble )
306 + if use quad; then
307 + if [[ $(tc-getCC) == *gcc ]] && ! version_is_at_least 4.6 $(gcc-version); then
308 + ewarn "quad precision only available for gcc >= 4.6"
309 + die "need quad precision capable gcc"
310 + fi
311 + MULTIBUILD_VARIANTS+=( quad )
312 + fi
313 +}
314 +
315 +src_prepare() {
316 + local ext="info"
317 + [[ ${PV} = *9999 ]] && ext="texi"
318 + # fix info file for category directory
319 + sed -i \
320 + -e 's/Texinfo documentation system/Libraries/' \
321 + doc/fftw3."${ext}" || die "failed to fix info file"
322 +
323 + autotools-utils_src_prepare
324 +}
325 +
326 +src_configure() {
327 + local x
328 +
329 + # filter -Os according to docs
330 + replace-flags -Os -O2
331 +
332 + my_configure() {
333 + local x=${FFTW_PRECISION}
334 + # there is no abi_x86_32 port of virtual/mpi right now
335 + local enable_mpi=$(use_enable mpi)
336 + multilib_is_native_abi || enable_mpi="--disable-mpi"
337 +
338 + #jlec reported USE=quad on abi_x86_32 has too less registers
339 + multilib_is_native_abi || [[ $x != quad ]] || return 0
340 +
341 + myeconfargs=(
342 + $(use_enable fma)
343 + $(use_enable fortran)
344 + $(use_enable zbus mips-zbus-timer)
345 + $(use_enable threads)
346 + $(use_enable openmp)
347 + )
348 + if [[ $x == single ]]; then
349 + #altivec, sse, single-paired only work for single
350 + myeconfargs+=(
351 + --enable-single
352 + $(use_enable altivec)
353 + $(use_enable avx)
354 + $(use_enable sse)
355 + ${enable_mpi}
356 + $(use_enable neon)
357 + )
358 + elif [[ $x == double ]]; then
359 + myeconfargs+=(
360 + $(use_enable avx)
361 + $(use_enable sse2)
362 + ${enable_mpi}
363 + )
364 + elif [[ $x == longdouble ]]; then
365 + myeconfargs+=(
366 + --enable-long-double
367 + ${enable_mpi}
368 + )
369 + elif [[ $x == quad ]]; then
370 + #quad does not support mpi
371 + myeconfargs+=( --enable-quad-precision )
372 + else
373 + die "${x} precision not implemented in this ebuild"
374 + fi
375 +
376 + autotools-utils_src_configure
377 + }
378 +
379 + my_abi_configure() {
380 + #multilib_parallel_foreach_abi changes MULTIBUILD_VARIANT
381 + export FFTW_PRECISION=${MULTIBUILD_VARIANT}
382 + multilib_parallel_foreach_abi my_configure
383 + unset FFTW_PRECISION
384 + }
385 +
386 + multibuild_foreach_variant my_abi_configure
387 +}
388 +
389 +abi_has_precision() {
390 + #not all abi have all precisions
391 + [[ -f ${BUILD_DIR}/Makefile ]] || return 0
392 + "$@"
393 +}
394 +
395 +src_compile() {
396 + multibuild_foreach_variant multilib_foreach_abi abi_has_precision autotools-utils_src_compile
397 +}
398 +
399 +src_test () {
400 + # We want this to be a reasonably quick test, but that is still hard...
401 + ewarn "This test series will take 30 minutes on a modern 2.5Ghz machine"
402 + # Do not increase the number of threads, it will not help your performance
403 + #local testbase="perl check.pl --nthreads=1 --estimate"
404 + # ${testbase} -${p}d || die "Failure: $n"
405 + multibuild_foreach_variant multilib_foreach_abi abi_has_precision autotools-utils_src_compile -C tests smallcheck
406 +}
407 +
408 +src_install () {
409 + local u x
410 + DOCS=( AUTHORS ChangeLog NEWS README TODO COPYRIGHT CONVENTIONS )
411 + HTML_DOCS=( doc/html/ )
412 +
413 + #copied from autotools-multilib_secure_install
414 + my_abi_src_install() {
415 + my_abi_secure_install() {
416 + autotools-utils_src_install
417 + if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
418 + multilib_prepare_wrappers
419 + multilib_check_headers
420 + fi
421 + }
422 +
423 + multilib_foreach_abi abi_has_precision my_abi_secure_install
424 + #don't mix checksum of different precisions
425 + rm -f "${T}"/.multilib_header_cksum
426 + }
427 + multibuild_foreach_variant my_abi_src_install
428 + multilib_install_wrappers
429 +
430 + if use doc; then
431 + dodoc doc/*.pdf
432 + insinto /usr/share/doc/${PF}/faq
433 + doins -r doc/FAQ/fftw-faq.html/*
434 + else
435 + rm -r "${ED}"/usr/share/doc/${PF}/html
436 + fi
437 +
438 + for x in "${ED}"/usr/lib*/pkgconfig/*.pc; do
439 + for u in $(usev mpi) $(usev threads) $(usex openmp omp ""); do
440 + sed -e "s|-lfftw3[flq]\?|&_$u &|" "$x" > "${x%.pc}_$u.pc" || die
441 + done
442 + done
443 +}
444
445 diff --git a/sci-libs/fftw/files/fftw-3.3.3-install-header.patch b/sci-libs/fftw/files/fftw-3.3.3-install-header.patch
446 new file mode 100644
447 index 0000000..4456c18
448 --- /dev/null
449 +++ b/sci-libs/fftw/files/fftw-3.3.3-install-header.patch
450 @@ -0,0 +1,35 @@
451 +From f450afa1cc0bb962abecfc1ffdbef8e1f7b748e4 Mon Sep 17 00:00:00 2001
452 +From: Christoph Junghans <ottxor@g.o>
453 +Date: Sat, 31 Aug 2013 21:21:28 -0600
454 +Subject: [PATCH] Only install f03 header of the active precision
455 +
456 +---
457 + api/Makefile.am | 11 ++++++++++-
458 + 1 file changed, 10 insertions(+), 1 deletion(-)
459 +
460 +diff --git a/api/Makefile.am b/api/Makefile.am
461 +index e4eaad7..bb6c042 100644
462 +--- a/api/Makefile.am
463 ++++ b/api/Makefile.am
464 +@@ -4,8 +4,17 @@ AM_CFLAGS = $(STACK_ALIGN_CFLAGS)
465 +
466 + EXTRA_DIST = f03api.sh genf03.pl fftw3.f03.in
467 +
468 +-include_HEADERS = fftw3.h fftw3.f fftw3l.f03 fftw3q.f03
469 ++include_HEADERS = fftw3.h fftw3.f
470 ++noinst_HEADERS = fftw3l.f03 fftw3q.f03
471 ++if LDOUBLE
472 ++include_HEADERS += fftw3l.f03
473 ++else
474 ++if QUAD
475 ++include_HEADERS += fftw3q.f03
476 ++else
477 + nodist_include_HEADERS = fftw3.f03
478 ++endif
479 ++endif
480 + noinst_LTLIBRARIES = libapi.la
481 +
482 + # pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@
483 +--
484 +1.8.1.5
485 +
486
487 diff --git a/sci-libs/fftw/metadata.xml b/sci-libs/fftw/metadata.xml
488 new file mode 100644
489 index 0000000..50e74c1
490 --- /dev/null
491 +++ b/sci-libs/fftw/metadata.xml
492 @@ -0,0 +1,23 @@
493 +<?xml version="1.0" encoding="UTF-8"?>
494 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
495 +<pkgmetadata>
496 + <herd>sci</herd>
497 + <longdescription lang="en">
498 + The Fastest Fourier Transform in the West is a C subroutine library
499 + for computing the Discrete Fourier Transform (DFT) in one or more
500 + dimensions, of both real and complex data, and of arbitrary input
501 + size. It is becoming the FFT library of choice for most
502 + applications. Benchmarks, performed on a variety of platforms, show
503 + that FFTW's performance is typically superior to that of other
504 + publicly available FFT software.
505 +</longdescription>
506 + <use>
507 + <flag name="avx">Adds support for Advanced Vector Extensions</flag>
508 + <flag name="fma">Use the Fused Multiply Add instruction set (fma3/fma4 either one)</flag>
509 + <flag name="quad">Build quadruple precision lib</flag>
510 + <flag name="zbus">Adds support for ZBus cycle-counter of mips</flag>
511 + </use>
512 + <upstream>
513 + <remote-id type="freecode">fftw</remote-id>
514 + </upstream>
515 +</pkgmetadata>