File libxsmm.spec of Package libxsmm
#
# spec file for package libxsmm
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define sover 1
Name: libxsmm
Version: 0
Release: 0
Summary: Library for specialized dense and sparse matrix operations, and deep learning primitives
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: BSD-3-Clause
URL: https://github.com/libxsmm/libxsmm.git
Source: _service
Patch0: libxsmm-rpath.patch
BuildRequires: gcc-fortran
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: libopenblas_openmp-devel
BuildRequires: blacs-openmpi5-devel
BuildRequires: libscalapack2-openmpi5-devel
BuildRequires: python3-base
BuildRequires: pkgconfig(libxcf03)
BuildRequires: cmake(Spglib)
BuildRequires: cmake(lapacke)
BuildRequires: openmpi5-macros-devel
Requires: libopenblas_openmp0
%openmpi_requires
%description
LIBXSMM is a library for specialized dense and sparse matrix operations as well as for deep learning primitives such as small convolutions. The library is targeting Intel Architecture with Intel SSE, Intel AVX, Intel AVX2, Intel AVX‑512 (with VNNI and Bfloat16), and Intel AMX (Advanced Matrix Extensions) supported by future Intel processor code-named Sapphire Rapids. Code generation is mainly based on Just‑In‑Time (JIT) code specialization for compiler-independent performance (matrix multiplications, matrix transpose/copy, sparse functionality, and deep learning). LIBXSMM is suitable for "build once and deploy everywhere", i.e., no special target flags are needed to exploit the available performance. Supported GEMM datatypes are: FP64, FP32, bfloat16, int16, and int8.
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package %sover
Summary: %{name} library
%description %sover
LIBXSMM is a library for specialized dense and sparse matrix operations as well as for deep learning primitives such as small convolutions. The library is targeting Intel Architecture with Intel SSE, Intel AVX, Intel AVX2, Intel AVX‑512 (with VNNI and Bfloat16), and Intel AMX (Advanced Matrix Extensions) supported by future Intel processor code-named Sapphire Rapids. Code generation is mainly based on Just‑In‑Time (JIT) code specialization for compiler-independent performance (matrix multiplications, matrix transpose/copy, sparse functionality, and deep learning). LIBXSMM is suitable for "build once and deploy everywhere", i.e., no special target flags are needed to exploit the available performance. Supported GEMM datatypes are: FP64, FP32, bfloat16, int16, and int8.
%prep
%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -rs %_sourcedir/%name-%version %_builddir/%_sourcedir
%patch 0
echo /bin/true > ./configure
%__chmod +x ./configure
# MS-Windows stuff that rpmlint would complain about
# README would clobber the main one, and the others would be dangling links
rm documentation/{README,LICENSE,CONTRIBUTING}.md
%build
%setup_openmpi
%configure
%global makeflags STATIC=0 SYM=1 SSE=1 AVX=1 PYTHON=%__python3 PREFIX=%_prefix OUTDIR=%_lib PPKGDIR=%_lib/pkgconfig VERSION_API=1 OMPLIB=-lgomp
%make_build %makeflags
%install
%make_install %makeflags
%__rm -rf %buildroot%_datadir/
%files
%license LICENSE.md
%doc README.md documentation/*.md documentation/*.pdf CONTRIBUTING.md
%files %sover
%license LICENSE.md
%_libdir/libxsmm*.so.*
%files devel
%_libdir/libxsmm*.so
%_includedir/*
%_bindir/libxsmm*
%_includedir/libxsmm.mod
%_libdir/pkgconfig/*
%changelog