2012-04-25 23:50:39 +02:00
|
|
|
#
|
|
|
|
# spec file for package openblas
|
|
|
|
#
|
2014-04-05 08:32:53 +02:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2012-04-25 23:50:39 +02:00
|
|
|
#
|
|
|
|
# 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
|
2014-12-04 09:48:36 +01:00
|
|
|
Version: 0.2.13
|
2012-04-25 23:50:39 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: An optimized BLAS library based on GotoBLAS2
|
|
|
|
License: BSD-3-Clause
|
2013-02-17 18:21:36 +01:00
|
|
|
Group: Productivity/Scientific/Math
|
2014-04-05 08:32:53 +02:00
|
|
|
Url: http://www.openblas.net
|
2014-06-12 21:46:26 +02:00
|
|
|
Source0: https://github.com/xianyi/OpenBLAS/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2014-07-18 01:21:38 +02:00
|
|
|
# PATCH-FIX-UPSTREAM openblas-libs.patch: Link against libgfortran
|
2014-06-12 22:06:06 +02:00
|
|
|
Patch0: openblas-libs.patch
|
2013-01-26 12:36:20 +01:00
|
|
|
# PATCH-FIX-UPSTREAM c_xerbla_no-void-return.patch
|
2012-02-26 13:52:52 +01:00
|
|
|
Patch1: c_xerbla_no-void-return.patch
|
2014-12-04 09:48:36 +01:00
|
|
|
# PATCH-FEATURE-OPENSUSE openblas-soname.patch
|
|
|
|
Patch2: openblas-soname.patch
|
2014-07-18 01:21:38 +02:00
|
|
|
# PATCH-FIX-UPSTREAM openblas-noexecstack.patch
|
2014-06-12 22:06:06 +02:00
|
|
|
Patch3: openblas-noexecstack.patch
|
2014-06-12 21:46:26 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-01-26 12:36:20 +01:00
|
|
|
ExclusiveArch: %ix86 ia64 ppc ppc64 x86_64
|
2012-04-25 23:50:39 +02:00
|
|
|
BuildRequires: gcc-fortran
|
2013-01-26 12:36:20 +01:00
|
|
|
BuildRequires: update-alternatives
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%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
|
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%package -n libopenblas0
|
2012-04-25 23:50:39 +02:00
|
|
|
Summary: An optimized BLAS library based on GotoBLAS2, serial version
|
|
|
|
Group: System/Libraries
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%package -n libopenblaso0
|
2012-04-25 23:50:39 +02:00
|
|
|
Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
|
|
|
|
Group: System/Libraries
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%package -n libopenblasp0
|
2012-04-25 23:50:39 +02:00
|
|
|
Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
|
|
|
|
Group: System/Libraries
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%package devel
|
2012-04-25 23:50:39 +02:00
|
|
|
Summary: Development headers and libraries for OpenBLAS
|
|
|
|
Group: Development/Libraries/C and C++
|
2012-09-16 19:22:16 +02:00
|
|
|
Requires: lib%{name}0 = %{version}
|
|
|
|
Requires: lib%{name}o0 = %{version}
|
|
|
|
Requires: lib%{name}p0 = %{version}
|
2012-02-26 13:52:52 +01:00
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%description devel
|
2012-02-26 13:52:52 +01:00
|
|
|
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.
|
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%package devel-static
|
2012-04-25 23:50:39 +02:00
|
|
|
Summary: Static version of OpenBLAS
|
|
|
|
Group: Development/Libraries/C and C++
|
2012-09-16 19:22:16 +02:00
|
|
|
Requires: %{name}-devel = %{version}
|
2012-02-26 13:52:52 +01:00
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
%description devel-static
|
2012-02-26 13:52:52 +01:00
|
|
|
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
|
2013-02-17 18:21:36 +01:00
|
|
|
tar -zxf %{SOURCE0}
|
2014-04-05 08:32:53 +02:00
|
|
|
cd OpenBLAS-%{version}
|
2012-02-26 13:52:52 +01:00
|
|
|
%patch0 -p1
|
|
|
|
%patch1 -p1
|
|
|
|
%patch2 -p1
|
2012-04-25 23:50:39 +02:00
|
|
|
%patch3 -p1
|
2014-04-12 12:03:38 +02:00
|
|
|
|
2014-04-05 08:32:53 +02:00
|
|
|
cd ..
|
2012-04-25 23:50:39 +02:00
|
|
|
# prepare build for serial, threaded and OpenMP versions
|
2014-04-05 08:32:53 +02:00
|
|
|
cp -ar OpenBLAS-%{version} openmp
|
|
|
|
cp -ar OpenBLAS-%{version} threaded
|
|
|
|
mv OpenBLAS-%{version} serial
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%build
|
2012-04-25 23:50:39 +02:00
|
|
|
# Make serial, threaded and OpenMP versions
|
2012-02-26 13:52:52 +01:00
|
|
|
make -C serial DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=0 \
|
2013-07-27 15:48:56 +02:00
|
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=64
|
2012-04-25 23:50:39 +02:00
|
|
|
make -C openmp DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=1 LIBNAMESUFFIX=o \
|
2013-07-27 15:48:56 +02:00
|
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=64
|
2012-04-25 23:50:39 +02:00
|
|
|
make -C threaded DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 LIBNAMESUFFIX=p \
|
2013-07-27 15:48:56 +02:00
|
|
|
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=64
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
# Install serial library and headers
|
2012-10-09 19:31:13 +02:00
|
|
|
make -C serial USE_THREAD=0 PREFIX=%{buildroot}%{_prefix} install
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
# 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
|
2012-10-09 19:31:13 +02:00
|
|
|
rm -rf %{buildroot}%{_prefix}/lib
|
2012-02-26 13:52:52 +01:00
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
|
2012-04-25 23:50:39 +02:00
|
|
|
# Install the serial library
|
2013-02-17 18:21:36 +01:00
|
|
|
install -D -p -m 755 serial/libopenblas.so %{buildroot}%{_libdir}/lib%{name}.so.0
|
2012-04-25 23:50:39 +02:00
|
|
|
install -D -p -m 644 serial/libopenblas.a %{buildroot}%{_libdir}/lib%{name}.a
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
# Install the OpenMP library
|
2013-02-17 18:21:36 +01:00
|
|
|
install -D -p -m 755 openmp/libopenblaso.so %{buildroot}%{_libdir}/lib%{name}o.so.0
|
2012-04-25 23:50:39 +02:00
|
|
|
install -D -p -m 644 openmp/libopenblaso.a %{buildroot}%{_libdir}/lib%{name}o.a
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
# Install the threaded library
|
2013-02-17 18:21:36 +01:00
|
|
|
install -D -p -m 755 threaded/libopenblasp.so %{buildroot}%{_libdir}/lib%{name}p.so.0
|
2012-04-25 23:50:39 +02:00
|
|
|
install -D -p -m 644 threaded/libopenblasp.a %{buildroot}%{_libdir}/lib%{name}p.a
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
# Fix source permissions (also applies to LAPACK)
|
2013-02-17 18:21:36 +01:00
|
|
|
find -name \*.f -exec chmod 644 {} +
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
# 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
|
2012-04-25 23:50:39 +02:00
|
|
|
# for lib in %%{buildroot}%%{_libdir}/libopenblas{,o,p}*.so; do
|
2012-02-26 13:52:52 +01:00
|
|
|
# execstack -c $lib
|
|
|
|
# done
|
|
|
|
|
2014-12-04 09:48:36 +01:00
|
|
|
# Remove Config.cmake (we use custom libraries configuration)
|
|
|
|
rm %{buildroot}%{_prefix}/cmake/OpenBLASConfig.cmake
|
|
|
|
|
2013-01-26 12:36:20 +01:00
|
|
|
%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
|
|
|
|
|
2012-02-26 13:52:52 +01:00
|
|
|
%postun -n libopenblas0 -p /sbin/ldconfig
|
|
|
|
|
2013-01-26 12:36:20 +01:00
|
|
|
%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
|
|
|
|
|
2012-02-26 13:52:52 +01:00
|
|
|
%postun -n libopenblaso0 -p /sbin/ldconfig
|
|
|
|
|
2013-01-26 12:36:20 +01:00
|
|
|
%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
|
|
|
|
|
2012-02-26 13:52:52 +01:00
|
|
|
%postun -n libopenblasp0 -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files -n libopenblas0
|
|
|
|
%defattr(-,root,root,-)
|
2012-07-02 22:49:39 +02:00
|
|
|
%doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE serial/README.md
|
2012-04-25 23:50:39 +02:00
|
|
|
%{_libdir}/lib%{name}.so.*
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%files -n libopenblaso0
|
|
|
|
%defattr(-,root,root,-)
|
2012-04-25 23:50:39 +02:00
|
|
|
%{_libdir}/lib%{name}o.so.*
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%files -n libopenblasp0
|
|
|
|
%defattr(-,root,root,-)
|
2012-04-25 23:50:39 +02:00
|
|
|
%{_libdir}/lib%{name}p.so.*
|
2012-02-26 13:52:52 +01:00
|
|
|
|
|
|
|
%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
|