1218b58a91
- version 0.2.6 * Improved OpenMP performance slightly. (d744c9) * Improved cblas.h compatibility with Intel MKL.(#185) * Fixed the overflowing bug in single thread cholesky factorization. * Fixed the overflowing buffer bug of multithreading hbmv and sbmv.(#174) * Added AMD Bulldozer x86-64 S/DGEMM AVX kernels. (Thank Werner Saar) We will tune the performance in future. * Auto-detect Intel Xeon E7540. * Fixed the overflowing buffer bug of gemv. (#173) * Fixed the bug of s/cdot about invalid reading NAN on x86_64. (#189) - rebase patch0 openblas-0.2.6-libs.patch OBS-URL: https://build.opensuse.org/request/show/157145 OBS-URL: https://build.opensuse.org/package/show/science/openblas?expand=0&rev=18
252 lines
8.5 KiB
RPMSpec
252 lines
8.5 KiB
RPMSpec
#
|
|
# spec file for package openblas
|
|
#
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: openblas
|
|
Version: 0.2.6
|
|
Release: 0
|
|
Summary: An optimized BLAS library based on GotoBLAS2
|
|
License: BSD-3-Clause
|
|
Group: Productivity/Scientific/Math
|
|
Url: https://github.com/xianyi/OpenBLAS/
|
|
Source0: http://github.com/xianyi/OpenBLAS/tarball/v0.2.5/xianyi-OpenBLAS-v%{version}-0-g54e7b37.tar.gz
|
|
# LAPACK
|
|
Source1: http://www.netlib.org/lapack/lapack-3.4.2.tgz
|
|
# PATCH-FIX-UPSTREAM openblas-0.1.1-libs.patch: Link against libgfortran
|
|
Patch0: openblas-0.2.6-libs.patch
|
|
# PATCH-FIX-UPSTREAM c_xerbla_no-void-return.patch
|
|
Patch1: c_xerbla_no-void-return.patch
|
|
# PATCH-FEATURE-OPENSUSE openblas-0.1.0-soname.patch
|
|
Patch2: openblas-0.1.0-soname.patch
|
|
# PATCH-FIX-UPSTREAM openblas-0.2.1-noexecstack.patch
|
|
Patch3: openblas-0.2.1-noexecstack.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
ExclusiveArch: %ix86 ia64 ppc ppc64 x86_64
|
|
BuildRequires: gcc-fortran
|
|
BuildRequires: update-alternatives
|
|
Requires(post): update-alternatives
|
|
Requires(preun): update-alternatives
|
|
|
|
%description
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
%package -n libopenblas0
|
|
Summary: An optimized BLAS library based on GotoBLAS2, serial version
|
|
Group: System/Libraries
|
|
|
|
%description -n libopenblas0
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
|
|
%package -n libopenblaso0
|
|
Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
|
|
Group: System/Libraries
|
|
|
|
%description -n libopenblaso0
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
This package contains the library compiled with OpenMP support.
|
|
|
|
%package -n libopenblasp0
|
|
Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
|
|
Group: System/Libraries
|
|
|
|
%description -n libopenblasp0
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
This package contains the library compiled with threading support.
|
|
|
|
%package devel
|
|
Summary: Development headers and libraries for OpenBLAS
|
|
Group: Development/Libraries/C and C++
|
|
Requires: lib%{name}0 = %{version}
|
|
Requires: lib%{name}o0 = %{version}
|
|
Requires: lib%{name}p0 = %{version}
|
|
|
|
%description devel
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
This package contains the development headers and libraries.
|
|
|
|
%package devel-static
|
|
Summary: Static version of OpenBLAS
|
|
Group: Development/Libraries/C and C++
|
|
Requires: %{name}-devel = %{version}
|
|
|
|
%description devel-static
|
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
|
|
project is supported by the Lab of Parallel Software and Computational Science,
|
|
ISCAS. http://www.rdcps.ac.cn
|
|
|
|
This package contains the static libraries.
|
|
|
|
%prep
|
|
%setup -q -c -T
|
|
|
|
# Untar source
|
|
tar -zxf %{SOURCE0}
|
|
mv xianyi-OpenBLAS-*/ xianyi-OpenBLAS
|
|
cd xianyi-OpenBLAS
|
|
%patch0 -p1
|
|
%patch1 -p1
|
|
%patch2 -p1
|
|
%patch3 -p1
|
|
cd ..
|
|
|
|
# prepare build for serial, threaded and OpenMP versions
|
|
cp -ar xianyi-OpenBLAS openmp
|
|
cp -ar xianyi-OpenBLAS threaded
|
|
mv xianyi-OpenBLAS serial
|
|
|
|
# Copy LAPACK sources
|
|
for dir in openmp threaded serial; do
|
|
cp %{SOURCE1} $dir
|
|
done
|
|
|
|
%build
|
|
# Make serial, threaded and OpenMP versions
|
|
make -C serial DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=0 \
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
|
|
make -C openmp DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=1 LIBNAMESUFFIX=o \
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
|
|
make -C threaded DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 LIBNAMESUFFIX=p \
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
|
|
|
|
%install
|
|
# Install serial library and headers
|
|
make -C serial USE_THREAD=0 PREFIX=%{buildroot}%{_prefix} install
|
|
|
|
# Move include files to package specific directory, so that they don't clash with reference BLAS and LAPACK
|
|
mkdir %{buildroot}%{_includedir}/%{name}
|
|
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/%{name}
|
|
|
|
# Put libraries in correct location
|
|
rm -rf %{buildroot}%{_prefix}/lib
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
# Install the serial library
|
|
install -D -p -m 755 serial/libopenblas.so %{buildroot}%{_libdir}/lib%{name}.so.0
|
|
install -D -p -m 644 serial/libopenblas.a %{buildroot}%{_libdir}/lib%{name}.a
|
|
|
|
# Install the OpenMP library
|
|
install -D -p -m 755 openmp/libopenblaso.so %{buildroot}%{_libdir}/lib%{name}o.so.0
|
|
install -D -p -m 644 openmp/libopenblaso.a %{buildroot}%{_libdir}/lib%{name}o.a
|
|
|
|
# Install the threaded library
|
|
install -D -p -m 755 threaded/libopenblasp.so %{buildroot}%{_libdir}/lib%{name}p.so.0
|
|
install -D -p -m 644 threaded/libopenblasp.a %{buildroot}%{_libdir}/lib%{name}p.a
|
|
|
|
# Fix source permissions (also applies to LAPACK)
|
|
find -name \*.f -exec chmod 644 {} +
|
|
|
|
# Fix symlinks
|
|
pushd %{buildroot}%{_libdir}
|
|
# Serial libraries
|
|
ln -sf lib%{name}.so.0 lib%{name}.so
|
|
# OpenMP libraries
|
|
ln -sf lib%{name}o.so.0 lib%{name}o.so
|
|
# Threaded libraries
|
|
ln -sf lib%{name}p.so.0 lib%{name}p.so
|
|
|
|
# Get rid of executable stacks
|
|
# for lib in %%{buildroot}%%{_libdir}/libopenblas{,o,p}*.so; do
|
|
# execstack -c $lib
|
|
# done
|
|
|
|
%post -n libopenblas0
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/libblas.so.3 libblas.so.3 %{_libdir}/libopenblas.so.0 20
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/liblapack.so.3 liblapack.so.3 %{_libdir}/libopenblas.so.0 20
|
|
/sbin/ldconfig
|
|
|
|
%preun -n libopenblas0
|
|
if [ "$1" = 0 ] ; then
|
|
"%_sbindir/update-alternatives" --remove libblas.so.3 %{_libdir}/libopenblas.so.0
|
|
"%_sbindir/update-alternatives" --remove liblapack.so.3 %{_libdir}/libopenblas.so.0
|
|
fi
|
|
|
|
%postun -n libopenblas0 -p /sbin/ldconfig
|
|
|
|
%post -n libopenblaso0
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/libblas.so.3 libblas.so.3 %{_libdir}/libopenblaso.so.0 20
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/liblapack.so.3 liblapack.so.3 %{_libdir}/libopenblaso.so.0 20
|
|
/sbin/ldconfig
|
|
|
|
%preun -n libopenblaso0
|
|
if [ "$1" = 0 ] ; then
|
|
"%_sbindir/update-alternatives" --remove libblas.so.3 %{_libdir}/libopenblaso.so.0
|
|
"%_sbindir/update-alternatives" --remove liblapack.so.3 %{_libdir}/libopenblaso.so.0
|
|
fi
|
|
|
|
%postun -n libopenblaso0 -p /sbin/ldconfig
|
|
|
|
%post -n libopenblasp0
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/libblas.so.3 libblas.so.3 %{_libdir}/libopenblasp.so.0 20
|
|
"%_sbindir/update-alternatives" --install \
|
|
%{_libdir}/liblapack.so.3 liblapack.so.3 %{_libdir}/libopenblasp.so.0 20
|
|
/sbin/ldconfig
|
|
|
|
%preun -n libopenblasp0
|
|
if [ "$1" = 0 ] ; then
|
|
"%_sbindir/update-alternatives" --remove libblas.so.3 %{_libdir}/libopenblasp.so.0
|
|
"%_sbindir/update-alternatives" --remove liblapack.so.3 %{_libdir}/libopenblasp.so.0
|
|
fi
|
|
|
|
%postun -n libopenblasp0 -p /sbin/ldconfig
|
|
|
|
%files -n libopenblas0
|
|
%defattr(-,root,root,-)
|
|
%doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE serial/README.md
|
|
%{_libdir}/lib%{name}.so.*
|
|
|
|
%files -n libopenblaso0
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/lib%{name}o.so.*
|
|
|
|
%files -n libopenblasp0
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/lib%{name}p.so.*
|
|
|
|
%files devel
|
|
%defattr(-,root,root,-)
|
|
%{_includedir}/%{name}
|
|
%{_libdir}/lib%{name}.so
|
|
%{_libdir}/lib%{name}o.so
|
|
%{_libdir}/lib%{name}p.so
|
|
|
|
%files devel-static
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/lib%{name}.a
|
|
%{_libdir}/lib%{name}o.a
|
|
%{_libdir}/lib%{name}p.a
|
|
|
|
%changelog
|