summaryrefslogtreecommitdiff
path: root/fftw3.spec
blob: 733c9765f727416a927571882d6a58cfb2b244a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# NOTE (for distributors from NEWS file): don't enable too many SIMD variants in
# distribution builds, because it increases planing time; by default enable just
# most popular ones (like SSE, AVX).
# The rest are available by bconds.
#
# TODO: mpi
#
# Conditional build:
%bcond_without	fftwl		# "long" subpackages
%bcond_without	fftwq		# "quad" subpackages
%bcond_without	openmp		# OpenMP support
%bcond_with	avx128fma	# AVX128/FMA instructions (for some AMD machines)
%bcond_with	avx256		# AVX2 256-bit FMA instructions
%bcond_with	avx512		# AVX512 and KCVI [experimental]
#

%ifnarch %{ix86} %{x8664} x32 ia64
%undefine	with_fftwq
%endif

Summary:	Fast Fourier Transform library
Summary(pl.UTF-8):	Biblioteka z funkcjami szybkiej transformaty Fouriera
Summary(pt_BR.UTF-8):	biblioteca fast fourier transform
Name:		fftw3
Version:	3.3.8
Release:	1
License:	GPL v2+
Group:		Libraries
#Source0Download: http://fftw.org/download.html
Source0:	http://fftw.org/fftw-%{version}.tar.gz
# Source0-md5:	8aac833c943d8e90d51b697b27d4384d
Patch0:		%{name}-info.patch
URL:		http://www.fftw.org/
BuildRequires:	autoconf >= 2.50
BuildRequires:	automake >= 1:1.7
BuildRequires:	gcc-fortran
%ifarch alpha ppc s390 s390x sparc sparcv9
%if %{with fftwl}
# for 128-bit long double support
BuildRequires:	gcc-fortran >= 5:4.1.0-1
BuildRequires:	glibc >= 6:2.4-1
%endif
%endif
%if %{with fftwq}
BuildRequires:	gcc >= 6:4.6.0
BuildRequires:	libquadmath-devel
%endif
%if %{with openmp}
BuildRequires:	gcc >= 6:4.2.0
BuildRequires:	libgomp-devel
%endif
BuildRequires:	libtool
BuildRequires:	texinfo
Requires:	%{name}-common = %{version}-%{release}
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define builds	single double %{?with_fftwl:long-double} %{?with_fftwq:quad-precision}

%description
FFTW is a collection of fast C routines for computing the Discrete
Fourier Transform in one or more dimensions. It includes complex,
real, and parallel transforms, and can handle arbitrary array sizes
efficiently. This RPM package includes the double precision FFTW
uniprocessor and threads libraries.

%description -l pl.UTF-8
FFTW jest zbiorem szybkich funkcji C do obliczania dyskretnych
transformat Fouriera w jednym lub więcej wymiarach. Zawiera również
zespolone, rzeczywiste oraz równoległe transformaty i potrafi wydajnie
radzić sobie z tablicami o dowolnych rozmiarach. Ten pakiet RPM
zawiera wersje FFTW o podwójnej precyzji dla architektur
jednoprocesorowych oraz z obsługą wątków.

%description -l pt_BR.UTF-8
FFTW é uma coleção de rotinas rápidas em C para computar a Discrete
Fourier Transform em uma ou mais dimensões. Incluindo transformações
complexas, reais e paralelas, também pode manipular vetores de tamanho
arbitrário eficientemente. Esse pacote RPM inclui bibliotecas FFTW com
suporte a threads, normal e dupla precisão (Os arquivos de precisão
normal tem um prefixo "s").

%package devel
Summary:	Development files for fftw
Summary(pl.UTF-8):	Pliki programistyczne do fftw
Summary(pt_BR.UTF-8):	Headers e documentação do pacote FFTW
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-common-devel = %{version}-%{release}
%{?with_openmp:Requires:	libgomp-devel}

%description devel
This package contains the files you need to develop programs using the
FFTW (fast fourier transform library).

%description devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do tworzenia programów używających
biblioteki FFTW (wykonującej szybką transformatę Fouriera).

%description devel -l pt_BR.UTF-8
Este pacote contém documentação e headers adicionais para desenvolver
programas usando a FFTW.

%package static
Summary:	Static fftw libraries
Summary(pl.UTF-8):	Statyczne biblioteki fftw
Summary(pt_BR.UTF-8):	Bibliotecas estáticas do pacote FFTW
Group:		Development/Libraries
Requires:	%{name}-devel = %{version}-%{release}

%description static
Static fftw libraries.

%description static -l pl.UTF-8
Statyczne biblioteki fftw.

%description static -l pt_BR.UTF-8
Este pacote contém as bibliotecas estáticas do pacote FFTW.

