3 %bcond_without static_libs # static libraries
4 %bcond_without tests # unit tests
5 %bcond_with xblas # use xblas
7 Summary: The LAPACK libraries for numerical linear algebra
8 Summary(pl.UTF-8): Biblioteki numeryczne LAPACK do algebry liniowej
14 Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz
15 # Source0-md5: 0b251e2a8d5f949f99b50dd5e2200ee2
16 Source1: http://www.netlib.org/lapack/manpages.tgz
17 # Source1-md5: bbf94b49b43e2195de42c1d76b620de1
18 Patch0: blas-nan.patch
19 Patch1: missing_symbols_fix.patch
20 URL: http://www.netlib.org/lapack/
21 BuildRequires: cmake >= 2.8.12
22 BuildRequires: gcc-fortran
23 %{?with_xblas:BuildRequires: xblas-devel}
24 Requires: blas = %{version}-%{release}
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 # missing __stack_chk_fail symbol when only Fortran sources used
28 %undefine _fortify_cflags
32 LAPACK (Linear Algebra PACKage) is a standard library for numerical
33 linear algebra. LAPACK provides routines for solving systems of
34 simultaneous linear equations, least-squares solutions of linear
35 systems of equations, eigenvalue problems, and singular value
36 problems. Associated matrix factorizations (LU, Cholesky, QR, SVD,
37 Schur, and generalized Schur) and related computations (i.e.,
38 reordering of Schur factorizations and estimating condition numbers)
39 are also included. LAPACK can handle dense and banded matrices, but
40 not general sparse matrices. Similar functionality is provided for
41 real and complex matrices in both single and double precision. LAPACK
42 is coded in Fortran77.
44 %description -l pl.UTF-8
45 LAPACK (Linear Algebra PACKage) jest standardową biblioteką numeryczną
46 do algebry liniowej. Dostarcza funkcje rozwiązywania: układów równań
47 liniowych, układów równań metodą najmniejszych kwadratów, problemów
48 własnych. Zawiera algorytmy faktoryzacji macierzy (LU, Cholesky'ego,
49 QR, SVD, Schura, uogólnioną Schura) i związanych z tym obliczeń (np.
50 przenumerowywanie w faktoryzacji Schura i estymację uwarunkowania).
51 LAPACK może obsługiwać macierze blokowe i pasmowe, ale nie rzadkie w
52 ogólnym przypadku. Zapewnia funkcjonalność dla macierzy rzeczywistych
53 i zespolonych, dla liczb pojedynczej i podwójnej precyzji. LAPACK jest
54 napisany w Fortranie 77.
57 Summary: LAPACK development files
58 Summary(pl.UTF-8): Pliki programistyczne LAPACK
59 Group: Development/Libraries
60 Requires: %{name} = %{version}-%{release}
61 Requires: blas-devel = %{version}-%{release}
65 LAPACK development files.
67 %description devel -l pl.UTF-8
68 Pliki programistyczne LAPACK.
71 Summary: Static LAPACK libraries
72 Summary(pl.UTF-8): Biblioteki statyczne LAPACK
73 Group: Development/Libraries
74 Requires: %{name}-devel = %{version}-%{release}
77 Static LAPACK libraries.
79 %description static -l pl.UTF-8
80 Biblioteki statyczne LAPACK.
83 Summary: The BLAS (Basic Linear Algebra Subprograms) library for Linux
84 Summary(pl.UTF-8): Biblioteka BLAS (Basic Linear Algebra Subprograms) dla Linuksa
86 URL: http://www.netlib.org/blas/
87 Obsoletes: lapack-blas
90 BLAS (Basic Linear Algebra Subprograms) is a standard library for
91 numerical algebra. BLAS provides a number of basic algorithms for
92 linear algebra. BLAS is fast and well-tested, was written in FORTRAN
95 Warning: this is a reference implementation from Netlib. If possible,
96 use version optimized for your architecture instead.
98 %description -n blas -l pl.UTF-8
99 BLAS (Basic Linear Algebra Subprograms) jest standardową biblioteką
100 numeryczną algebry. Dostarcza wiele podstawowych algorytmów dla
101 algebry liniowej. Jest szybka i dobrze przetestowana, została napisana
104 Ostrzeżenie: to jest implementacja przykładowa z repozytorium Netlib.
105 Jeżeli to możliwe, należy używać zamiast niej wersji zoptymalizowanej
106 pod daną architekturę.
108 %package -n blas-devel
109 Summary: BLAS development files
110 Summary(pl.UTF-8): Pliki programistyczne BLAS
111 Group: Development/Libraries
112 URL: http://www.netlib.org/blas/
113 Requires: blas = %{version}-%{release}
116 %description -n blas-devel
117 BLAS development files.
119 %description -n blas-devel -l pl.UTF-8
120 Pliki programistyczne BLAS.
122 %package -n blas-static
123 Summary: Static BLAS library
124 Summary(pl.UTF-8): Biblioteka statyczna BLAS
125 Group: Development/Libraries
126 URL: http://www.netlib.org/blas/
127 Requires: blas-devel = %{version}-%{release}
129 %description -n blas-static
132 %description -n blas-static -l pl.UTF-8
133 Biblioteka statyczna BLAS.
136 Summary: C Standard Interface to BLAS Basic Linear Algebra Subprograms
137 Summary(pl.UTF-8): Interfejs C do procedur BLAS (Basic Linear Algebra Subprograms)
139 URL: http://www.netlib.org/blas/#_cblas
140 Requires: blas = %{version}-%{release}
142 %description -n cblas
143 C Standard Interface to BLAS Basic Linear Algebra Subprograms.
145 %description -n cblas -l pl.UTF-8
146 Interfejs C do procedur BLAS (Basic Linear Algebra Subprograms -
147 podstawowych procedur algebry liniowej).
149 %package -n cblas-devel
150 Summary: Header files of C Standard Interface to BLAS
151 Summary(pl.UTF-8): Pliki nagłówkowe interfejsu C do BLAS
153 URL: http://www.netlib.org/blas/#_cblas
154 Requires: blas-devel = %{version}-%{release}
155 Requires: cblas = %{version}-%{release}
157 %description -n cblas-devel
158 Header files of C Standard Interface to BLAS.
160 %description -n cblas-devel -l pl.UTF-8
161 Pliki nagłówkowe interfejsu C do BLAS.
163 %package -n cblas-static
164 Summary: Static CBLAS library
165 Summary(pl.UTF-8): Statyczna biblioteka CBLAS
167 URL: http://www.netlib.org/blas/#_cblas
168 Requires: cblas-devel = %{version}-%{release}
170 %description -n cblas-static
171 Static CBLAS library.
173 %description -n cblas-static -l pl.UTF-8
174 Statyczna biblioteka CBLAS.
177 Summary: LAPACKE - native C interface to LAPACK library routines
178 Summary(pl.UTF-8): LAPACKE - natywny interfejs C do procedur biblioteki LAPACK
180 URL: http://www.netlib.org/lapack/lapacke.html
181 Requires: lapack = %{version}-%{release}
183 %description -n lapacke
184 This library is a part of reference implementation for the C interface
185 to LAPACK project according to the specifications described at the
186 forum for the Intel(R) Math Kernel Library (Intel(R) MKL).
188 This implementation provides a native C interface to LAPACK routines
189 to facilitate usage of LAPACK functionality for C programmers.
191 %description -n lapacke -l pl.UTF-8
192 Ta bilioteka jest częścią implementacji referencyjnej interfejsu C do
193 projektu LAPACK, zgodnej ze specyfikacją opisaną na forum biblioteki
194 Intel(R) Math Kernel Library.
196 Ta implementacja udostępnia natywny interfejs C do procedur biblioteki
197 LAPACK, ułatwiając jej użycie programistom C.
199 %package -n lapacke-devel
200 Summary: Header files for LAPACKE - native C interface to LAPACK
201 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki LAPACKE - natywnego interfejsu C do biblioteki LAPACK
202 Group: Development/Libraries
203 URL: http://www.netlib.org/lapack/lapacke.html
204 Requires: lapack-devel = %{version}-%{release}
205 Requires: lapacke = %{version}-%{release}
207 %description -n lapacke-devel
208 Header files for LAPACKE - native C interface to LAPACK.
210 %description -n lapacke-devel -l pl.UTF-8
211 Pliki nagłówkowe biblioteki LAPACKE - natywnego interfejsu C do
214 %package -n lapacke-static
215 Summary: Static LAPACKE library - native C interface to LAPACK
216 Summary(pl.UTF-8): Statyczna biblioteka LAPACKE - natywny interfejs C do biblioteki LAPACK
217 Group: Development/Libraries
218 URL: http://www.netlib.org/lapack/lapacke.html
219 Requires: lapacke-devel = %{version}-%{release}
221 %description -n lapacke-static
222 Static LAPACKE library - native C interface to LAPACK.
224 %description -n lapacke-static -l pl.UTF-8
225 Statyczna biblioteka LAPACKE - natywny interfejs C do biblioteki
232 # copy selected routines; use INT_ETIME versions of second
233 # FIXME? CMakeLists doesn't handle second
234 #cp -f INSTALLSRC/{second_INT_ETIME,dsecnd_INT_ETIME}.f SRC
237 %{__rm} man/man3/_Users_julie_Documents_Boulot_GIT_lapack-release_*.3
239 %{__rm} man/man3/{SRC_xerbla,SRC_xerbla_array}.f.3
240 # ...in BLAS and LAPACK sources; keep versions from BLAS
241 %{__mv} man/man3/BLAS_SRC_xerbla.f.3 man/man3/xerbla.f.3
242 %{__mv} man/man3/BLAS_SRC_xerbla_array.f.3 man/man3/xerbla_array.f.3
243 %{__sed} -i -e 's/BLAS_SRC_//' man/man3/{xerbla,xerbla_array}.3
244 # in base and variants; adjust .so links to use base
245 %{__sed} -i -e 's/VARIANTS_qr_LL_//' man/man3/zgeqrf.3
246 %{__sed} -i -e 's/VARIANTS_lu_CR_//' man/man3/zgetrf.3
247 %{__sed} -i -e 's/VARIANTS_cholesky_RL_//' man/man3/zpotrf.3
248 # not used variants of some procedures
249 %{__rm} man/man3/{VARIANTS_*,sceil,sceil.f}.3
250 # documentation for examples
251 %{__rm} man/man3/{LDA,LDB,N,NRHS,example_*,lapacke_example_aux.*,main,print_*}.3
254 %if %{with static_libs}
255 install -d build-static
258 -DBUILD_DEPRECATED=ON \
259 -DBUILD_SHARED_LIBS=OFF \
261 -DLAPACKE_WITH_TMG=ON \
262 %{?with_xblas:-DUSE_XBLAS=ON}
270 -DBUILD_DEPRECATED=ON \
271 %{?with_tests:-DBUILD_TESTING=ON} \
273 -DLAPACKE_WITH_TMG=ON \
274 %{?with_xblas:-DUSE_XBLAS=ON}
280 rm -rf $RPM_BUILD_ROOT
282 %if %{with static_libs}
283 %{__make} -C build-static install \
284 DESTDIR=$RPM_BUILD_ROOT
287 %{__make} -C build install \
288 DESTDIR=$RPM_BUILD_ROOT
290 # install man pages, distributing them among blas-devel and lapack-devel
291 install -d $RPM_BUILD_ROOT%{_mandir}/man3
292 echo "%defattr(644,root,root,755)" > blasmans.list
293 echo "%defattr(644,root,root,755)" > mans.list
294 echo "%defattr(644,root,root,755)" > lapackemans.list
295 BLAS_ADDITIONAL='aux_blas|(complex|complex16|double|single)_blas_level[123]'
296 LAPACK_ADDITIONAL='OTHERauxiliary|(aux|complex|complex16|double|real|variants)(GB|GE|GT|HE|OTHER|PO|PT|SY)(auxiliary|computational|eigen|sing|solve)|(complex|complex16|double|single)_eig|variants(GE|OTHER|PO)computational'
297 MANS_ADDITIONAL="$BLAS_ADDITIONAL|$LAPACK_ADDITIONAL"
298 for f in man/man3/*.3 ; do
299 cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man3
301 if echo "$bn" | grep '\.[cfh]\.3$' ; then
303 elif echo "$bn" | grep -E "^($MANS_ADDITIONAL)\.3\$" ; then
305 elif grep '^\.so man3/.*\.[cfh]\.3$' "$f" ; then
306 ffn=$(sed -e '1s,^\.so man3/\(.*\.[cfh]\)\.3,\1,' $f)
307 elif grep -E "^\.so man3/($MANS_ADDITIONAL)\.3" "$f"; then
308 ffn=$(sed -e '1s,^\.so man3/\([^.]*\)\.3,\1,' $f)
310 echo "Unknown manpage: $f"
313 if [ -f "BLAS/SRC/$ffn" ] || echo "$ffn" | grep -E "^($BLAS_ADDITIONAL)\$" ; then
314 echo "%{_mandir}/man3/${bn}*" >> blasmans.list
315 elif [ -f "SRC/$ffn" -o -f "INSTALLSRC/$ffn" ] || echo "$ffn" | grep -E "^($LAPACK_ADDITIONAL)\$"; then
316 echo "%{_mandir}/man3/${bn}*" >> mans.list
317 elif [ -f "LAPACKE/include/$ffn" -o -f "LAPACKE/src/$ffn" -o -f "LAPACKE/utils/$ffn" ]; then
318 echo "%{_mandir}/man3/${bn}*" >> lapackemans.list
320 echo "Unknown manpage: $f (source file: $ffn)"
326 rm -rf $RPM_BUILD_ROOT
328 %post -p /sbin/ldconfig
329 %postun -p /sbin/ldconfig
331 %post -n blas -p /sbin/ldconfig
332 %postun -n blas -p /sbin/ldconfig
334 %post -n cblas -p /sbin/ldconfig
335 %postun -n cblas -p /sbin/ldconfig
337 %post -n lapacke -p /sbin/ldconfig
338 %postun -n lapacke -p /sbin/ldconfig
341 %defattr(644,root,root,755)
342 %doc LICENSE README.md
343 %attr(755,root,root) %{_libdir}/liblapack.so.*.*.*
344 %attr(755,root,root) %ghost %{_libdir}/liblapack.so.3
346 %files devel -f mans.list
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{_libdir}/liblapack.so
349 %{_includedir}/lapack.h
350 %{_pkgconfigdir}/lapack.pc
351 %{_libdir}/cmake/lapack-%{version}
353 %if %{with static_libs}
355 %defattr(644,root,root,755)
356 %{_libdir}/liblapack.a
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_libdir}/libblas.so.*.*.*
362 %attr(755,root,root) %ghost %{_libdir}/libblas.so.3
364 %files -n blas-devel -f blasmans.list
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_libdir}/libblas.so
367 %{_pkgconfigdir}/blas.pc
369 %if %{with static_libs}
370 %files -n blas-static
371 %defattr(644,root,root,755)
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_libdir}/libcblas.so.*.*.*
378 %attr(755,root,root) %ghost %{_libdir}/libcblas.so.3
380 %files -n cblas-devel
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/libcblas.so
383 %{_includedir}/cblas*.h
384 %{_pkgconfigdir}/cblas.pc
385 %{_libdir}/cmake/cblas-%{version}
387 %if %{with static_libs}
388 %files -n cblas-static
389 %defattr(644,root,root,755)
390 %{_libdir}/libcblas.a
393 %files -n lapacke -f lapackemans.list
394 %defattr(644,root,root,755)
395 %doc LAPACKE/{LICENSE,README}
396 %attr(755,root,root) %{_libdir}/liblapacke.so.*.*.*
397 %attr(755,root,root) %ghost %{_libdir}/liblapacke.so.3
398 %attr(755,root,root) %{_libdir}/libtmglib.so
400 %files -n lapacke-devel
401 %defattr(644,root,root,755)
402 %attr(755,root,root) %{_libdir}/liblapacke.so
403 %{_includedir}/lapacke*.h
404 %{_pkgconfigdir}/lapacke.pc
405 %{_libdir}/cmake/lapacke-%{version}
407 %if %{with static_libs}
408 %files -n lapacke-static
409 %defattr(644,root,root,755)
410 %{_libdir}/liblapacke.a
411 %{_libdir}/libtmglib.a