Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade SuperLU version to 7.0.0 #10744

Draft
wants to merge 2 commits into
base: 3.0-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions SPECS-EXTENDED/SuperLU/SuperLU-5.2.1-set_soname.patch

This file was deleted.

49 changes: 49 additions & 0 deletions SPECS-EXTENDED/SuperLU/SuperLU-fedora-make.inc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
############################################################################
#
# Program: SuperLU
#
# Module: make.inc
#
# Purpose: Top-level Definitions
#
# Creation date: May 10, 2015
#
# Modified:
#
#
############################################################################
#
# The name of the libraries to be created/linked to
#
SuperLUroot = ${CMAKE_SOURCE_DIR}/build
#
# SuperLUroot = ${CMAKE_INSTALL_PREFIX}
SUPERLULIB = $(SuperLUroot)/SRC/${PROJECT_NAME_LIB_EXPORT}

#TMGLIB = libtmglib.a

# BLASDEF = -DUSE_VENDOR_BLAS
BLASLIB = $(TPL_BLAS_LIBRARIES)
LIBS = $(SUPERLULIB) $(BLASLIB)

#
# The archiver and the flag(s) to use when building archive (library)
# If your system has no ranlib, set RANLIB = echo.
#
ARCH = @CMAKE_AR@
ARCHFLAGS = cr
RANLIB = @CMAKE_RANLIB@

CC = @CMAKE_C_COMPILER@
CFLAGS = @CMAKE_C_FLAGS_RELEASE@ @CMAKE_C_FLAGS@
NOOPTS =
FORTRAN = @CMAKE_Fortran_COMPILER@
FFLAGS = @CMAKE_Fortran_FLAGS_RELEASE@

LOADER = $(CC)
LOADOPTS = $(LDFLAGS)

#
# The directory in which Matlab is installed
#
MATLAB = /Applications/MATLAB_R2015b.app
54 changes: 54 additions & 0 deletions SPECS-EXTENDED/SuperLU/SuperLU-fix_example_builds.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
--- a/EXAMPLE/Makefile.orig 2020-10-18 00:23:21.000000000 +0200
+++ b/EXAMPLE/Makefile 2021-01-29 17:58:26.396762602 +0100
@@ -101,10 +101,10 @@
$(LOADER) $(LOADOPTS) $(SLINXEXM3) $(LIBS) -lm -o $@

sitersol: $(SITSOL) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(SITSOL) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(SITSOL) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

sitersol1: $(SITSOL1) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(SITSOL1) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(SITSOL1) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

dlinsol: $(DLINEXM) $(SUPERLULIB)
$(LOADER) $(LOADOPTS) $(DLINEXM) $(LIBS) -lm -o $@
@@ -128,10 +128,10 @@
$(LOADER) $(LOADOPTS) $(SUPERLUEXM) $(LIBS) -lm -o $@

ditersol: $(DITSOL) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(DITSOL) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(DITSOL) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

ditersol1: $(DITSOL1) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(DITSOL1) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(DITSOL1) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

clinsol: $(CLINEXM) $(SUPERLULIB)
$(LOADER) $(LOADOPTS) $(CLINEXM) $(LIBS) -lm -o $@
@@ -152,10 +152,10 @@
$(LOADER) $(LOADOPTS) $(CLINXEXM3) $(LIBS) -lm -o $@

citersol: $(CITSOL) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(CITSOL) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(CITSOL) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

citersol1: $(CITSOL1) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(CITSOL1) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(CITSOL1) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

zlinsol: $(ZLINEXM) $(SUPERLULIB)
$(LOADER) $(LOADOPTS) $(ZLINEXM) $(LIBS) -lm -o $@
@@ -176,10 +176,10 @@
$(LOADER) $(LOADOPTS) $(ZLINXEXM3) $(LIBS) -lm -o $@

zitersol: $(ZITSOL) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(ZITSOL) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(ZITSOL) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

zitersol1: $(ZITSOL1) $(SUPERLULIB)
- $(LOADER) $(LOADOPTS) $(ZITSOL1) $(LIBS) -lm -o $@
+ $(LOADER) $(LOADOPTS) $(ZITSOL1) $(LIBS) $(TPL_BLAS_LIBRARIES) -lm -o $@

.c.o:
$(CC) $(CFLAGS) $(CDEFS) $(INCLUDEDIR) -c $< $(VERBOSE)
4 changes: 3 additions & 1 deletion SPECS-EXTENDED/SuperLU/SuperLU.signatures.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"Signatures": {
"superlu-5.2.1.tar.gz": "28fb66d6107ee66248d5cf508c79de03d0621852a0ddeba7301801d3d859f463"
"superlu-7.0.0.tar.gz": "d7b91d4e0bb52644ca74c1a4dd466a694ddf1244a7bbf93cb453e8ca1f6527eb",
"SuperLU-fedora-make.inc.in": "e918165e7039b02bb5e67896aed16875f8d6946e0e9aed2f6dfbd9618fad3a5e"
}
}