%package single
Summary:	Fast Fourier Transform library - single precision
Summary(pl.UTF-8):	Biblioteka z funkcjami szybkiej transformaty Fouriera - pojedynczej precyzji
Group:		Libraries
Requires:	%{name}-common = %{version}-%{release}

%description single
FFTW is a collection of fast C routines for computing the Discrete
Fourier Transform in one or more dimensions. It includes complex,
real, and parallel transforms, and can handle arbitrary array sizes
efficiently. This RPM package includes the single precision FFTW
uniprocessor and threads libraries.

%description single -l pl.UTF-8
FFTW jest zbiorem szybkich funkcji C do obliczania dyskretnych
transformat Fouriera w jednym lub więcej wymiarach. Zawiera również
zespolone, rzeczywiste oraz równoległe transformaty i potrafi wydajnie
radzić sobie z tablicami o dowolnych rozmiarach. Ten pakiet RPM
zawiera wersje FFTW o pojedynczej precyzji dla architektur
jednoprocesorowych oraz z obsługą wątków.

%package single-devel
Summary:	Development files for single precision fftw
Summary(pl.UTF-8):	Pliki programistyczne do fftw pojedynczej precyzji
Group:		Development/Libraries
Requires:	%{name}-common-devel = %{version}-%{release}
Requires:	%{name}-single = %{version}-%{release}
%{?with_openmp:Requires:	libgomp-devel}

%description single-devel
This package contains the files you need to develop programs using the
single precision FFTW (fast fourier transform library).

%description single-devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do tworzenia programów używających
biblioteki FFTW (wykonującej szybką transformatę Fouriera) pojedynczej
precyzji.

%package single-static
Summary:	Static fftw single precision libraries
Summary(pl.UTF-8):	Statyczne biblioteki fftw pojedynczej precyzji
Group:		Development/Libraries
Requires:	%{name}-single-devel = %{version}-%{release}

%description single-static
Static fftw single precision libraries.

%description single-static -l pl.UTF-8
Statyczne biblioteki fftw pojedynczej precyzji.

%package long
Summary:	Fast Fourier Transform library - long double precision
Summary(pl.UTF-8):	Biblioteka z funkcjami szybkiej transformaty Fouriera - rozszerzonej precyzji
Group:		Libraries
Requires:	%{name}-common = %{version}-%{release}

%description long
FFTW is a collection of fast C routines for computing the Discrete
Fourier Transform in one or more dimensions. It includes complex,
real, and parallel transforms, and can handle arbitrary array sizes
efficiently. This RPM package includes the long double precision FFTW
uniprocessor and threads libraries.

%description long -l pl.UTF-8
FFTW jest zbiorem szybkich funkcji C do obliczania dyskretnych
transformat Fouriera w jednym lub więcej wymiarach. Zawiera również
zespolone, rzeczywiste oraz równoległe transformaty i potrafi wydajnie
radzić sobie z tablicami o dowolnych rozmiarach. Ten pakiet RPM
zawiera wersje FFTW o rozszerzonej precyzji dla architektur
jednoprocesorowych oraz z obsługą wątków.

%package long-devel
Summary:	Development files for long double precision fftw
Summary(pl.UTF-8):	Pliki programistyczne do fftw rozszerzonej precyzji
Group:		Development/Libraries
Requires:	%{name}-common-devel = %{version}-%{release}
Requires:	%{name}-long = %{version}-%{release}
%{?with_openmp:Requires:	libgomp-devel}

%description long-devel
This package contains the files you need to develop programs using the
long double precision FFTW (fast fourier transform library).

%description long-devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do tworzenia programów używających
biblioteki FFTW (wykonującej szybką transformatę Fouriera)
rozszerzonej precyzji.

%package long-static
Summary:	Static fftw long double precision libraries
Summary(pl.UTF-8):	Statyczne biblioteki fftw rozszerzonej precyzji
Group:		Development/Libraries
Requires:	%{name}-long-devel = %{version}-%{release}

%description long-static
Static fftw long double precision libraries.

%description long-static -l pl.UTF-8
Statyczne biblioteki fftw rozszerzonej precyzji.

%package quad
Summary:	Fast Fourier Transform library - quad precision
Summary(pl.UTF-8):	Biblioteka z funkcjami szybkiej transformaty Fouriera - poczwórnej precyzji
Group:		Libraries
Requires:	%{name}-common = %{version}-%{release}

%description quad
FFTW is a collection of fast C routines for computing the Discrete
Fourier Transform in one or more dimensions. It includes complex,
real, and parallel transforms, and can handle arbitrary array sizes
efficiently. This RPM package includes the quad precision FFTW
uniprocessor and threads libraries.

