File elpa.spec of Package elpa

#
# spec file for package elpa
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2017 Lorenz Hüdepohl
#
# 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/
#


%define so_version 19

Name:           elpa
Version:        2025.06.001
Release:        0
Summary:        A massively parallel eigenvector solver
License:        LGPL-3.0-only
Group:          Productivity/Scientific/Math
URL:            https://elpa.mpcdf.mpg.de/
Source0:        https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/%{version}/elpa-%{version}.tar.gz
Patch0:         0001-Avoid-non-standard-initialization-from-integer-expre.patch
BuildRequires:  blas-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran >= 4.8
BuildRequires:  lapack-devel
BuildRequires:  libtool
BuildRequires:  openmpi4-devel
BuildRequires:  openmpi4-macros-devel
BuildRequires:  pkg-config
BuildRequires:  scalapack-openmpi4-devel
# MPI broken on ix86
ExcludeArch:    %{ix86}

%description
An efficient distributed parallel direct eigenvalue solver for
symmetric matrices. It contains both an improved one-step ScaLAPACK type solver
(ELPA1) and the two-step solver ELPA2.

ELPA uses the same matrix layout as ScaLAPACK. The actual parallel linear
algebra routines are completely rewritten. ELPA1 implements the same linear
algebra as traditional solutions (reduction to tridiagonal form by Householder
transforms, divide & conquer solution, eigenvector backtransform). In ELPA2,
the reduction to tridiagonal form and the corresponding backtransform are
replaced by a two-step version, giving an additional significant performance
improvement.

ELPA has demonstrated good scalability for large matrices on hundred of thousands of cores
on several recent high-performance computers.

%package     -n lib%{name}%{so_version}
Summary:        A massively parallel eigenvector solver
Group:          Productivity/Scientific/Math
Provides:       %{name} = %{version}
Requires:       %{name}-tools >= %{version}

%description -n lib%{name}%{so_version}
An efficient distributed parallel direct eigenvalue solver for
symmetric matrices. It contains both an improved one-step ScaLAPACK type solver
(ELPA1) and the two-step solver ELPA2.

ELPA uses the same matrix layout as ScaLAPACK. The actual parallel linear
algebra routines are completely rewritten. ELPA1 implements the same linear
algebra as traditional solutions (reduction to tridiagonal form by Householder
transforms, divide & conquer solution, eigenvector backtransform). In ELPA2,
the reduction to tridiagonal form and the corresponding backtransform are
replaced by a two-step version, giving an additional significant performance
improvement.

ELPA has demonstrated good scalability for large matrices on hundred of thousands of cores
on several recent high-performance computers.

%package        tools
Summary:        Utility program for %{name}
Group:          Productivity/Scientific/Math

%description    tools
A small tool program for %{name}, elpa2_print_kernels, which prints the available and
currently selected numerical kernel for ELPA2.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       lib%{name}%{so_version} = %{version}
Requires:       blas-devel
Requires:       lapack-devel
Requires:       scalapack-openmpi4-devel

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        devel-static
Summary:        Development files for %{name} - static libraries
Group:          Development/Libraries/Other
Requires:       %{name}-devel = %{version}

%description    devel-static
This package provides the static libraries for developing applications
that use %{name}.

%prep
%autosetup -p1

%build
%setup_openmpi

%ifarch x86_64
export CFLAGS="%optflags -msse4.2"
export FCFLAGS="%optflags -msse4.2"
export LDFLAGS="%optflags -msse4.2"
%endif
export CFLAGS="${CFLAGS} -Wno-error=return-type"
export FCFLAGS="${FCFLAGS} -Wno-error=return-type"
export CXX=mpic++

# Normal build
%configure \
%ifarch armv7hl aarch64 %{ix86} ppc64le ppc64 riscv64
        --disable-sse-kernels \
        --disable-sse-assembly-kernels \
%endif
        --disable-avx-kernels \
        --disable-avx2-kernels \
        --disable-avx512-kernels \
        --docdir=%{_docdir}/%{name}-%{version}

%make_build

%install
%make_install
rm %{buildroot}%{_libdir}/lib*.la

%check
%setup_openmpi

make check TEST_FLAGS="150 50 16" || { echo "Tests failed: Content of ./test-suite.log:"; cat ./test-suite.log; echo; exit 1; }

%post   -n lib%{name}%{so_version} -p /sbin/ldconfig
%postun -n lib%{name}%{so_version} -p /sbin/ldconfig


%files -n lib%{name}%{so_version}
%{_libdir}/lib%{name}.so.*
%dir %{_docdir}/%{name}-%{version}
%{_docdir}/%{name}-%{version}/*

%files tools
%{_bindir}/elpa2_print_kernels
%{_mandir}/man1/elpa2_print_kernels.1.gz

%files devel
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}-%{version}
%{_libdir}/lib%{name}.so
%{_mandir}/man3/*

%files devel-static
%{_libdir}/lib%{name}.a

%changelog
openSUSE Build Service is sponsored by