File costa.spec of Package costa

#
# spec file for package costa
#
# Copyright (c) 2024 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/
#

Name:	costa
Version:	0
Release:	0
%define         sover 2
Summary:  Distributed Communication-Optimal Shuffle and Transpose Algorithm
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:	BSD-3-Clause
URL:	https://github.com/electronic-structure/SIRIUS
Source:	_service



BuildRequires:	openmpi5-macros-devel
BuildRequires:	cmake
BuildRequires:	gcc-c++
BuildRequires:	gcc-fortran

BuildRequires:	gsl-devel

BuildRequires:	libxc-devel

BuildRequires:	fftw3-openmp-devel

BuildRequires:	libopenblas_openmp-devel
BuildRequires:	blacs-openmpi5-devel
BuildRequires:	libscalapack2-openmpi5-devel

BuildRequires:	hdf5-openmpi5-devel



%description
Distributed Communication-Optimal Shuffle and Transpose Algorithm
COSTA is a communication-optimal, highly-optimised algorithm for data redistribution accross multiple processors, using MPI and OpenMP and offering the possibility to transpose and scale some or all data.
%package -n lib%name-%sover
Summary:        Main libint library v2
Group:          System/Libraries
%openmpi_requires
%description -n lib%name-%sover
COSTA is a communication-optimal, highly-optimised algorithm for data redistribution accross multiple processors, using MPI and OpenMP and offering the possibility to transpose and scale some or all data.


%package devel
Summary:        Development headers and libraries for libint
Group:          Development/Libraries/C and C++
Requires:       lib%name-%sover = %{version}
Obsoletes: openmpi4-libs 

%description devel
COSTA is a communication-optimal, highly-optimised algorithm for data redistribution accross multiple processors, using MPI and OpenMP and offering the possibility to transpose and scale some or all data.
%prep
%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -rs %_sourcedir/%name-%version %_builddir/%_sourcedir

%build
%setup_openmpi
export CXX=mpicxx CC=mpicc FC=mpif90
%cmake -DCMAKE_INSTALL_PREFIX:PATH=%openmpi_prefix -DCOSTA_SCALAPACK=CUSTOM -DSCALAPACK_ROOT=%openmpi_prefix/%{_lib}

%cmake_build

%install
%cmake_install


%files
%license LICENSE
%doc README.md


%files -n lib%name-%sover
%dir %openmpi_prefix
%openmpi_prefix/%{_lib}/lib%name.so
%openmpi_prefix/%{_lib}/lib%{name}_scalapack.so
%openmpi_prefix/%{_lib}/lib%{name}_prefixed_scalapack.so
%dir %openmpi_prefix/%{_lib}
%dir %openmpi_prefix
%files devel
%dir %openmpi_prefix/%{_lib}
%dir %openmpi_prefix/include

%dir %openmpi_prefix/%{_lib}/cmake/
%openmpi_prefix/%{_lib}/cmake/%{name}/
%openmpi_prefix/include/%name
%openmpi_prefix/%{_lib}/pkgconfig/%{name}.pc
%changelog

openSUSE Build Service is sponsored by