%description quad -l pl.UTF-8
FFTW jest zbiorem szybkich funkcji C do obliczania dyskretnych
transformat Fouriera w jednym lub więcej wymiarach. Zawiera również
zespolone, rzeczywiste oraz równoległe transformaty i potrafi wydajnie
radzić sobie z tablicami o dowolnych rozmiarach. Ten pakiet RPM
zawiera wersje FFTW o poczwórnej precyzji dla architektur
jednoprocesorowych oraz z obsługą wątków.

%package quad-devel
Summary:	Development files for quad precision fftw
Summary(pl.UTF-8):	Pliki programistyczne do fftw poczwórnej precyzji
Group:		Development/Libraries
Requires:	%{name}-common-devel = %{version}-%{release}
Requires:	%{name}-quad = %{version}-%{release}
%{?with_openmp:Requires:	libgomp-devel}
Requires:	libquadmath-devel

%description quad-devel
This package contains the files you need to develop programs using the
quad precision FFTW (fast fourier transform library).

%description quad-devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do tworzenia programów używających
biblioteki FFTW (wykonującej szybką transformatę Fouriera) poczwórnej
precyzji.

%package quad-static
Summary:	Static fftw quad precision libraries
Summary(pl.UTF-8):	Statyczne biblioteki fftw poczwórnej precyzji
Group:		Development/Libraries
Requires:	%{name}-quad-devel = %{version}-%{release}

%description quad-static
Static fftw quad precision libraries.

%description quad-static -l pl.UTF-8
Statyczne biblioteki fftw poczwórnej precyzji.

%package common
Summary:	Files common for all versions of fftw libraries
Summary(pl.UTF-8):	Pliki wspólne dla wszystkich wersji bibliotek fftw
Group:		Libraries

%description common
Files common for all versions of fftw libraries (basic documentation,
fftw-wisdom-to-conf utility).

%description common -l pl.UTF-8
Pliki wspólne dla wszystkich wersji bibliotek fftw (podstawowa
dokumentacja, narzędzie fftw-wisdom-to-conf).

%package common-devel
Summary:	Development files common for all versions of fftw libraries
Summary(pl.UTF-8):	Pliki programistyczne wspólne dla wszystkich wersji bibliotek fftw
Group:		Development/Libraries
Requires:	%{name}-common = %{version}-%{release}

%description common-devel
Development files common for all versions of fftw libraries (header
files, development documentation).

%description common-devel -l pl.UTF-8
Pliki programistyczne wspólne dla wszystkich wersji bibliotek fftw
(pliki nagłówkowe, dokumentacja programisty).

%prep
%setup -q -n fftw-%{version}
%patch0 -p1

%build
%{__libtoolize}
%{__aclocal} -I m4
%{__autoconf}
%{__automake}

# MMX/SSE/etc. seem to be safe because of runtime CPU detection
for ver in %{builds}; do
	OPTS=""
	# SSE,altivec,neon@arm[32] only for single
	if [ "$ver" = "single" ]; then
%ifarch pentium3 athlon
		# for SSE2-aware subarchs SSE for single precision is enabled by --enable-sse2 option
		OPTS="--enable-sse"
%endif
%ifarch armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl aarch64
		OPTS="--enable-neon"
%endif
%ifarch ppc ppc64
		OPTS="--enable-altivec"
%endif
		: # keep sh happy about syntax on other archs
	fi
%ifarch i686 pentium4 %{x8664} x32
	# SSE/SSE2 and AVX only for single and double
	if [ "$ver" = "double" -o "$ver" = "single" ]; then
		OPTS="$OPTS --enable-sse2 --enable-avx"
%if %{with avx256}
		OPTS="$OPTS --enable-avx2"
%endif
%if %{with avx512}
		OPTS="$OPTS --enable-avx512 --enable-kcvi"
%endif
	fi
%endif
%if %{with avx128fma}
	OPTS="$OPTS --enable-avx128-fma"
%endif
%ifarch aarch64
	OPTS="$OPTS --enable-neon"
%endif
%ifarch ppc ppc64
	OPTS="$OPTS --enable-vsx"
%endif
install -d build-${ver}
cd build-${ver}
../%configure \
	--enable-$ver \
	--enable-debug%{!?debug:=no} \
	--enable-openmp \
	--enable-shared \
	--enable-threads \
	$OPTS

%{__make}
cd ..
done

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}/fftw

for b in %{builds} ; do
	%{__make} install -C build-${b} \
		DESTDIR=$RPM_BUILD_ROOT
done

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%post	single -p /sbin/ldconfig
%postun	single -p /sbin/ldconfig

%post	long -p /sbin/ldconfig
%postun	long -p /sbin/ldconfig

%post	common-devel -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}

%postun	common-devel -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}