83 changes: 53 additions & 30 deletions SPECS-EXTENDED/SuperLU/SuperLU.spec
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
Vendor: Microsoft Corporation
Distribution: Azure Linux
%global genname superlu
%global libver 5

## The RPM macro for the linker flags does not exist on EPEL
%if 0%{?rhel} && 0%{?rhel} < 7
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
%endif

Name: SuperLU
Version: 5.2.1
Release: 10%{?dist}
Version: 7.0.0
Release: 1%{?dist}
Summary: Subroutines to solve sparse linear systems
License: BSD and GPLv2+
License: BSD-2-Clause AND GPL-2.0-or-later
URL: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/
Source0: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/%{genname}_%{version}.tar.gz#/%{genname}-%{version}.tar.gz
Patch0: %{genname}-cmake-includedir.patch
Patch1: %{genname}-removemc64.patch

# Patch soname (5 -> 5.2) of shared library
Patch2: %{name}-%{version}-set_soname.patch
Source0: https://github.com/xiaoyeli/%{genname}/archive/refs/tags/v%{version}.tar.gz#/%{genname}-%{version}.tar.gz

BuildRequires: openblas-devel, openblas-srpm-macros
BuildRequires: gcc
# Use a pre-made configuration file for Make
Source1: %{name}-fedora-make.inc.in
Patch0: %{genname}-removemc64.patch

# Fix ldflags of example files
Patch1: %{name}-fix_example_builds.patch

BuildRequires: openblas-devel, openblas-srpm-macros
BuildRequires: metis-devel
BuildRequires: gcc
%if 0%{?rhel}
BuildRequires: epel-rpm-macros
BuildRequires: epel-rpm-macros
%endif
BuildRequires: cmake3
BuildRequires: gcc-gfortran
BuildRequires: csh
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc-gfortran
BuildRequires: csh

%description
SuperLU contains a set of subroutines to solve a sparse linear system
Expand All @@ -53,49 +57,68 @@ The %{name}-doc package contains all the help documentation along with C
and FORTRAN examples.

%prep
%autosetup -n %{name}_%{version} -p1
%autosetup -n %{genname}-%{version} -p1

rm -f make.inc
cp -pf %{SOURCE1} make.inc.in

# Remove bundled BLAS
rm -rf CBLAS

rm -fr SRC/mc64ad.f.bak
find . -type f | sed -e "/TESTING/d" | xargs chmod a-x

# Remove the shippped executables from EXAMPLE
find EXAMPLE -type f | while read file
do
[ "$(file $file | awk '{print $2}')" = ELF ] && rm $file || :
done

# Change optimization level
sed -i.bak '/NOOPTS/d' make.inc.in
sed -e 's|-O0|-O2|g' -i SRC/CMakeLists.txt

%build
mkdir -p build; cd build

# Do not use bundled CBLAS code
%cmake3 -Denable_blaslib:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release ..
%make_build
%cmake \
-Denable_internal_blaslib:BOOL=NO \
-DXSDK_ENABLE_Fortran:BOOL=OFF \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="%{__global_fflags}" \
-DTPL_BLAS_LIBRARIES="`pkg-config --libs flexiblas`" \
-DTPL_ENABLE_METISLIB:BOOL=ON \
-DTPL_METIS_INCLUDE_DIRS:PATH=%{_includedir} \
-DTPL_METIS_LIBRARIES:FILEPATH=%{_libdir}/libmetis.so \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_INCLUDEDIR:PATH=include/%{name} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \
-DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES
%cmake_build

%install
%make_install -C build
%cmake_install

%check
pushd build
ctest3 -V %{?_smp_mflags}
popd

%ldconfig_scriptlets
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:MATGEN
%ctest

%files
%license License.txt
%{_libdir}/libsuperlu.so.%{libver}*
%{_libdir}/libsuperlu.so.7
%{_libdir}/libsuperlu.so.%{version}

%files devel
%{_includedir}/%{name}/
%{_includedir}/
%{_libdir}/libsuperlu.so
%{_libdir}/cmake/%{genname}/
%{_libdir}/pkgconfig/%{genname}.pc

%files doc
%license License.txt
%doc DOC EXAMPLE FORTRAN

%changelog
* Tue Oct 15 2024 Jyoti Kanase <[email protected]> - 7.0.0-1
- Update to 7.0.0
-License verified

* Sat Jul 24 2021 Pawel Winogrodzki <[email protected]> - 5.2.1-10
- Removing unused BR on "atlas".

Expand Down
9 changes: 0 additions & 9 deletions SPECS-EXTENDED/SuperLU/superlu-cmake-includedir.patch

This file was deleted.

Loading
Loading