Merge master
This commit is contained in:
commit
acff18e7fb
22
openblas-0.2.15-constructor.patch
Normal file
22
openblas-0.2.15-constructor.patch
Normal 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
|
@ -1,6 +1,10 @@
|
|||||||
|
%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: 2%{?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
|
||||||
@ -10,29 +14,46 @@ 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 test link against functions in lapacke 3.5.0 if only 3.4.0 is available
|
# Don't use constructor priorities
|
||||||
Patch2: openblas-0.2.10-lapacke.patch
|
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
|
||||||
%ifnarch ppc64le
|
|
||||||
# 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
|
%endif
|
||||||
|
|
||||||
# LAPACK
|
# LAPACK
|
||||||
|
%if %{with system_lapack}
|
||||||
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
|
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
|
||||||
BuildRequires: lapack-devel%{?_isa}
|
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} > 16
|
%if 0%{?fedora}
|
||||||
%global lapacke 1
|
%global lapacke 1
|
||||||
%else
|
%else
|
||||||
%global lapacke 0
|
%global lapacke 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%else
|
||||||
|
# Use bundled LAPACK
|
||||||
|
%global lapacke 1
|
||||||
|
Provides: bundled(lapack) = %{lapackver}
|
||||||
|
%endif
|
||||||
|
|
||||||
# Build 64-bit interface binaries?
|
# Build 64-bit interface binaries?
|
||||||
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
|
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
|
||||||
# RPM too old to know __isa_bits in RHEL 5, and lapack64 doesn't exist in RHEL 6
|
# RPM too old to know __isa_bits in RHEL 5, and lapack64 doesn't exist in RHEL 6
|
||||||
@ -45,9 +66,11 @@ BuildRequires: lapack-static%{?_isa}
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with system_lapack}
|
||||||
%if %build64
|
%if %build64
|
||||||
BuildRequires: lapack64-static
|
BuildRequires: lapack64-static
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
# Upstream supports the package only on these architectures.
|
# Upstream supports the package only on these architectures.
|
||||||
# Runtime processor detection is not available on other archs.
|
# Runtime processor detection is not available on other archs.
|
||||||
@ -179,17 +202,21 @@ This package contains the static libraries.
|
|||||||
# Untar source
|
# Untar source
|
||||||
tar zxf %{SOURCE0}
|
tar zxf %{SOURCE0}
|
||||||
cd OpenBLAS-%{version}
|
cd OpenBLAS-%{version}
|
||||||
|
%if %{with system_lapack}
|
||||||
%patch0 -p1 -b .system_lapack
|
%patch0 -p1 -b .system_lapack
|
||||||
|
%endif
|
||||||
%patch1 -p1 -b .libname
|
%patch1 -p1 -b .libname
|
||||||
%if 0%{?fedora} > 0 && 0%{?fedora} < 21
|
%if 0%{?rhel} == 5
|
||||||
%patch2 -p1 -b .lapacke
|
%patch2 -p1 -b .constructor
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Fix source permissions
|
# Fix source permissions
|
||||||
find -name \*.f -exec chmod 644 {} \;
|
find -name \*.f -exec chmod 644 {} \;
|
||||||
|
|
||||||
|
%if %{with system_lapack}
|
||||||
# Get rid of bundled LAPACK sources
|
# Get rid of bundled LAPACK sources
|
||||||
rm -rf lapack-netlib
|
rm -rf lapack-netlib
|
||||||
|
%endif
|
||||||
|
|
||||||
# Make serial, threaded and OpenMP versions; as well as 64-bit versions
|
# Make serial, threaded and OpenMP versions; as well as 64-bit versions
|
||||||
cd ..
|
cd ..
|
||||||
@ -202,6 +229,7 @@ done
|
|||||||
%endif
|
%endif
|
||||||
mv OpenBLAS-%{version} serial
|
mv OpenBLAS-%{version} serial
|
||||||
|
|
||||||
|
%if %{with system_lapack}
|
||||||
# Setup 32-bit interface LAPACK
|
# Setup 32-bit interface LAPACK
|
||||||
mkdir netliblapack
|
mkdir netliblapack
|
||||||
cd netliblapack
|
cd netliblapack
|
||||||
@ -274,11 +302,10 @@ for d in {serial,threaded,openmp}64{,_}; do
|
|||||||
done
|
done
|
||||||
rm -rf netliblapack64
|
rm -rf netliblapack64
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{lapacke}
|
%if !%{lapacke}
|
||||||
LAPACKE="NO_LAPACKE=0"
|
|
||||||
%else
|
|
||||||
LAPACKE="NO_LAPACKE=1"
|
LAPACKE="NO_LAPACKE=1"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -325,7 +352,7 @@ rm -rf %{buildroot}
|
|||||||
make -C serial USE_THREAD=0 PREFIX=%{buildroot} OPENBLAS_LIBRARY_DIR=%{buildroot}%{_libdir} OPENBLAS_INCLUDE_DIR=%{buildroot}%{_includedir}/%name OPENBLAS_BINARY_DIR=%{buildroot}%{_bindir} OPENBLAS_CMAKE_DIR=%{buildroot}%{_libdir}/cmake install
|
make -C serial USE_THREAD=0 PREFIX=%{buildroot} OPENBLAS_LIBRARY_DIR=%{buildroot}%{_libdir} OPENBLAS_INCLUDE_DIR=%{buildroot}%{_includedir}/%name OPENBLAS_BINARY_DIR=%{buildroot}%{_bindir} OPENBLAS_CMAKE_DIR=%{buildroot}%{_libdir}/cmake install
|
||||||
|
|
||||||
# Copy lapacke include files
|
# Copy lapacke include files
|
||||||
%if %{lapacke}
|
%if %{with system_lapack} && %{lapacke}
|
||||||
cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name}
|
cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -350,7 +377,7 @@ olibname=`echo ${slibname} | sed "s|lib%{name}|lib%{name}o|g"`
|
|||||||
install -D -p -m 644 openmp/${olibname}.a %{buildroot}%{_libdir}/lib%{name}o.a
|
install -D -p -m 644 openmp/${olibname}.a %{buildroot}%{_libdir}/lib%{name}o.a
|
||||||
if [[ "$suffix" != "" ]]; then
|
if [[ "$suffix" != "" ]]; then
|
||||||
oname=$(echo $olibname | sed "s|$suffix||g")
|
oname=$(echo $olibname | sed "s|$suffix||g")
|
||||||
else
|
else
|
||||||
oname=${olibname}
|
oname=${olibname}
|
||||||
fi
|
fi
|
||||||
install -D -p -m 755 openmp/${olibname}.so %{buildroot}%{_libdir}/${oname}.so
|
install -D -p -m 755 openmp/${olibname}.so %{buildroot}%{_libdir}/${oname}.so
|
||||||
@ -443,7 +470,7 @@ 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
|
||||||
|
|
||||||
%ifnarch ppc64le
|
%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
|
||||||
@ -560,6 +587,12 @@ 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
|
||||||
|
- Allow conditional build with or without system lapack, default to without
|
||||||
|
|
||||||
* Tue Dec 01 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.2.15-2
|
* Tue Dec 01 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.2.15-2
|
||||||
- Enable armv7hl and ppc64le architectures.
|
- Enable armv7hl and ppc64le architectures.
|
||||||
- Build versions of the 64-bit libraries with an additional suffix
|
- Build versions of the 64-bit libraries with an additional suffix
|
||||||
|
Loading…
Reference in New Issue
Block a user