]> git.pld-linux.org Git - packages/lapack.git/blame - lapack.spec
fix build without static libs
[packages/lapack.git] / lapack.spec
CommitLineData
840838df
JB
1#
2# Conditional build:
3%bcond_without static_libs # static libraries
4%bcond_without tests # unit tests
5%bcond_with xblas # use xblas
6
1d0d5108 7Summary: The LAPACK libraries for numerical linear algebra
084ff819 8Summary(pl.UTF-8): Biblioteki numeryczne LAPACK do algebry liniowej
3c513ef3 9Name: lapack
f5975a02
MK
10Version: 3.9.0
11Release: 1
b3147294 12License: BSD-like
4d771884 13Group: Libraries
f5975a02
MK
14Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz
15# Source0-md5: 0b251e2a8d5f949f99b50dd5e2200ee2
16Source1: http://www.netlib.org/lapack/manpages.tgz
840838df
JB
17# Source1-md5: bbf94b49b43e2195de42c1d76b620de1
18Patch0: blas-nan.patch
f5975a02 19Patch1: missing_symbols_fix.patch
3c513ef3 20URL: http://www.netlib.org/lapack/
840838df 21BuildRequires: cmake >= 2.8.12
a1923521 22BuildRequires: gcc-fortran
840838df 23%{?with_xblas:BuildRequires: xblas-devel}
584ffaf6 24Requires: blas = %{version}-%{release}
64123b99 25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
3c513ef3 26
b371c4ed
JB
27# missing __stack_chk_fail symbol when only Fortran sources used
28%undefine _fortify_cflags
29%undefine _ssp_cflags
30
3c513ef3 31%description
32LAPACK (Linear Algebra PACKage) is a standard library for numerical
33linear algebra. LAPACK provides routines for solving systems of
34simultaneous linear equations, least-squares solutions of linear
35systems of equations, eigenvalue problems, and singular value
36problems. Associated matrix factorizations (LU, Cholesky, QR, SVD,
37Schur, and generalized Schur) and related computations (i.e.,
38reordering of Schur factorizations and estimating condition numbers)
39are also included. LAPACK can handle dense and banded matrices, but
40not general sparse matrices. Similar functionality is provided for
41real and complex matrices in both single and double precision. LAPACK
6ec8881e
JB
42is coded in Fortran77.
43
eb8f2cff
JR
44%description -l pl.UTF-8
45LAPACK (Linear Algebra PACKage) jest standardową biblioteką numeryczną
46do algebry liniowej. Dostarcza funkcje rozwiązywania: układów równań
47liniowych, układów równań metodą najmniejszych kwadratów, problemów
48własnych. Zawiera algorytmy faktoryzacji macierzy (LU, Cholesky'ego,
49QR, SVD, Schura, uogólnioną Schura) i związanych z tym obliczeń (np.
50przenumerowywanie w faktoryzacji Schura i estymację uwarunkowania).
51LAPACK może obsługiwać macierze blokowe i pasmowe, ale nie rzadkie w
52ogólnym przypadku. Zapewnia funkcjonalność dla macierzy rzeczywistych
53i zespolonych, dla liczb pojedynczej i podwójnej precyzji. LAPACK jest
6ec8881e 54napisany w Fortranie 77.
3c513ef3 55
f1593bb3 56%package devel
e956dfe5
JB
57Summary: LAPACK development files
58Summary(pl.UTF-8): Pliki programistyczne LAPACK
f1593bb3 59Group: Development/Libraries
584ffaf6
JB
60Requires: %{name} = %{version}-%{release}
61Requires: blas-devel = %{version}-%{release}
1d0d5108 62Obsoletes: lapack-man
f1593bb3 63
64%description devel
e956dfe5 65LAPACK development files.
f1593bb3 66
eb8f2cff 67%description devel -l pl.UTF-8
e956dfe5 68Pliki programistyczne LAPACK.
f1593bb3 69
70%package static
6ec8881e 71Summary: Static LAPACK libraries
084ff819 72Summary(pl.UTF-8): Biblioteki statyczne LAPACK
f1593bb3 73Group: Development/Libraries
584ffaf6 74Requires: %{name}-devel = %{version}-%{release}
f1593bb3 75
76%description static
6ec8881e 77Static LAPACK libraries.
f1593bb3 78
eb8f2cff 79%description static -l pl.UTF-8
6ec8881e 80Biblioteki statyczne LAPACK.
f1593bb3 81
3c513ef3 82%package -n blas
6ec8881e 83Summary: The BLAS (Basic Linear Algebra Subprograms) library for Linux
084ff819 84Summary(pl.UTF-8): Biblioteka BLAS (Basic Linear Algebra Subprograms) dla Linuksa
4d771884 85Group: Libraries
840838df 86URL: http://www.netlib.org/blas/
3c513ef3 87Obsoletes: lapack-blas
88
89%description -n blas
90BLAS (Basic Linear Algebra Subprograms) is a standard library for
91numerical algebra. BLAS provides a number of basic algorithms for
92linear algebra. BLAS is fast and well-tested, was written in FORTRAN
6ec8881e
JB
9377.
94
1599bb15
RW
95Warning: this is a reference implementation from Netlib. If possible,
96use version optimized for your architecture instead.
97
eb8f2cff
JR
98%description -n blas -l pl.UTF-8
99BLAS (Basic Linear Algebra Subprograms) jest standardową biblioteką
100numeryczną algebry. Dostarcza wiele podstawowych algorytmów dla
101algebry liniowej. Jest szybka i dobrze przetestowana, została napisana
6ec8881e 102w Fortranie 77.
3c513ef3 103
eb8f2cff
JR
104Ostrzeżenie: to jest implementacja przykładowa z repozytorium Netlib.
105Jeżeli to możliwe, należy używać zamiast niej wersji zoptymalizowanej
106pod daną architekturę.
1599bb15 107
f1593bb3 108%package -n blas-devel
e956dfe5
JB
109Summary: BLAS development files
110Summary(pl.UTF-8): Pliki programistyczne BLAS
f1593bb3 111Group: Development/Libraries
840838df 112URL: http://www.netlib.org/blas/
584ffaf6 113Requires: blas = %{version}-%{release}
1d0d5108 114Obsoletes: blas-man
f1593bb3 115
116%description -n blas-devel
e956dfe5 117BLAS development files.
f1593bb3 118
eb8f2cff 119%description -n blas-devel -l pl.UTF-8
e956dfe5 120Pliki programistyczne BLAS.
f1593bb3 121
122%package -n blas-static
c7c26a27
JB
123Summary: Static BLAS library
124Summary(pl.UTF-8): Biblioteka statyczna BLAS
f1593bb3 125Group: Development/Libraries
840838df 126URL: http://www.netlib.org/blas/
584ffaf6 127Requires: blas-devel = %{version}-%{release}
f1593bb3 128
129%description -n blas-static
c7c26a27 130Static BLAS library.
f1593bb3 131
eb8f2cff 132%description -n blas-static -l pl.UTF-8
c7c26a27
JB
133Biblioteka statyczna BLAS.
134
840838df
JB
135%package -n cblas
136Summary: C Standard Interface to BLAS Basic Linear Algebra Subprograms
137Summary(pl.UTF-8): Interfejs C do procedur BLAS (Basic Linear Algebra Subprograms)
138Group: Libraries
139URL: http://www.netlib.org/blas/#_cblas
140Requires: blas = %{version}-%{release}
141
142%description -n cblas
143C Standard Interface to BLAS Basic Linear Algebra Subprograms.
144
145%description -n cblas -l pl.UTF-8
146Interfejs C do procedur BLAS (Basic Linear Algebra Subprograms -
147podstawowych procedur algebry liniowej).
148
149%package -n cblas-devel
150Summary: Header files of C Standard Interface to BLAS
151Summary(pl.UTF-8): Pliki nagłówkowe interfejsu C do BLAS
152Group: Libraries
153URL: http://www.netlib.org/blas/#_cblas
154Requires: blas-devel = %{version}-%{release}
155Requires: cblas = %{version}-%{release}
156
157%description -n cblas-devel
158Header files of C Standard Interface to BLAS.
159
160%description -n cblas-devel -l pl.UTF-8
161Pliki nagłówkowe interfejsu C do BLAS.
162
163%package -n cblas-static
164Summary: Static CBLAS library
165Summary(pl.UTF-8): Statyczna biblioteka CBLAS
166Group: Libraries
167URL: http://www.netlib.org/blas/#_cblas
168Requires: cblas-devel = %{version}-%{release}
169
170%description -n cblas-static
171Static CBLAS library.
172
173%description -n cblas-static -l pl.UTF-8
174Statyczna biblioteka CBLAS.
175
c7c26a27
JB
176%package -n lapacke
177Summary: LAPACKE - native C interface to LAPACK library routines
178Summary(pl.UTF-8): LAPACKE - natywny interfejs C do procedur biblioteki LAPACK
179Group: Libraries
840838df 180URL: http://www.netlib.org/lapack/lapacke.html
c7c26a27
JB
181Requires: lapack = %{version}-%{release}
182
183%description -n lapacke
184This library is a part of reference implementation for the C interface
185to LAPACK project according to the specifications described at the
186forum for the Intel(R) Math Kernel Library (Intel(R) MKL).
187
188This implementation provides a native C interface to LAPACK routines
189to facilitate usage of LAPACK functionality for C programmers.
190
191%description -n lapacke -l pl.UTF-8
192Ta bilioteka jest częścią implementacji referencyjnej interfejsu C do
193projektu LAPACK, zgodnej ze specyfikacją opisaną na forum biblioteki
194Intel(R) Math Kernel Library.
195
196Ta implementacja udostępnia natywny interfejs C do procedur biblioteki
197LAPACK, ułatwiając jej użycie programistom C.
198
199%package -n lapacke-devel
200Summary: Header files for LAPACKE - native C interface to LAPACK
201Summary(pl.UTF-8): Pliki nagłówkowe biblioteki LAPACKE - natywnego interfejsu C do biblioteki LAPACK
202Group: Development/Libraries
840838df 203URL: http://www.netlib.org/lapack/lapacke.html
c7c26a27
JB
204Requires: lapack-devel = %{version}-%{release}
205Requires: lapacke = %{version}-%{release}
206
207%description -n lapacke-devel
208Header files for LAPACKE - native C interface to LAPACK.
209
210%description -n lapacke-devel -l pl.UTF-8
211Pliki nagłówkowe biblioteki LAPACKE - natywnego interfejsu C do
212biblioteki LAPACK.
213
214%package -n lapacke-static
215Summary: Static LAPACKE library - native C interface to LAPACK
216Summary(pl.UTF-8): Statyczna biblioteka LAPACKE - natywny interfejs C do biblioteki LAPACK
217Group: Development/Libraries
840838df 218URL: http://www.netlib.org/lapack/lapacke.html
c7c26a27
JB
219Requires: lapacke-devel = %{version}-%{release}
220
221%description -n lapacke-static
222Static LAPACKE library - native C interface to LAPACK.
223
224%description -n lapacke-static -l pl.UTF-8
225Statyczna biblioteka LAPACKE - natywny interfejs C do biblioteki
226LAPACK.
f1593bb3 227
3c513ef3 228%prep
a1923521 229%setup -q -a1
448f9206 230%patch0 -p1
f5975a02 231%patch1 -p1
c42e604c 232# copy selected routines; use INT_ETIME versions of second
840838df
JB
233# FIXME? CMakeLists doesn't handle second
234#cp -f INSTALLSRC/{second_INT_ETIME,dsecnd_INT_ETIME}.f SRC
3c513ef3 235
c7c26a27 236# bogus
840838df 237%{__rm} man/man3/_Users_julie_Documents_Boulot_GIT_lapack-release_*.3
c7c26a27 238# duplicated...
b3147294 239%{__rm} man/man3/{SRC_xerbla,SRC_xerbla_array}.f.3
c7c26a27 240# ...in BLAS and LAPACK sources; keep versions from BLAS
b3147294
JB
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
840838df
JB
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
b3147294 248# not used variants of some procedures
840838df 249%{__rm} man/man3/{VARIANTS_*,sceil,sceil.f}.3
b3147294
JB
250# documentation for examples
251%{__rm} man/man3/{LDA,LDB,N,NRHS,example_*,lapacke_example_aux.*,main,print_*}.3
c7c26a27 252
3c513ef3 253%build
840838df
JB
254%if %{with static_libs}
255install -d build-static
256cd build-static
257%cmake .. \
258 -DBUILD_DEPRECATED=ON \
259 -DBUILD_SHARED_LIBS=OFF \
260 -DCBLAS=ON \
261 -DLAPACKE_WITH_TMG=ON \
262 %{?with_xblas:-DUSE_XBLAS=ON}
263%{__make}
264cd ..
265%endif
266
267install -d build
268cd build
269%cmake .. \
270 -DBUILD_DEPRECATED=ON \
271 %{?with_tests:-DBUILD_TESTING=ON} \
272 -DCBLAS=ON \
273 -DLAPACKE_WITH_TMG=ON \
274 %{?with_xblas:-DUSE_XBLAS=ON}
c42e604c 275%{__make}
3c513ef3 276
840838df
JB
277%{?with_tests:ctest}
278
3c513ef3 279%install
280rm -rf $RPM_BUILD_ROOT
64123b99 281
840838df
JB
282%if %{with static_libs}
283%{__make} -C build-static install \
284 DESTDIR=$RPM_BUILD_ROOT
285%endif
286
287%{__make} -C build install \
584ffaf6 288 DESTDIR=$RPM_BUILD_ROOT
448f9206 289
c7c26a27 290# install man pages, distributing them among blas-devel and lapack-devel
3d16712d 291install -d $RPM_BUILD_ROOT%{_mandir}/man3
e956dfe5 292echo "%defattr(644,root,root,755)" > blasmans.list
e956dfe5 293echo "%defattr(644,root,root,755)" > mans.list
b3147294
JB
294echo "%defattr(644,root,root,755)" > lapackemans.list
295BLAS_ADDITIONAL='aux_blas|(complex|complex16|double|single)_blas_level[123]'
296LAPACK_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'
297MANS_ADDITIONAL="$BLAS_ADDITIONAL|$LAPACK_ADDITIONAL"
c7c26a27
JB
298for f in man/man3/*.3 ; do
299 cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man3
300 bn=$(basename $f)
b3147294 301 if echo "$bn" | grep '\.[cfh]\.3$' ; then
c7c26a27 302 ffn="${bn%.3}"
b3147294
JB
303 elif echo "$bn" | grep -E "^($MANS_ADDITIONAL)\.3\$" ; then
304 ffn="${bn%.3}"
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)
c7c26a27
JB
309 else
310 echo "Unknown manpage: $f"
311 exit 1
312 fi
b3147294 313 if [ -f "BLAS/SRC/$ffn" ] || echo "$ffn" | grep -E "^($BLAS_ADDITIONAL)\$" ; then
c7c26a27 314 echo "%{_mandir}/man3/${bn}*" >> blasmans.list
b3147294 315 elif [ -f "SRC/$ffn" -o -f "INSTALLSRC/$ffn" ] || echo "$ffn" | grep -E "^($LAPACK_ADDITIONAL)\$"; then
c7c26a27 316 echo "%{_mandir}/man3/${bn}*" >> mans.list
b3147294
JB
317 elif [ -f "LAPACKE/include/$ffn" -o -f "LAPACKE/src/$ffn" -o -f "LAPACKE/utils/$ffn" ]; then
318 echo "%{_mandir}/man3/${bn}*" >> lapackemans.list
c7c26a27
JB
319 else
320 echo "Unknown manpage: $f (source file: $ffn)"
321 exit 1
322 fi
323done
448f9206 324
6ec8881e 325%clean
5f8b7996 326rm -rf $RPM_BUILD_ROOT
6ec8881e 327
ed70c195
JB
328%post -p /sbin/ldconfig
329%postun -p /sbin/ldconfig
1d0d5108 330
448f9206 331%post -n blas -p /sbin/ldconfig
332%postun -n blas -p /sbin/ldconfig
3c513ef3 333
c7c26a27
JB
334%post -n lapacke -p /sbin/ldconfig
335%postun -n lapacke -p /sbin/ldconfig
336
3c513ef3 337%files
338%defattr(644,root,root,755)
840838df 339%doc LICENSE README.md
f1593bb3 340%attr(755,root,root) %{_libdir}/liblapack.so.*.*.*
b3147294 341%attr(755,root,root) %ghost %{_libdir}/liblapack.so.3
f1593bb3 342
1d0d5108 343%files devel -f mans.list
f1593bb3 344%defattr(644,root,root,755)
64123b99 345%attr(755,root,root) %{_libdir}/liblapack.so
f5975a02 346%{_includedir}/lapack.h
70328b5c 347%{_pkgconfigdir}/lapack.pc
840838df 348%{_libdir}/cmake/lapack-%{version}
f1593bb3 349
208f9952 350%if %{with static_liba}
f1593bb3 351%files static
352%defattr(644,root,root,755)
353%{_libdir}/liblapack.a
208f9952 354%endif
3c513ef3 355
ea4aa0a4 356%files -n blas
3c513ef3 357%defattr(644,root,root,755)
d51e15b2 358%attr(755,root,root) %{_libdir}/libblas.so.*.*.*
b3147294 359%attr(755,root,root) %ghost %{_libdir}/libblas.so.3
f1593bb3 360
1d0d5108 361%files -n blas-devel -f blasmans.list
f1593bb3 362%defattr(644,root,root,755)
64123b99 363%attr(755,root,root) %{_libdir}/libblas.so
70328b5c 364%{_pkgconfigdir}/blas.pc
f1593bb3 365
208f9952 366%if %{with static_liba}
f1593bb3 367%files -n blas-static
368%defattr(644,root,root,755)
369%{_libdir}/libblas.a
208f9952 370%endif
c7c26a27 371
840838df
JB
372%files -n cblas
373%defattr(644,root,root,755)
374%attr(755,root,root) %{_libdir}/libcblas.so.*.*.*
375%attr(755,root,root) %ghost %{_libdir}/libcblas.so.3
376
377%files -n cblas-devel
378%defattr(644,root,root,755)
379%attr(755,root,root) %{_libdir}/libcblas.so
380%{_includedir}/cblas*.h
381%{_pkgconfigdir}/cblas.pc
382%{_libdir}/cmake/cblas-%{version}
383
208f9952 384%if %{with static_liba}
840838df
JB
385%files -n cblas-static
386%defattr(644,root,root,755)
387%{_libdir}/libcblas.a
208f9952 388%endif
840838df 389
b3147294 390%files -n lapacke -f lapackemans.list
c7c26a27 391%defattr(644,root,root,755)
b3147294 392%doc LAPACKE/{LICENSE,README}
c7c26a27 393%attr(755,root,root) %{_libdir}/liblapacke.so.*.*.*
b3147294 394%attr(755,root,root) %ghost %{_libdir}/liblapacke.so.3
840838df 395%attr(755,root,root) %{_libdir}/libtmglib.so
c7c26a27
JB
396
397%files -n lapacke-devel
398%defattr(644,root,root,755)
399%attr(755,root,root) %{_libdir}/liblapacke.so
c7c26a27 400%{_includedir}/lapacke*.h
971ba2bf 401%{_pkgconfigdir}/lapacke.pc
840838df 402%{_libdir}/cmake/lapacke-%{version}
c7c26a27 403
208f9952 404%if %{with static_liba}
c7c26a27
JB
405%files -n lapacke-static
406%defattr(644,root,root,755)
407%{_libdir}/liblapacke.a
840838df 408%{_libdir}/libtmglib.a
208f9952 409%endif
This page took 0.498501 seconds and 4 git commands to generate.