Versionize lapack provide. Pull in patches to build in EPEL5 and EPEL7.

This commit is contained in:
Susi Lehtola 2016-01-12 20:30:18 +01:00
parent 0d5c1dbfb3
commit f2466da443
2 changed files with 65 additions and 7 deletions

View File

@ -0,0 +1,22 @@
diff -up OpenBLAS-0.2.15/driver/others/memory.c.orig OpenBLAS-0.2.15/driver/others/memory.c
--- OpenBLAS-0.2.15/driver/others/memory.c.orig 2015-10-27 21:44:50.000000000 +0100
+++ OpenBLAS-0.2.15/driver/others/memory.c 2016-01-12 20:22:14.935338309 +0100
@@ -1338,7 +1338,7 @@ static void gotoblas_memory_init(void) {
static int gotoblas_initialized = 0;
-void CONSTRUCTOR gotoblas_init(void) {
+void gotoblas_init(void) {
if (gotoblas_initialized) return;
@@ -1381,7 +1381,7 @@ void CONSTRUCTOR gotoblas_init(void) {
}
-void DESTRUCTOR gotoblas_quit(void) {
+void gotoblas_quit(void) {
if (gotoblas_initialized == 0) return;
diff -up OpenBLAS-0.2.15/getarch.c.orig OpenBLAS-0.2.15/getarch.c

View File

@ -1,8 +1,10 @@
%bcond_with system_lapack %bcond_with system_lapack
# Version of bundled lapack
%global lapackver 3.5.0
Name: openblas Name: openblas
Version: 0.2.15 Version: 0.2.15
Release: 3%{?dist} Release: 4%{?dist}
Summary: An optimized BLAS library based on GotoBLAS2 Summary: An optimized BLAS library based on GotoBLAS2
Group: Development/Libraries Group: Development/Libraries
License: BSD License: BSD
@ -12,11 +14,26 @@ Source0: https://github.com/xianyi/OpenBLAS/archive/v%{version}.tar.gz
Patch0: openblas-0.2.15-system_lapack.patch Patch0: openblas-0.2.15-system_lapack.patch
# Drop extra p from threaded library name # Drop extra p from threaded library name
Patch1: openblas-0.2.5-libname.patch Patch1: openblas-0.2.5-libname.patch
# Don't use constructor priorities
Patch2: openblas-0.2.15-constructor.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc-gfortran BuildRequires: gcc-gfortran
# For execstack
# Do we have execstack?
%if 0%{?rhel} == 7
%ifarch ppc64le
%global execstack 0
%else
%global execstack 1
%endif
%else
%global execstack 1
%endif
%if %{execstack}
BuildRequires: /usr/bin/execstack BuildRequires: /usr/bin/execstack
%endif
# LAPACK # LAPACK
%if %{with system_lapack} %if %{with system_lapack}
%if 0%{?rhel} == 5 || 0%{?rhel} == 6 %if 0%{?rhel} == 5 || 0%{?rhel} == 6
@ -24,17 +41,17 @@ BuildRequires: lapack-devel%{?_isa}
%else %else
BuildRequires: lapack-static%{?_isa} BuildRequires: lapack-static%{?_isa}
%endif %endif
# Do we have LAPACKE? (Needs at least lapack 3.4.0) # Do we have LAPACKE? (Needs at least lapack 3.4.0)
%if 0%{?fedora} %if 0%{?fedora}
%global lapacke 1 %global lapacke 1
%else %else
%global lapacke 0 %global lapacke 0
%endif %endif
%else
%global lapacke 1
Provides: bundled(lapack) %else
# Use bundled LAPACK
%global lapacke 1
Provides: bundled(lapack) = %{lapackver}
%endif %endif
# Build 64-bit interface binaries? # Build 64-bit interface binaries?
@ -189,6 +206,9 @@ cd OpenBLAS-%{version}
%patch0 -p1 -b .system_lapack %patch0 -p1 -b .system_lapack
%endif %endif
%patch1 -p1 -b .libname %patch1 -p1 -b .libname
%if 0%{?rhel} == 5
%patch2 -p1 -b .constructor
%endif
# Fix source permissions # Fix source permissions
find -name \*.f -exec chmod 644 {} \; find -name \*.f -exec chmod 644 {} \;
@ -450,10 +470,12 @@ ln -sf ${pname64_}.so lib%{name}p64_.so
ln -sf ${pname64_}.so lib%{name}p64_.so.0 ln -sf ${pname64_}.so lib%{name}p64_.so.0
%endif %endif
%if %{execstack}
# Get rid of executable stacks # Get rid of executable stacks
for lib in %{buildroot}%{_libdir}/libopenblas*.so; do for lib in %{buildroot}%{_libdir}/libopenblas*.so; do
execstack -c $lib execstack -c $lib
done done
%endif
# Get rid of generated CMake config # Get rid of generated CMake config
rm -rf %{buildroot}%{_libdir}/cmake rm -rf %{buildroot}%{_libdir}/cmake
@ -488,45 +510,55 @@ rm -rf %{buildroot}%{_libdir}/cmake
rm -rf %{buildroot} rm -rf %{buildroot}
%files %files
%defattr(-,root,root,-)
%doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE %doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE
%{_libdir}/lib%{name}-*.so %{_libdir}/lib%{name}-*.so
%{_libdir}/lib%{name}.so.* %{_libdir}/lib%{name}.so.*
%files openmp %files openmp
%defattr(-,root,root,-)
%{_libdir}/lib%{name}o-*.so %{_libdir}/lib%{name}o-*.so
%{_libdir}/lib%{name}o.so.* %{_libdir}/lib%{name}o.so.*
%files threads %files threads
%defattr(-,root,root,-)
%{_libdir}/lib%{name}p-*.so %{_libdir}/lib%{name}p-*.so
%{_libdir}/lib%{name}p.so.* %{_libdir}/lib%{name}p.so.*
%if %build64 %if %build64
%files serial64 %files serial64
%defattr(-,root,root,-)
%{_libdir}/lib%{name}64-*.so %{_libdir}/lib%{name}64-*.so
%{_libdir}/lib%{name}64.so.* %{_libdir}/lib%{name}64.so.*
%files openmp64 %files openmp64
%defattr(-,root,root,-)
%{_libdir}/lib%{name}o64-*.so %{_libdir}/lib%{name}o64-*.so
%{_libdir}/lib%{name}o64.so.* %{_libdir}/lib%{name}o64.so.*
%files threads64 %files threads64
%defattr(-,root,root,-)
%{_libdir}/lib%{name}p64-*.so %{_libdir}/lib%{name}p64-*.so
%{_libdir}/lib%{name}p64.so.* %{_libdir}/lib%{name}p64.so.*
%files serial64_ %files serial64_
%defattr(-,root,root,-)
%{_libdir}/lib%{name}64_-*.so %{_libdir}/lib%{name}64_-*.so
%{_libdir}/lib%{name}64_.so.* %{_libdir}/lib%{name}64_.so.*
%files openmp64_ %files openmp64_
%defattr(-,root,root,-)
%{_libdir}/lib%{name}o64_-*.so %{_libdir}/lib%{name}o64_-*.so
%{_libdir}/lib%{name}o64_.so.* %{_libdir}/lib%{name}o64_.so.*
%files threads64_ %files threads64_
%defattr(-,root,root,-)
%{_libdir}/lib%{name}p64_-*.so %{_libdir}/lib%{name}p64_-*.so
%{_libdir}/lib%{name}p64_.so.* %{_libdir}/lib%{name}p64_.so.*
%endif %endif
%files devel %files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/ %{_includedir}/%{name}/
%{_libdir}/lib%{name}.so %{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}o.so %{_libdir}/lib%{name}o.so
@ -541,6 +573,7 @@ rm -rf %{buildroot}
%endif %endif
%files static %files static
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.a %{_libdir}/lib%{name}.a
%{_libdir}/lib%{name}o.a %{_libdir}/lib%{name}o.a
%{_libdir}/lib%{name}p.a %{_libdir}/lib%{name}p.a
@ -554,6 +587,9 @@ rm -rf %{buildroot}
%endif %endif
%changelog %changelog
* Tue Jan 12 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.2.15-4
- Add version to bundled lapack provide.
* Mon Jan 11 2016 Orion Poplawski <orion@cora.nwra.com> - 0.2.15-3 * Mon Jan 11 2016 Orion Poplawski <orion@cora.nwra.com> - 0.2.15-3
- Allow conditional build with or without system lapack, default to without - Allow conditional build with or without system lapack, default to without