Skip to content

Commit

Permalink
Update Superlu to v7.0.0 (#2029)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g authored Sep 26, 2024
1 parent 7b6db01 commit 3fe9996
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 118 deletions.

This file was deleted.

28 changes: 15 additions & 13 deletions components/serial-libs/superlu/SOURCES/superlu-4.3-include.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
diff -aruN SuperLU_4.3.orig/TESTING/ddrive.c SuperLU_4.3/TESTING/ddrive.c
--- SuperLU_4.3.orig/TESTING/ddrive.c 2011-10-27 21:49:47.000000000 +0200
+++ SuperLU_4.3/TESTING/ddrive.c 2012-12-20 22:14:43.026465899 +0100
@@ -11,6 +11,7 @@
* Purpose: MAIN test program
diff --git i/TESTING/ddrive.c w/TESTING/ddrive.c
index 9bb18db..30037f4 100644
--- i/TESTING/ddrive.c
+++ w/TESTING/ddrive.c
@@ -29,6 +29,7 @@ at the top-level directory.
*/
#include <getopt.h>
#include <string.h>
+#include <unistd.h>
#include "slu_ddefs.h"
#include "MATGEN/matgen.h"

#define NTESTS 5 /* Number of test types */
diff -aruN SuperLU_4.3.orig/TESTING/sdrive.c SuperLU_4.3/TESTING/sdrive.c
--- SuperLU_4.3.orig/TESTING/sdrive.c 2011-10-27 21:49:47.000000000 +0200
+++ SuperLU_4.3/TESTING/sdrive.c 2012-12-20 22:14:43.030465752 +0100
@@ -11,6 +11,7 @@
* Purpose: MAIN test program
diff --git i/TESTING/sdrive.c w/TESTING/sdrive.c
index e2623d8..90bc782 100644
--- i/TESTING/sdrive.c
+++ w/TESTING/sdrive.c
@@ -29,6 +29,7 @@ at the top-level directory.
*/
#include <getopt.h>
#include <string.h>
+#include <unistd.h>
#include "slu_sdefs.h"

#define NTESTS 5 /* Number of test types */
#include "MATGEN/matgen.h"

Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
--- SuperLU_5.1/SRC/Makefile 2015-12-03 17:06:38.000000000 -0800
+++ SuperLU_5.1.patch/SRC/Makefile 2016-02-25 10:10:26.123948600 -0800
@@ -38,7 +38,7 @@
diff --git i/SRC/Makefile w/SRC/Makefile
index 2dbd9e5..0214fa2 100644
--- i/SRC/Makefile
+++ w/SRC/Makefile
@@ -33,7 +33,7 @@
sp_coletree.o sp_preorder.o sp_ienv.o relax_snode.o \
heap_relax_snode.o colamd.o \
ilu_relax_snode.o ilu_heap_relax_snode.o mark_relax.o \
- mc64ad.o qselect.o input_error.o smach.o dmach.o
+ qselect.o input_error.o smach.o dmach.o
- mc64ad.o qselect.o input_error.o dmach.o smach.o
+ qselect.o input_error.o dmach.o smach.o

SLUSRC = \
sgssv.o sgssvx.o \
@@ -50,7 +50,7 @@
sreadhb.o sreadrb.o sreadtriple.o \
@@ -44,7 +44,7 @@
spanel_dfs.o spanel_bmod.o \
sreadhb.o sreadrb.o sreadtriple.o sreadMM.o \
scolumn_dfs.o scolumn_bmod.o spivotL.o spruneL.o \
smemory.o sutil.o smyblas2.o \
- sgsisx.o sgsitrf.o sldperm.o \
+ sgsitrf.o \
- smemory.o sutil.o smyblas2.o sgsisx.o sgsitrf.o sldperm.o \
+ smemory.o sutil.o smyblas2.o sgsitrf.o \
ilu_sdrop_row.o ilu_ssnode_dfs.o \
ilu_scolumn_dfs.o ilu_spanel_dfs.o ilu_scopy_to_ucol.o \
ilu_spivotL.o sdiagonal.o slacon2.o
@@ -64,7 +64,7 @@
dreadhb.o dreadrb.o dreadtriple.o \
@@ -57,7 +57,7 @@
dsnode_dfs.o dsnode_bmod.o dpanel_dfs.o dpanel_bmod.o \
dreadhb.o dreadrb.o dreadtriple.o dreadMM.o \
dcolumn_dfs.o dcolumn_bmod.o dpivotL.o dpruneL.o \
dmemory.o dutil.o dmyblas2.o \
- dgsisx.o dgsitrf.o dldperm.o \
+ dgsitrf.o \
- dmemory.o dutil.o dmyblas2.o dgsisx.o dgsitrf.o dldperm.o \
+ dmemory.o dutil.o dmyblas2.o dgsitrf.o \
ilu_ddrop_row.o ilu_dsnode_dfs.o \
ilu_dcolumn_dfs.o ilu_dpanel_dfs.o ilu_dcopy_to_ucol.o \
ilu_dpivotL.o ddiagonal.o dlacon2.o
@@ -79,7 +79,7 @@
creadhb.o creadrb.o creadtriple.o \
ilu_dpivotL.o ddiagonal.o dlacon2.o dGetDiagU.o
@@ -72,7 +72,7 @@
creadhb.o creadrb.o creadtriple.o creadMM.o \
ccolumn_dfs.o ccolumn_bmod.o cpivotL.o cpruneL.o \
cmemory.o cutil.o cmyblas2.o \
- cgsisx.o cgsitrf.o cldperm.o \
+ cgsitrf.o \
ilu_cdrop_row.o ilu_csnode_dfs.o \
ilu_ccolumn_dfs.o ilu_cpanel_dfs.o ilu_ccopy_to_ucol.o \
ilu_cpivotL.o cdiagonal.o clacon2.o scsum1.o icmax1.o
@@ -93,7 +93,7 @@
zreadhb.o zreadrb.o zreadtriple.o \
@@ -86,7 +86,7 @@
zreadhb.o zreadrb.o zreadtriple.o zreadMM.o \
zcolumn_dfs.o zcolumn_bmod.o zpivotL.o zpruneL.o \
zmemory.o zutil.o zmyblas2.o \
- zgsisx.o zgsitrf.o zldperm.o \
Expand Down
44 changes: 0 additions & 44 deletions components/serial-libs/superlu/SOURCES/superlu-5.2-make.patch

This file was deleted.

36 changes: 16 additions & 20 deletions components/serial-libs/superlu/SPECS/superlu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,24 @@ Name: %{pname}-%{compiler_family}%{PROJ_DELIM}
Summary: A general purpose library for the direct solution of linear equations
License: BSD-3-Clause
Group: %{PROJ_NAME}/serial-libs
Version: 5.2.1
Version: 7.0.0
Release: 0%{?dist}
Source0: http://crd-legacy.lbl.gov/%7Exiaoye/SuperLU/%{pname}_%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE superlu-5.1-make.patch : add compiler and build flags in make.inc
Patch: superlu-5.2-make.patch
Source0: https://github.com/xiaoyeli/%{pname}/archive/refs/tags/v%{version}.tar.gz
# PATCH-FIX-UPSTREAM superlu-4.3-include.patch : avoid implicit declaration warnings
Patch1: superlu-4.3-include.patch
# PATCH-FIX-UPSTREAM superlu-4.3-dont-opt-away.diff
Patch2: superlu-4.3-dont-opt-away.diff
Patch: superlu-4.3-include.patch
# PATCH-FIX-OPENSUSE superlu-5.1-remove-hsl.patch [bnc#796236]
# The Harwell Subroutine Library (HSL) routine m64ad.c have been removed
# from the original sources for legal reasons. This patch disables the inclusion of
# this routine in the library which, however, remains fully functional
Patch3: superlu-5.1-disable-hsl.patch
Patch1: superlu-5.1-disable-hsl.patch
Url: http://crd.lbl.gov/~xiaoye/SuperLU/

%if "%{compiler_family}" != "intel" && "%{compiler_family}" != "arm1"
Requires: openblas-%{compiler_family}%{PROJ_DELIM}
%endif

Requires: lmod%{PROJ_DELIM} >= 7.6.1
BuildRequires: make
BuildRequires: make cmake
BuildRequires: tcsh

# Default library install path
Expand All @@ -54,34 +50,34 @@ linear systems that the author is aware of.
Docu can be found on http://www.netlib.org.

%prep
%setup -q -n SuperLU_%{version}
%setup -q -n superlu-%{version}
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
%ohpc_setup_compiler
export DEFAULT_OPTS="${CFLAGS} -Wno-implicit-int"
export DEFAULT_OPTS="${DEFAULT_OPTS} -Wno-implicit-function-declaration"
export DEFAULT_OPTS="${CFLAGS} -Wno-implicit-int -Wno-implicit-function-declaration -fPIC -DPIC"
export BLAS_LIB_EXPORT="-lopenblas"
export USE_VENDOR_BLAS=1
%if "%{compiler_family}" == "arm1"
export DEFAULT_OPTS="${DEFAULT_OPTS} -fsimdmath"
%endif

make lib
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./build -DCMAKE_C_FLAGS="${DEFAULT_OPTS}"
cmake --build build --target superlu

mkdir tmp
(cd tmp; ar -x ../SRC/libsuperlu.a)
$FC -shared -Wl,-soname,libsuperlu.so.4 -o lib/libsuperlu.so tmp/*.o
mkdir tmp lib
(cd tmp; ar -x ../build/SRC/libsuperlu.a)
$FC -shared -Wl,-soname,libsuperlu.so.7 -o lib/libsuperlu.so tmp/*.o

%install
mkdir -p %{buildroot}%{install_path}/lib
mkdir -p %{buildroot}%{install_path}/include
install -m644 SRC/*.h %{buildroot}%{install_path}/include
install -m755 lib/libsuperlu.so %{buildroot}%{install_path}/lib/libsuperlu.so.%{version}
pushd %{buildroot}%{install_path}/lib
ln -s libsuperlu.so.%{version} libsuperlu.so.4
ln -s libsuperlu.so.4 libsuperlu.so
ln -s libsuperlu.so.%{version} libsuperlu.so.7
ln -s libsuperlu.so.7 libsuperlu.so
popd

# OpenHPC module file
Expand Down

0 comments on commit 3fe9996

Please sign in to comment.