File superlu_dist.spec of Package superlu_dist

#
# spec file for package superlu_dist
#
# 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:	superlu_dist
Version:	0
%define         sover 9
Release:	0
Summary: Distributed memory, MPI based SuperLU
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:	BSD-3-Clause
URL:	https://github.com/xiaoyeli/superlu_dist
Source:	_service
BuildRequires:	scotch-devel
BuildRequires:	openmpi5-macros-devel
BuildRequires:	cmake
BuildRequires:	fdupes
BuildRequires:	gcc
BuildRequires:	gcc-c++
BuildRequires:	gcc-fortran
BuildRequires:	libopenblas_openmp-devel
BuildRequires:	blacs-openmpi5-devel
BuildRequires:	libscalapack2-openmpi5-devel
BuildRequires:	combblas-devel
BuildRequires:	cmake(COLAMD)
%openmpi_requires

%description
SuperLU_DIST contains a set of subroutines to solve a sparse linear system A*X=B. It uses Gaussian elimination with static pivoting (GESP). Static pivoting is a technique that combines the numerical stability of partial pivoting with the scalability of Cholesky (no pivoting), to run accurately and efficiently on large numbers of processors.

SuperLU_DIST is a parallel extension to the serial SuperLU library. It is targeted for the distributed memory parallel machines. SuperLU_DIST is implemented in ANSI C, with OpenMP for on-node parallelism and MPI for off-node communications. We are actively developing multi-GPU acceleration capabilities.
%package	-n	lib%name-%sover
Summary:    Distributed memory, MPI based SuperLU
Group:	System/Libraries

%description	-n	lib%name-%sover
SuperLU_DIST contains a set of subroutines to solve a sparse linear system A*X=B. It uses Gaussian elimination with static pivoting (GESP). Static pivoting is a technique that combines the numerical stability of partial pivoting with the scalability of Cholesky (no pivoting), to run accurately and efficiently on large numbers of processors.

SuperLU_DIST is a parallel extension to the serial SuperLU library. It is targeted for the distributed memory parallel machines. SuperLU_DIST is implemented in ANSI C, with OpenMP for on-node parallelism and MPI for off-node communications. We are actively developing multi-GPU acceleration capabilities.

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

%description	devel
This package contains the development and header files for %{name}.

%prep
%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -rs %_sourcedir/%name-%version %_builddir/%_sourcedir
%__sed -i 's|/lib|/lib64|g'	CMakeLists.txt

%build
%setup_openmpi
export CXX=mpicxx CC=mpicc FC=mpif90
%cmake -Denable_tests=OFF -Denable_examples=OFF \
-DTPL_ENABLE_INTERNAL_BLASLIB=OFF \
-DCMAKE_C_FLAGS="-Wno-error=incompatible-pointer-types" \
-DXSDK_INDEX_SIZE=64 \
-DTPL_ENABLE_LAPACKLIB=ON \
-DBUILD_STATIC_LIBS=OFF \
-DTPL_ENABLE_COLAMD=ON \
-DTPL_COLAMD_LIBRARIES=%{_libdir}/libcolamd.so \
-DTPL_COLAMD_INCLUDE_DIRS=/usr/include/suitesparse \
-DTPL_ENABLE_PARMETISLIB=ON \
-DTPL_PARMETIS_LIBRARIES="%openmpi_prefix/%{_lib}/libptscotchparmetisv3.so;%openmpi_prefix/%{_lib}/libscotchmetisv5.so" \
-DTPL_ENABLE_COMBBLASLIB=OFF \
-DTPL_COMBBLAS_LIBRARIES=%openmpi_prefix/%{_lib}/libCombBLAS.so \
-DTPL_COMBBLAS_INCLUDE_DIRS=%openmpi_prefix/include \
-DTPL_PARMETIS_INCLUDE_DIRS=%openmpi_prefix/include \
-DCMAKE_INSTALL_PREFIX:PATH=%openmpi_prefix

%cmake_build
%install
%cmake_install


%files
%license License.txt
%files -n lib%name-%sover
%dir %openmpi_prefix
%dir %openmpi_prefix/%{_lib}

%openmpi_prefix/%{_lib}/lib*.so.*
%files devel
%dir %openmpi_prefix/%{_lib}
%dir %openmpi_prefix/include
%dir %openmpi_prefix/%{_lib}/pkgconfig/
%dir %openmpi_prefix/%{_lib}/PYTHON/
%openmpi_prefix/%{_lib}//lib*.so
%openmpi_prefix/%{_lib}/pkgconfig/%name.pc
%openmpi_prefix/%{_lib}/PYTHON/*
%openmpi_prefix/include/*
%changelog

openSUSE Build Service is sponsored by