Dave Love 1287540
# Copyright (c) 2015, 2016  Dave Love, University of Liverpool
36d69a1
# Copyright (c) 2018  Dave Love, University of Manchester
Dave Love 1287540
# MIT licence, per Fedora policy
Dave Love 1287540
Dave Love 1287540
# Notes:
Dave Love 1287540
# rpmlint complains unused-direct-shlib-dependency and
Dave Love 1287540
# undefined-non-weak-symbol, but those seem to be deliberate -- see the
Dave Love 1287540
# use of --no-as-needed, --as-needed in the build.
Dave Love 1287540
# The specific compiler flags used are presumably chosen sensibly for the
36d69a1
# code, and there's no likely security implication for this.
Dave Love 1287540
Dave Love 1287540
# ix86 isn't built -- see
Dave Love 1287540
# https://github.com/hfp/libxsmm/issues/103#issuecomment-256887962
Dave Love 1287540
Dave Love 1287540
# The el6 compiler is too old, but we build for el6 in copr from the
36d69a1
# same source.  The el7 system compiler doesn't do avx512.
36d69a1
%if 0%{?el6}%{?el7}
Dave Love 1287540
%bcond_without devtoolset
Dave Love 1287540
%endif
00d34de
36d69a1
# For historical reasons, these are out of step with the ABI
36d69a1
# versioning used by the base source.
6344591
%global somajor 1
6344591
%global sominor 9
36d69a1
%global soupd 4
Dave Love 1287540
Dave Love 1287540
Name:		libxsmm
36d69a1
Version:	1.9
24cc388
Release:	3%{?dist}
Dave Love 1287540
Summary:	Small dense or sparse matrix multiplications and convolutions for x86_64
Dave Love 1287540
License:	BSD
Dave Love 1287540
URL:		https://github.com/hfp/libxsmm
36d69a1
Source0:	https://github.com/hfp/libxsmm/archive/%version/%name-%version.tar.gz
36d69a1
BuildRequires:	python2 openblas-devel
Dave Love 1287540
%if %{with devtoolset}
36d69a1
# Relase 6 supports avx512 and uses the same libgfortran version as
36d69a1
# the system compiler.
36d69a1
BuildRequires:	devtoolset-6-gcc-gfortran devtoolset-6-gcc-c++
36d69a1
%else
36d69a1
BuildRequires:	gcc-gfortran gcc-c++
Dave Love 1287540
%endif
Dave Love 1287540
ExclusiveArch:	x86_64
Dave Love 1287540
Dave Love 1287540
# Remove /bin/sh, /bin/bash dependencies from -doc (not actually
Dave Love 1287540
# required by packaging guidelines)
Dave Love 1287540
%global __requires_exclude /bin/.*sh$
Dave Love 1287540
%{?filter_setup:
Dave Love 1287540
%filter_from_requires /\/bin\/.*sh$/d
Dave Love 1287540
%filter_setup
Dave Love 1287540
}
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%description
Dave Love 1287540
LIBXSMM is a library for small dense and small sparse matrix-matrix
Dave Love 1287540
multiplications, as well as for deep learning primitives such as small
Dave Love 1287540
convolutions targeting Intel Architecture (x86).  The library
Dave Love 1287540
generates code for the following instruction set extensions: Intel
Dave Love 1287540
SSE, Intel AVX, Intel AVX2, IMCI (KNCni) for Intel Xeon Phi
Dave Love 1287540
coprocessors ("KNC"), and Intel AVX‑512 as found in the Intel Xeon Phi
Dave Love 1287540
processor family ("KNL") and future Intel Xeon processors.  Small
Dave Love 1287540
convolutions are currently only optimized for Intel AVX‑512.
Dave Love 1287540
Historically the library was solely targeting the Intel Many
Dave Love 1287540
Integrated Core Architecture "MIC") using intrinsic functions.
Dave Love 1287540
Currently, optimized assembly code targets all aforementioned
Dave Love 1287540
instruction set extensions (static code generation), and Just‑In‑Time
Dave Love 1287540
(JIT) code generation targets Intel AVX and beyond.
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%package	devel
Dave Love 1287540
Summary:	Development files for %name
Dave Love 1287540
Requires:	%name%{?_isa} = %version-%release
Dave Love 1287540
Dave Love 1287540
%description	devel
Dave Love 1287540
The %name-devel package contains libraries and header files for
Dave Love 1287540
developing applications that use %name.
Dave Love 1287540
Dave Love 1287540
%package	doc
Dave Love 1287540
Summary:	Documentation for %name
Dave Love 1287540
BuildArch:	noarch
Dave Love 1287540
Dave Love 1287540
%description	doc
Dave Love 1287540
Documentation for %name.
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%prep
Dave Love 1287540
%setup -q
Dave Love 1287540
# MS-Windows stuff that rpmlint would complain about
Dave Love 1287540
find samples -name \*.vcxproj | xargs rm
36a0c25
chmod 0644 src/template/libxsmm_dnn_convolution_winograd_forward_custom_custom_input_trans_alpha6_avx512.tpl.c
36d69a1
# README would clobber the main one, and the others would be dangling links
36d69a1
rm documentation/{README,LICENSE,CONTRIBUTING}.md
1e9959b
# This should be obviated by
1e9959b
# https://github.com/hfp/libxsmm/commit/1913104cee619caa920115710a9c14a74d98fc16
1e9959b
# which doesn't apply cleanly.
1e9959b
for f in $(find -name \*.py); do
1e9959b
  sed -i -e 's;/usr/bin/env python;/usr/bin/python2;' $f