%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fftw-wisdom
%attr(755,root,root) %{_libdir}/libfftw3.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3.so.3
%attr(755,root,root) %{_libdir}/libfftw3_threads.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3_threads.so.3
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3_omp.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3_omp.so.3
%endif
%{_mandir}/man1/fftw-wisdom.1*

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libfftw3.so
%attr(755,root,root) %{_libdir}/libfftw3_threads.so
%{_libdir}/libfftw3.la
%{_libdir}/libfftw3_threads.la
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3_omp.so
%{_libdir}/libfftw3_omp.la
%endif
%{_pkgconfigdir}/fftw3.pc
%{_libdir}/cmake/fftw3/FFTW3Config*.cmake

%files static
%defattr(644,root,root,755)
%{_libdir}/libfftw3.a
%{_libdir}/libfftw3_threads.a
%if %{with openmp}
%{_libdir}/libfftw3_omp.a
%endif

%files single
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fftwf-wisdom
%attr(755,root,root) %{_libdir}/libfftw3f.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3f.so.3
%attr(755,root,root) %{_libdir}/libfftw3f_threads.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3f_threads.so.3
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3f_omp.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3f_omp.so.3
%endif
%{_mandir}/man1/fftwf-wisdom.1*

%files single-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libfftw3f.so
%attr(755,root,root) %{_libdir}/libfftw3f_threads.so
%{_libdir}/libfftw3f.la
%{_libdir}/libfftw3f_threads.la
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3f_omp.so
%{_libdir}/libfftw3f_omp.la
%endif
%{_pkgconfigdir}/fftw3f.pc
%{_libdir}/cmake/fftw3/FFTW3fConfig*.cmake

%files single-static
%defattr(644,root,root,755)
%{_libdir}/libfftw3f.a
%{_libdir}/libfftw3f_threads.a
%if %{with openmp}
%{_libdir}/libfftw3f_omp.a
%endif

%if %{with fftwl}
%files long
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fftwl-wisdom
%attr(755,root,root) %{_libdir}/libfftw3l.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3l.so.3
%attr(755,root,root) %{_libdir}/libfftw3l_threads.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3l_threads.so.3
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3l_omp.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3l_omp.so.3
%endif
%{_mandir}/man1/fftwl-wisdom.1*

%files long-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libfftw3l.so
%attr(755,root,root) %{_libdir}/libfftw3l_threads.so
%{_libdir}/libfftw3l.la
%{_libdir}/libfftw3l_threads.la
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3l_omp.so
%{_libdir}/libfftw3l_omp.la
%endif
%{_includedir}/fftw3l.f03
%{_pkgconfigdir}/fftw3l.pc
%{_libdir}/cmake/fftw3/FFTW3lConfig*.cmake

%files long-static
%defattr(644,root,root,755)
%{_libdir}/libfftw3l.a
%{_libdir}/libfftw3l_threads.a
%if %{with openmp}
%{_libdir}/libfftw3l_omp.a
%endif
%endif

%if %{with fftwq}
%files quad
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fftwq-wisdom
%attr(755,root,root) %{_libdir}/libfftw3q.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3q.so.3
%attr(755,root,root) %{_libdir}/libfftw3q_threads.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3q_threads.so.3
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3q_omp.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libfftw3q_omp.so.3
%endif
%{_mandir}/man1/fftwq-wisdom.1*

%files quad-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libfftw3q.so
%attr(755,root,root) %{_libdir}/libfftw3q_threads.so
%{_libdir}/libfftw3q.la
%{_libdir}/libfftw3q_threads.la
%if %{with openmp}
%attr(755,root,root) %{_libdir}/libfftw3q_omp.so
%{_libdir}/libfftw3q_omp.la
%endif
%{_includedir}/fftw3q.f03
%{_pkgconfigdir}/fftw3q.pc
%{_libdir}/cmake/fftw3/FFTW3qConfig*.cmake

%files quad-static
%defattr(644,root,root,755)
%{_libdir}/libfftw3q.a
%{_libdir}/libfftw3q_threads.a
%if %{with openmp}
%{_libdir}/libfftw3q_omp.a
%endif
%endif

%files common
%defattr(644,root,root,755)
%doc AUTHORS COPYRIGHT ChangeLog NEWS README TODO
%dir %{_sysconfdir}/fftw
%attr(755,root,root) %{_bindir}/fftw-wisdom-to-conf
%{_mandir}/man1/fftw-wisdom-to-conf.1*

%files common-devel
%defattr(644,root,root,755)
%doc doc/html doc/FAQ/fftw-faq.html
%{_includedir}/fftw3.f
%{_includedir}/fftw3.f03
%{_includedir}/fftw3.h
%dir %{_libdir}/cmake/fftw3
%{_infodir}/fftw3.info*