initial import

This commit is contained in:
Iñaki Úcar 2020-06-30 21:22:15 +02:00
parent c67202bbab
commit 1c707950c8
3 changed files with 383 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/flexiblas-3.0.0.tar.xz

381
flexiblas.spec Normal file
View File

@ -0,0 +1,381 @@
%bcond_without system_lapack
%bcond_without atlas
%bcond_without blis
%bcond_without openblas
%if %{with openblas}
%global default_backend openblas-serial
%else
%global default_backend netlib
%endif
%global major_version 3
%global minor_version 0
%global patch_version 0
Name: flexiblas
Version: %{major_version}.%{minor_version}.%{patch_version}
Release: 2%{?dist}
Summary: A BLAS/LAPACK wrapper library with runtime exchangeable backends
# GPLv3 except contributed/ and test/, which are BSD
License: GPLv3 and BSD
URL: https://www.mpi-magdeburg.mpg.de/projects/%{name}
Source0: https://csc.mpi-magdeburg.mpg.de/mpcsc/software/%{name}/%{name}-%{version}.tar.xz
BuildRequires: cmake, python
BuildRequires: gcc-fortran, gcc-c++
%if %{with system_lapack}
BuildRequires: blas-static, lapack-static
%endif
%if %{with atlas}
BuildRequires: atlas-devel
%endif
%if %{with blis}
BuildRequires: blis-devel
%endif
%if %{with openblas}
BuildRequires: openblas-devel
%endif
%global _description %{expand:
FlexiBLAS is a wrapper library that enables the exchange of the BLAS and
LAPACK implementation used by a program without recompiling or relinking it.
}
%description %_description
%package netlib
Summary: FlexiBLAS wrapper library
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-%{default_backend}%{?_isa} = %{version}-%{release}
%description netlib %_description
This package contains the wrapper library with 32-bit integer support.
%package devel
Summary: Development headers and libraries for FlexiBLAS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %_description
This package contains the development headers and libraries.
%if %{with atlas}
%package atlas
Summary: FlexiBLAS wrappers for ATLAS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description atlas %_description
This package contains FlexiBLAS wrappers for the ATLAS project.
%endif
%if %{with blis}
%package blis-serial
Summary: FlexiBLAS wrappers for BLIS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-serial %_description
This package contains FlexiBLAS wrappers for the sequential library compiled
with a 32-integer interface.
%package blis-openmp
Summary: FlexiBLAS wrappers for BLIS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-openmp %_description
This package contains FlexiBLAS wrappers for the library compiled with
OpenMP support with a 32-integer interface.
%package blis-threads
Summary: FlexiBLAS wrappers for BLIS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-threads %_description
This package contains FlexiBLAS wrappers for the library compiled with
threading support with a 32-integer interface.
%endif
%if %{with openblas}
%package openblas-serial
Summary: FlexiBLAS wrappers for OpenBLAS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-serial %_description
This package contains FlexiBLAS wrappers for the sequential library compiled
with a 32-integer interface.
%package openblas-openmp
Summary: FlexiBLAS wrappers for OpenBLAS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-openmp %_description
This package contains FlexiBLAS wrappers for the library compiled with
OpenMP support with a 32-integer interface.
%package openblas-threads
Summary: FlexiBLAS wrappers for OpenBLAS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-threads %_description
This package contains FlexiBLAS wrappers for the library compiled with
threading support with a 32-integer interface.
%endif
%if 0%{?__isa_bits} == 64
%package netlib64
Summary: FlexiBLAS wrapper library (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-%{default_backend}64%{?_isa} = %{version}-%{release}
%description netlib64 %_description
This package contains the wrapper library with 64-bit integer support.
%ifnarch s390x
%if %{with blis}
%package blis-serial64
Summary: FlexiBLAS wrappers for BLIS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-serial64 %_description
This package contains FlexiBLAS wrappers for the sequential library compiled
with a 64-integer interface.
%package blis-openmp64
Summary: FlexiBLAS wrappers for BLIS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-openmp64 %_description
This package contains FlexiBLAS wrappers for the library compiled with
OpenMP support with a 64-integer interface.
%package blis-threads64
Summary: FlexiBLAS wrappers for BLIS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description blis-threads64 %_description
This package contains FlexiBLAS wrappers for the library compiled with
threading support with a 64-integer interface.
%endif
%endif
%if %{with openblas}
%package openblas-serial64
Summary: FlexiBLAS wrappers for OpenBLAS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-serial64 %_description
This package contains FlexiBLAS wrappers for the sequential library compiled
with a 64-integer interface.
%package openblas-openmp64
Summary: FlexiBLAS wrappers for OpenBLAS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-openmp64 %_description
This package contains FlexiBLAS wrappers for the library compiled with
OpenMP support with a 64-integer interface.
%package openblas-threads64
Summary: FlexiBLAS wrappers for OpenBLAS (64-bit)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description openblas-threads64 %_description
This package contains FlexiBLAS wrappers for the library compiled with
threading support with a 64-integer interface.
%endif
%endif
%prep
%autosetup -p1
%build
%if %{with system_lapack}
rm -rf contributed
%endif
%cmake -B build \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if %{with system_lapack}
-DSYS_BLAS_LIBRARY=%{_libdir}/libblas.a \
-DSYS_LAPACK_LIBRARY=%{_libdir}/liblapack_pic.a \
%endif
-DINTEGER8=OFF \
-DTESTS=ON
%make_build -C build
%if 0%{?__isa_bits} == 64
%cmake -B build64 \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if %{with system_lapack}
-DSYS_BLAS_LIBRARY=%{_libdir}/libblas64.a \
-DSYS_LAPACK_LIBRARY=%{_libdir}/liblapack_pic64.a \
%endif
-DINTEGER8=ON \
-DTESTS=ON
%make_build -C build64
%endif
%install
%make_install -C build
echo "default = %{default_backend}" > %{buildroot}%{_sysconfdir}/%{name}rc
%if 0%{?__isa_bits} == 64
%make_install -C build64
echo "default = %{default_backend}" > %{buildroot}%{_sysconfdir}/%{name}64rc
%endif
# set Fedora-friendly names
rename -- serial -serial %{buildroot}%{_libdir}/%{name}*/* || true
rename -- openmp -openmp %{buildroot}%{_libdir}/%{name}*/* || true
rename -- pthread -threads %{buildroot}%{_libdir}/%{name}*/* || true
rename NETLIB netlib %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename ATLAS atlas %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename Blis blis %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename OpenBLAS openblas %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename -- Serial -serial %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename -- OpenMP -openmp %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
rename -- PThread -threads %{buildroot}%{_sysconfdir}/%{name}*.d/* || true
find %{buildroot}%{_sysconfdir} -type f \
-exec sed -i 's NETLIB netlib gI' {} \;\
-exec sed -i 's ATLAS atlas gI' {} \;\
-exec sed -i 's Blis blis gI' {} \;\
-exec sed -i 's OpenBLAS openblas gI' {} \;\
-exec sed -i 's Serial -serial gI' {} \;\
-exec sed -i 's OpenMP -openmp gI' {} \;\
-exec sed -i 's PThread -threads gI' {} \;
%check
export FLEXIBLAS_TEST=%{buildroot}%{_libdir}/%{name}/lib%{name}_%{default_backend}.so
make -C build test
%files
%license COPYING COPYING.NETLIB
%doc ISSUES.md README.md CHANGELOG
%{_mandir}/man3/%{name}_*
%files netlib
%config(noreplace) %{_sysconfdir}/%{name}rc
%dir %{_sysconfdir}/%{name}rc.d
%{_sysconfdir}/%{name}rc.d/netlib.conf
%{_bindir}/%{name}
%{_libdir}/lib%{name}.so.%{major_version}
%{_libdir}/lib%{name}.so.%{major_version}.%{minor_version}
%{_libdir}/lib%{name}_api.so.%{major_version}
%{_libdir}/lib%{name}_api.so.%{major_version}.%{minor_version}
%{_libdir}/lib%{name}_mgmt.so.%{major_version}
%{_libdir}/lib%{name}_mgmt.so.%{major_version}.%{minor_version}
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/lib%{name}_fallback_lapack.so
%{_libdir}/%{name}/lib%{name}_netlib.so
%{_libdir}/%{name}/lib%{name}_hook_dummy.so
%{_libdir}/%{name}/lib%{name}_hook_profile.so
%{_mandir}/man1/%{name}.1*
%files devel
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}_api.so
%{_libdir}/lib%{name}_mgmt.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/pkgconfig/%{name}_api.pc
%if 0%{?__isa_bits} == 64
%{_includedir}/%{name}64
%{_libdir}/lib%{name}64.so
%{_libdir}/lib%{name}64_api.so
%{_libdir}/lib%{name}64_mgmt.so
%{_libdir}/pkgconfig/%{name}64.pc
%{_libdir}/pkgconfig/%{name}64_api.pc
%endif
%{_mandir}/man7/%{name}-api.7*
%if %{with atlas}
%files atlas
%{_sysconfdir}/%{name}rc.d/atlas.conf
%{_libdir}/%{name}/lib%{name}_atlas.so
%endif
%if %{with blis}
%files blis-serial
%{_sysconfdir}/%{name}rc.d/blis-serial.conf
%{_libdir}/%{name}/lib%{name}_blis-serial.so
%files blis-openmp
%{_sysconfdir}/%{name}rc.d/blis-openmp.conf
%{_libdir}/%{name}/lib%{name}_blis-openmp.so
%files blis-threads
%{_sysconfdir}/%{name}rc.d/blis-threads.conf
%{_libdir}/%{name}/lib%{name}_blis-threads.so
%endif
%if %{with openblas}
%files openblas-serial
%{_sysconfdir}/%{name}rc.d/openblas-serial.conf
%{_libdir}/%{name}/lib%{name}_openblas-serial.so
%files openblas-openmp
%{_sysconfdir}/%{name}rc.d/openblas-openmp.conf
%{_libdir}/%{name}/lib%{name}_openblas-openmp.so
%files openblas-threads
%{_sysconfdir}/%{name}rc.d/openblas-threads.conf
%{_libdir}/%{name}/lib%{name}_openblas-threads.so
%endif
%if 0%{?__isa_bits} == 64
%files netlib64
%config(noreplace) %{_sysconfdir}/%{name}64rc
%dir %{_sysconfdir}/%{name}64rc.d
%{_sysconfdir}/%{name}64rc.d/netlib.conf
%{_bindir}/%{name}64
%{_libdir}/lib%{name}64.so.%{major_version}
%{_libdir}/lib%{name}64.so.%{major_version}.%{minor_version}
%{_libdir}/lib%{name}64_api.so.%{major_version}
%{_libdir}/lib%{name}64_api.so.%{major_version}.%{minor_version}
%{_libdir}/lib%{name}64_mgmt.so.%{major_version}
%{_libdir}/lib%{name}64_mgmt.so.%{major_version}.%{minor_version}
%dir %{_libdir}/%{name}64
%{_libdir}/%{name}64/lib%{name}_fallback_lapack.so
%{_libdir}/%{name}64/lib%{name}_netlib.so
%{_libdir}/%{name}64/lib%{name}_hook_dummy.so
%{_libdir}/%{name}64/lib%{name}_hook_profile.so
%{_mandir}/man1/%{name}64.1*
%ifnarch s390x
%if %{with blis}
%files blis-serial64
%{_sysconfdir}/%{name}64rc.d/blis-serial64.conf
%{_libdir}/%{name}64/lib%{name}_blis-serial64.so
%files blis-openmp64
%{_sysconfdir}/%{name}64rc.d/blis-openmp64.conf
%{_libdir}/%{name}64/lib%{name}_blis-openmp64.so
%files blis-threads64
%{_sysconfdir}/%{name}64rc.d/blis-threads64.conf
%{_libdir}/%{name}64/lib%{name}_blis-threads64.so
%endif
%endif
%if %{with openblas}
%files openblas-serial64
%{_sysconfdir}/%{name}64rc.d/openblas-serial64.conf
%{_libdir}/%{name}64/lib%{name}_openblas-serial64.so
%files openblas-openmp64
%{_sysconfdir}/%{name}64rc.d/openblas-openmp64.conf
%{_libdir}/%{name}64/lib%{name}_openblas-openmp64.so
%files openblas-threads64
%{_sysconfdir}/%{name}64rc.d/openblas-threads64.conf
%{_libdir}/%{name}64/lib%{name}_openblas-threads64.so
%endif
%endif
%changelog
* Tue Jun 30 2020 Iñaki Úcar <iucar@fedoraproject.org> - 3.0.0-2
- Own provided directories
- More robust file renaming
- Rename wrapper(64) subpackages to netlib(64)
- Conditionalize all external libraries, as well as the default
- Disable Blis64 on s390x, which is currently unavailable
* Mon Jun 29 2020 Iñaki Úcar <iucar@fedoraproject.org> - 3.0.0-1
- Initial packaging for Fedora

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (flexiblas-3.0.0.tar.xz) = 371bff56354b20f239a0a7b1c4675e2c09d846bf4bf9e1e8a0783f8551d473cd61b867c2224e8e37fe11d8597546f634548e3814f225a665a2cb5f15881dba3a