libxsmm/libxsmm.spec
starlet-dx 7a5f906949 fix CVE-2021-39535 CVE-2021-39536
(cherry picked from commit d83b92e988575c1d0583ddd9a00f514d6f344548)
2021-12-23 17:21:04 +08:00

124 lines
3.7 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

%if 0%{?el6}%{?el7}
%bcond_without devtoolset
%endif
%global somajor 1
%global sominor 10
%global soupd 1
Name: libxsmm
Version: 1.15
Release: 3
Summary: Small dense or sparse matrix multiplications and convolutions for x86_64
License: BSD
URL: https://github.com/hfp/libxsmm
Source0: https://github.com/hfp/libxsmm/archive/%version/%name-%version.tar.gz
Patch0001: leverage-GNU-source-when-building-the-library.patch
Patch0002: CVE-2021-39535_CVE-2021-39536.patch
BuildRequires: python3 openblas-devel
%if %{with devtoolset}
BuildRequires: devtoolset-6-gcc-gfortran devtoolset-6-gcc-c++
%else
BuildRequires: gcc-gfortran gcc-c++
%endif
ExclusiveArch: x86_64
%global __requires_exclude /bin/.*sh$
%{?filter_setup:
%filter_from_requires /\/bin\/.*sh$/d
%filter_setup
}
%description
LIBXSMM is a library for small dense and small sparse matrix-matrix
multiplications, as well as for deep learning primitives such as small
convolutions targeting Intel Architecture (x86). The library
generates code for the following instruction set extensions: Intel
SSE, Intel AVX, Intel AVX2, IMCI (KNCni) for Intel Xeon Phi
coprocessors ("KNC"), and Intel AVX512 as found in the Intel Xeon Phi
processor family ("KNL") and future Intel Xeon processors. Small
convolutions are currently only optimized for Intel AVX512.
Historically the library was solely targeting the Intel Many
Integrated Core Architecture "MIC") using intrinsic functions.
Currently, optimized assembly code targets all aforementioned
instruction set extensions (static code generation), and JustInTime
(JIT) code generation targets Intel AVX and beyond.
%package devel
Summary: Development files for %name
Requires: %name%{?_isa} = %version-%release
Requires: pkgconfig
%description devel
The %name-devel package contains libraries and header files for
developing applications that use %name.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
find samples -name \*.vcxproj | xargs rm
rm documentation/{README,LICENSE,CONTRIBUTING}.md
rm documentation/gxm.md
cp -p samples/deeplearning/gxm/README.md documentation/gxm.md
%build
%if %{with devtoolset}
. /opt/rh/devtoolset-6/enable
%endif
%global makeflags STATIC=0 SYM=1 AVX=0 PYTHON=%_bindir/python3 PREFIX=%buildroot%_prefix POUTDIR=%_lib VERSION_API=1 OMPLIB=-lgomp
%make_build %makeflags
%install
%if %{with devtoolset}
. /opt/rh/devtoolset-6/enable
%endif
make install %makeflags
mkdir -p %buildroot%_fmoddir %buildroot%_libdir/pkgconfig
mv %buildroot%_includedir/libxsmm.mod %buildroot%_fmoddir
mv %buildroot%_prefix/lib/*.pc %buildroot%_libdir/pkgconfig
sed -i -e 's|^prefix=.*$|prefix=%_prefix|' %buildroot%_libdir/pkgconfig/*.pc
rm -r %buildroot%_datadir/libxsmm
find samples -name .make | xargs rm
cp Makefile.inc samples # included by the sub-directories
echo "These are set up to be built in the original source tree.
You will have to adjust the make files to use an installed version." >samples/README
rm %buildroot%_prefix/lib/libxsmm
%check
OMP_NUM_THREADS=1 make test-cp2k %makeflags
rm -r samples/cp2k/{build,.make,.state,cp2k-dbcsr,cp2k-collocate,cp2k-test.txt}
%ldconfig_scriptlets
%files
%license LICENSE.md
%_libdir/libxsmm*.so.%{somajor}*
%files devel
%_libdir/libxsmm*.so
%_includedir/*
%_bindir/libxsmm_gemm_generator
%if 0%{?el6}%{?el7}
%dir %_fmoddir
%endif
%_fmoddir/libxsmm.mod
%_libdir/pkgconfig/*.pc
%files help
%defattr(-,root,root)
%doc README.md documentation/*.md documentation/*.pdf samples CONTRIBUTING.md
%license LICENSE.md
%changelog
* Wed Dec 22 2021 yaoxin <yaoxin30@huawei.com> - 1.15-3
- Fix CVE-2021-39535 CVE-2021-39536
* Tue Aug 10 2021 lingsheng <lingsheng@huawei.com> - 1.15-2
- leverage GNU-source when building the library
* Thu May 28 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.15-1
- Package init