1e9959b
done
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%build
Dave Love 1287540
%if %{with devtoolset}
36d69a1
. /opt/rh/devtoolset-6/enable
Dave Love 1287540
%endif
Dave Love 1287540
# OpenMP is only used by libxsmmext, so no need to turn it off.
36d69a1
# Avoid the ld hardening flags, which are taken care of by the library
36d69a1
# build system to the extent they don't affect perfromance.
36d69a1
# -lm and -ldl are neded for the test, for which the LDFLAGS need to be
36d69a1
# consistent.
dd273e7
%global makeflags STATIC=0 SYM=1 AVX=0 VERSION_MAJOR=%somajor VERSION_MINOR=%sominor VERSION_UPDATE=%soupd PYTHON=/usr/bin/python2
bfaf01a
make %{?_smp_mflags} %makeflags
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%install
Dave Love 1287540
# Supply STATIC etc. since this actually builds stuff (a bug?),
Dave Love 1287540
# and otherwise we end up with bits built wrongly.
bfaf01a
make install PREFIX=%buildroot%_prefix POUTDIR=$(basename %_libdir) %makeflags
Dave Love 1287540
mkdir -p %buildroot%_libdir
Dave Love 1287540
cp -a lib/*.so* %buildroot%_libdir
Dave Love 1287540
%if !0%{?el6} || %{with devtoolset}
Dave Love 1287540
mkdir -p %buildroot%_fmoddir
Dave Love 1287540
mv %buildroot%_includedir/libxsmm.mod %buildroot%_fmoddir
Dave Love 1287540
%endif
Dave Love 1287540
rm -r %buildroot%_datadir/libxsmm
Dave Love 1287540
# Build artefacts
Dave Love 1287540
find samples -name .make | xargs rm
Dave Love 1287540
cp Makefile.inc samples		# included by the sub-directories
Dave Love 1287540
echo "These are set up to be built in the original source tree.
Dave Love 1287540
You will have to adjust the make files to use an installed version." >samples/README
Dave Love 1287540
Dave Love 1287540
# Avoid rpmlint no-ldconfig-symlink
Dave Love 1287540
pushd %buildroot%_libdir
Dave Love 1287540
for i in *.so.*.*; do
Dave Love 1287540
    ln -sf $i $(echo $i | sed "s/\\.[0-9][0-9]*$//")
Dave Love 1287540
done
Dave Love 1287540
popd
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%check
dd273e7
# Fixme: the test gives numerical errors inconsistently with openblas
dd273e7
# 0.3.1/gcc 8.1 on koji when the thread count isn't 1; sometimes 2
dd273e7
# works.
dd273e7
OMP_NUM_THREADS=1 make test-cp2k %makeflags
36d69a1
rm -r samples/cp2k/{cp2k,build,.make,.state}
Dave Love 1287540
Dave Love 1287540
1e9959b
%ldconfig_scriptlets
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%files
6344591
%license LICENSE.md
6344591
%_libdir/libxsmm*.so.%{somajor}*
Dave Love 1287540
Dave Love 1287540
%files devel
Dave Love 1287540
%doc README.md
6344591
%_libdir/libxsmm*.so
6344591
%_includedir/libxsmm.f
6344591
%_includedir/libxsmm*.h
Dave Love 1287540
%_bindir/libxsmm_gemm_generator
Dave Love 1287540
%_bindir/libxsmm_conv_generator
9ec39ff
%_bindir/libxsmm_convwino_generator
Dave Love 1287540
# Get the module directory owned.  Currently in Fedora, gfortran owns
Dave Love 1287540
# %%_fmoddir, but not %%_fmoddir/..
Dave Love 1287540
# In el6, el7, it doesn't own either, but el6's gfortran is too old to be used.
Dave Love 1287540
%if ! 0%{?el6} || %{with devtoolset}
Dave Love 1287540
%dir %_fmoddir/..
Dave Love 1287540
%dir %_fmoddir
Dave Love 1287540
%_fmoddir/*.mod
Dave Love 1287540
%endif
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%files doc
36d69a1
%doc README.md documentation/* samples CONTRIBUTING.md
6344591
%license LICENSE.md
Dave Love 1287540
Dave Love 1287540
Dave Love 1287540
%changelog
24cc388
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-3
24cc388
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
24cc388
1e9959b
* Wed Jul  4 2018 Dave Love <loveshack@fedoraproject.org> - 1.9-2
1e9959b
- Use python2 exlicitly in scripts
dd273e7
- Use single thread in %%check to fix FTBFS
1e9959b
- Use ldconfig_scriptlets
dd273e7
- Don't define LDFLAGS
1e9959b
36d69a1
* Wed Mar 21 2018 Dave Love <loveshack@fedoraproject.org> - 1.9-1
36d69a1
- Update to 1.9 (#1557708)
36d69a1
- Use devtoolset-6, not -7 for EPEL
36d69a1
- Don't avoid SSE (assumes sse3, which seems unlikely to cause problems)
36d69a1
- BR python2, per new policy
36d69a1
- Set VERSION_UPDATE for soname to avoid going backwards
36d69a1
- Fix issues with doc files
36d69a1
6344591
* Thu Mar  8 2018 Dave Love <loveshack@fedoraproject.org> - 1.8.3-1
6344591
- Update to 1.8.3 (#1528828)
6344591
- Fix running test
6344591
- Modify %%files for distribution changes and to specify lib soversion
6344591
3a33980
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-5
3a33980
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3a33980
00d34de
* Tue Dec 19 2017 Dave Love <loveshack@fedoraproject.org> - 1.8.1-4
00d34de
- Don't run test
00d34de
- Update possible devtoolset usage
00d34de
36a0c25
* Sun Oct 29 2017 Dave Love <loveshack@fedoraproject.org> - 1.8.1-3
36a0c25
- Fix spurious executable permission
36a0c25
- Reinstate %%check
36a0c25
- Build with AVX=0
36a0c25
bfaf01a
* Fri Oct 27 2017 Dave Love <loveshack@fedoraproject.org> - 1.8.1-2
bfaf01a
- Fix bogus specification of soversion
bfaf01a
  Actually kept at 1.8, not the intended 2.0, despite a few ABI differences
bfaf01a
  from version 1.8.
bfaf01a
52356dc
* Thu Oct 26 2017 Dave Love <loveshack@fedoraproject.org> - 1.8.1-1
52356dc
- New version
52356dc
- Drop libxsmm-make.patch
52356dc
9b26cf6
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-4
9b26cf6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
9b26cf6
4edf3d5
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
4edf3d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4edf3d5
Igor Gnatenko 2c4d2f3
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8-2
Igor Gnatenko 2c4d2f3
- Rebuild due to bug in RPM (RHBZ #1468476)
Igor Gnatenko 2c4d2f3
9ec39ff
* Tue May  2 2017 Dave Love <loveshack@fedoraproject.org> - 1.8-1
9ec39ff
- Update soversion
9ec39ff
- Ship libxsmm_convwino_generator
9ec39ff
- New version
9ec39ff
2d24f9d
* Mon Feb 13 2017 Dave Love <loveshack@fedoraproject.org> - 1.6.3-1
2d24f9d
- New version
2d24f9d
  (Moving past 1.6.3 means more serious ABI changes.)
2d24f9d
36ecac1
* Sun Feb 05 2017 Kalev Lember <klember@redhat.com> - 1.6.1-2
36ecac1
- Rebuilt for libgfortran soname bump
36ecac1
Dave Love c581e18
* Wed Dec  7 2016 Dave Love <loveshack@fedoraproject.org> - 1.6.1-1
Dave Love c581e18
- New version
Dave Love c581e18
- Some ABI incompatibility, but kept major sover as not made stable yet
Dave Love c581e18
  and in view of https://github.com/hfp/libxsmm/issues/120
Dave Love c581e18
Dave Love 1287540
* Wed Nov  9 2016 Dave Love <loveshack@fedoraproject.org> - 1.5.2-2
Dave Love 1287540
- Remove -doc dependencies
Dave Love 1287540
Dave Love 1287540
* Fri Nov  4 2016 Dave Love <loveshack@fedoraproject.org> - 1.5.2-1
Dave Love 1287540
- New version
Dave Love 1287540
Dave Love 1287540
* Thu Nov  3 2016 Dave Love <loveshack@fedoraproject.org> - 1.5.1-2
Dave Love 1287540
- Clean samples .make files too
Dave Love 1287540
- Use OMP build default
Dave Love 1287540
- Define FCFLAGS, LDFLAGS
Dave Love 1287540
Dave Love 1287540
* Mon Oct 31 2016 Dave Love <loveshack@fedoraproject.org> - 1.5.1-1
Dave Love 1287540
- New version, fixing interface bug
Dave Love 1287540
- Spec fixes from review
Dave Love 1287540
- Add samples to doc
Dave Love 1287540
Dave Love 1287540
* Wed Oct 26 2016 Dave Love <loveshack@fedoraproject.org> - 1.5-4
Dave Love 1287540
- Don't install .mod file directly in _includedir
Dave Love 1287540
- Don't build for ix86
Dave Love 1287540
- BR python
Dave Love 1287540
Dave Love 1287540
* Tue Oct 11 2016 Dave Love <loveshack@fedoraproject.org> - 1.5-3
Dave Love 1287540
- Install with STATIC=0
Dave Love 1287540
- Avoid sse3
Dave Love 1287540
- Fix Fortran modules installation and %%_fmoddir ownership
Dave Love 1287540
Dave Love 1287540
* Wed Oct  5 2016 Dave Love <loveshack@fedoraproject.org> - 1.5-2
Dave Love 1287540
- Fix installation of libraries
Dave Love 1287540
Dave Love 1287540
* Wed Oct  5 2016 Dave Love <loveshack@fedoraproject.org> - 1.5-1
Dave Love 1287540
- New version
Dave Love 1287540
- Remove %%check (run in %%build)
Dave Love 1287540
Dave Love 1287540
* Sat Aug 20 2016 Dave Love <loveshack@fedoraproject.org> - 1.4.4-2
Dave Love 1287540
- Drop devtoolset on el6 (not needed)
Dave Love 1287540
Dave Love 1287540
* Thu Aug 18 2016 Dave Love <loveshack@fedoraproject.org> - 1.4.4-1
Dave Love 1287540
- New version, with bumped soname
Dave Love 1287540
- Drop patch
Dave Love 1287540
- Modify install section
Dave Love 1287540
Dave Love 1287540
* Sat May 21 2016 Dave Love <loveshack@fedoraproject.org> - 1.4.3-1
Dave Love 1287540
- New version
Dave Love 1287540
- Fix debuginfo
Dave Love 1287540
Dave Love 1287540
* Mon May  9 2016 Dave Love <loveshack@fedoraproject.org> - 1.4.1-1
Dave Love 1287540
- New version
Dave Love 1287540
- Link --as-needed
Dave Love 1287540
Dave Love 1287540
* Mon Apr 25 2016 Dave Love <loveshack@fedoraproject.org> - 1.4-2
Dave Love 1287540
- Use PREFETCH=1
Dave Love 1287540
Dave Love 1287540
* Wed Apr  6 2016 Dave Love <loveshack@fedoraproject.org> - 1.4-1
Dave Love 1287540
- New version
Dave Love 1287540
Dave Love 1287540
* Fri Apr  1 2016 Dave Love <loveshack@fedoraproject.org> - 1.3-2
Dave Love 1287540
- Install README.md, and maybe README.EPEL6
Dave Love 1287540
Dave Love 1287540
* Fri Apr  1 2016 Dave Love <loveshack@fedoraproject.org> - 1.3-1
Dave Love 1287540
- New version
Dave Love 1287540
- Sanitize spec a bit
Dave Love 1287540
Dave Love 1287540
* Mon Feb 22 2016 Dave Love <loveshack@fedoraproject.org> - 1.2-1
Dave Love 1287540
- New version
Dave Love 1287540
Dave Love 1287540
* Sun Jan 24 2016 Dave Love <loveshack@fedoraproject.org> - 1.1.1-2
Dave Love 1287540
- Install Fortran module in %%_fmoddir
Dave Love 1287540
Dave Love 1287540
* Wed Dec 30 2015 Dave Love <loveshack@fedoraproject.org> - 1.1.1-1
Dave Love 1287540
- New version
Dave Love 1287540
- Add check
Dave Love 1287540
- BR python
Dave Love 1287540
- Make it serial, not openmp, for now
Dave Love 1287540
- Add doc subpackage
Dave Love 1287540
Dave Love 1287540
* Wed Dec  2 2015 Dave Love <loveshack@fedoraproject.org> - 1.0.1-1
Dave Love 1287540
- New version
Dave Love 1287540
Dave Love 1287540
* Wed Oct  7 2015 Dave Love <loveshack@fedoraproject.org> - 0.9.1-1
Dave Love 1287540
- Initial packaging