File combblas.spec of Package combblas
#
# spec file for package combblas
#
# 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: combblas
Version: 0
%define sover 2
Release: 0
Summary: The Combinatorial BLAS Library
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: BSD-3-Clause AND MIT AND Boost AND GPL-2.0-or-later
URL: https://github.com/PASSIONLab/CombBLAS
Source: _service
BuildRequires: openmpi5-macros-devel
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
BuildRequires: libopenblas_openmp-devel
BuildRequires: blacs-openmpi5-devel
BuildRequires: libscalapack2-openmpi5-devel
%openmpi_requires
%description
The Combinatorial BLAS (CombBLAS) is an extensible distributed-memory parallel
graph library offering a small but powerful set of linear algebra primitives
specifically targeting graph analytics
%package -n lib%name-%sover
Summary: The Combinatorial BLAS Library
Group: System/Libraries
%description -n lib%name-%sover
The Combinatorial BLAS (CombBLAS) is an extensible distributed-memory parallel
graph library offering a small but powerful set of linear algebra primitives
specifically targeting graph analytics
%package devel
Summary: Development libraries for scotch
Group: Development/Libraries/C and C++
Requires: lib%name-%sover = %{version}
%description devel
This package contains development libraries for lib%name
%prep
%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -rs %_sourcedir/%name-%version %_builddir/%_sourcedir
%__sed -i 's|DESTINATION lib|DESTINATION lib64|g' CMakeLists.txt
%__sed -i 's|lib/cmake|lib64/cmake|g' CMakeLists.txt
%__sed -i 's|DESTINATION lib|DESTINATION lib64|g' graph500-1.2/generator/CMakeLists.txt
%__sed -i 's|DESTINATION lib|DESTINATION lib64|g' usort/CMakeLists.txt
%__sed -i '9a target_link_libraries(GraphGenlib m)' graph500-1.2/generator/CMakeLists.txt
%__sed -i '14a target_link_libraries(Usortlib PUBLIC "${OpenMP_CXX_FLAGS}")' usort/CMakeLists.txt
%__sed -i '14a target_compile_options(Usortlib PUBLIC "-Wno-error=return-type" "${OpenMP_CXX_FLAGS}")' usort/CMakeLists.txt
%build
%setup_openmpi
export CXX=mpicxx CC=mpicc FC=mpif90
export LDFLAGS=$LDFLAGS
%cmake -DCMAKE_INSTALL_PREFIX:PATH=%openmpi_prefix
%cmake_build
%install
%cmake_install
%files
%license LICENSE usort/LICENSE graph500-1.2/COPYING graph500-1.2/generator/LICENSE_1_0.txt
%doc TODO.txt FAQ.md README_DEVELOPERS graph500-1.2/Graph500.html graph500-1.2/Graph500.org
%files -n lib%name-%sover
%dir %openmpi_prefix
%dir %openmpi_prefix/%{_lib}
%openmpi_prefix/%{_lib}/libCombBLAS.so.*
%openmpi_prefix/%{_lib}/libGraphGenlib.so
%openmpi_prefix/%{_lib}/libUsortlib.so
%files devel
%dir %openmpi_prefix/%{_lib}
%dir %openmpi_prefix/include
%dir %openmpi_prefix/%{_lib}/cmake/
%openmpi_prefix/%{_lib}//libCombBLAS.so
%openmpi_prefix/%{_lib}/cmake/CombBLAS/
%openmpi_prefix/include/psort/
%openmpi_prefix/include/usort/
%openmpi_prefix/include/Tommy/
%openmpi_prefix/include/graph500/
%openmpi_prefix/include/CombBLAS/
%changelog