From 369b078d176e6e5f76ece8be249609a1446f21cd9b0ac944b6beab5542dbf7fc Mon Sep 17 00:00:00 2001 From: Dmitry Roshchin Date: Sat, 26 Oct 2024 11:48:03 +0000 Subject: [PATCH] - Fix %check for gnu-hpc flavor by loading openblas module before running ctest. - Update to version 7.0.0 * To avoid name clashes, use type "singlecomplex" instead of "complex". * Rank Deficient Matrices OBS-URL: https://build.opensuse.org/package/show/science/superlu?expand=0&rev=45 --- .gitattributes | 23 ++ .gitignore | 1 + README.SUSE | 10 + _multibuild | 4 + get-tarball.sh | 29 +++ superlu-6.0.1.tar.gz | 3 + superlu-7.0.0.tar.gz | 3 + superlu-make.linux.patch | 14 ++ superlu-remove-mc64ad.patch | 51 +++++ superlu.changes | 419 ++++++++++++++++++++++++++++++++++++ superlu.rpmlintrc | 8 + superlu.spec | 303 ++++++++++++++++++++++++++ 12 files changed, 868 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.SUSE create mode 100644 _multibuild create mode 100644 get-tarball.sh create mode 100644 superlu-6.0.1.tar.gz create mode 100644 superlu-7.0.0.tar.gz create mode 100644 superlu-make.linux.patch create mode 100644 superlu-remove-mc64ad.patch create mode 100644 superlu.changes create mode 100644 superlu.rpmlintrc create mode 100644 superlu.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.SUSE b/README.SUSE new file mode 100644 index 0000000..db372ec --- /dev/null +++ b/README.SUSE @@ -0,0 +1,10 @@ +This version of SuperLU is slightly different form the original SuperLU +available on http://crd.lbl.gov/~xiaoye/SuperLU/. For legal reasons the +routine mc64ad from the Harwell Subroutine Library cannot be redistributed +by openSUSE and have been removed form the sources. + +mc64ad.c sgsisx.c sldperm.c dgsisx.c dldperm.c cgsisx.c cldperm.c zgsisx.c zldperm.c +were removed from the tarball. + +However the SuperLU library provided by openSUSE is fully functionnal +except that the mc64ad routine is not used. diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..945ff53 --- /dev/null +++ b/_multibuild @@ -0,0 +1,4 @@ + + gnu-hpc + serial + diff --git a/get-tarball.sh b/get-tarball.sh new file mode 100644 index 0000000..654d99e --- /dev/null +++ b/get-tarball.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +VERSION=6.1.0 +FILES="mc64ad.c sgsisx.c sldperm.c dgsisx.c dldperm.c cgsisx.c cldperm.c zgsisx.c zldperm.c" +URL="https://github.com/xiaoyeli/superlu/archive/v$VERSION/superlu-$VERSION.tar.gz" +TAR="superlu-$VERSION.tar.gz" + +WORKDIR="$(mktemp -d superlu.XXXX)" + +TODIR="$(pwd)" +cd "$WORKDIR" + +wget $URL +tar xfz superlu-$VERSION.tar.gz + +for file in $FILES; do + rm superlu-$VERSION/SRC/$file +done + +if [ -e "$TODIR/$TAR" ]; then + echo "$TAR already exists." +else + tar cfz "$TODIR/$TAR" superlu-$VERSION +fi + +cd "$TODIR" +rm -r "$WORKDIR" + diff --git a/superlu-6.0.1.tar.gz b/superlu-6.0.1.tar.gz new file mode 100644 index 0000000..add0bc2 --- /dev/null +++ b/superlu-6.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cf85e6614ba1ebe5a70ecd03e194116f15517155e0742636c853a2ae9923210 +size 2644337 diff --git a/superlu-7.0.0.tar.gz b/superlu-7.0.0.tar.gz new file mode 100644 index 0000000..eb4b882 --- /dev/null +++ b/superlu-7.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3adc75d96869004b8bb8fa44e9ba77c1d90418340c61d302ffac72e9d22f9c1 +size 2460826 diff --git a/superlu-make.linux.patch b/superlu-make.linux.patch new file mode 100644 index 0000000..1eb19ef --- /dev/null +++ b/superlu-make.linux.patch @@ -0,0 +1,14 @@ +diff -Nrua a/MAKE_INC/make.linux b/MAKE_INC/make.linux +--- a/MAKE_INC/make.linux ++++ b/MAKE_INC/make.linux +@@ -21,8 +21,8 @@ + # + # The name of the libraries to be created/linked to + # +-SuperLUroot = $(HOME)/Dropbox/Codes/SuperLU/SuperLU +-SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_5.1.a ++SuperLUroot = @superlu_home@ ++SUPERLULIB = @superlu_lib@ + + #BLASLIB = $(SuperLUroot)/lib/libblas.a + diff --git a/superlu-remove-mc64ad.patch b/superlu-remove-mc64ad.patch new file mode 100644 index 0000000..a936436 --- /dev/null +++ b/superlu-remove-mc64ad.patch @@ -0,0 +1,51 @@ +diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt +--- a/SRC/CMakeLists.txt ++++ b/SRC/CMakeLists.txt +@@ -23,7 +23,6 @@ set(sources + ilu_relax_snode.c + ilu_heap_relax_snode.c + mark_relax.c +- mc64ad.c + qselect.c + input_error.c + ) +@@ -66,9 +65,7 @@ if(enable_single) + smemory.c + sutil.c + smyblas2.c +- sgsisx.c + sgsitrf.c +- sldperm.c + ilu_sdrop_row.c + ilu_ssnode_dfs.c + ilu_scolumn_dfs.c +@@ -116,9 +113,7 @@ if(enable_double) + dmemory.c + dutil.c + dmyblas2.c +- dgsisx.c + dgsitrf.c +- dldperm.c + ilu_ddrop_row.c + ilu_dsnode_dfs.c + ilu_dcolumn_dfs.c +@@ -169,9 +164,7 @@ if(enable_complex) + cmemory.c + cutil.c + cmyblas2.c +- cgsisx.c + cgsitrf.c +- cldperm.c + ilu_cdrop_row.c + ilu_csnode_dfs.c + ilu_ccolumn_dfs.c +@@ -220,9 +213,7 @@ if(enable_complex16) + zmemory.c + zutil.c + zmyblas2.c +- zgsisx.c + zgsitrf.c +- zldperm.c + ilu_zdrop_row.c + ilu_zsnode_dfs.c + ilu_zcolumn_dfs.c diff --git a/superlu.changes b/superlu.changes new file mode 100644 index 0000000..97e72f2 --- /dev/null +++ b/superlu.changes @@ -0,0 +1,419 @@ +------------------------------------------------------------------- +Wed Oct 23 12:11:46 UTC 2024 - Atri Bhattacharya + +- Fix %check for gnu-hpc flavor by loading openblas module before + running ctest. + +------------------------------------------------------------------- +Sat Oct 12 21:07:32 UTC 2024 - Christoph G + +- Update to version 7.0.0 + * To avoid name clashes, use type "singlecomplex" instead of + "complex". + * Rank Deficient Matrices + +------------------------------------------------------------------- +Sun Aug 6 08:39:35 UTC 2023 - Christoph G + +- Update to version 6.0.1 + * Doxygen cleanup + * Fix memory leak in ILU routines + * Clean up some f2c-ed files +- Run regression tests with CTest +- Disable building examples +- Update patch superlu-remove-mc64ad.patch +- Drop patch superlu-examples_Makefile_remove_itersol.patch as + we use CMake and no longer the provided Makefiles. And + examples are no longer built. + +------------------------------------------------------------------- +Mon May 1 10:05:57 UTC 2023 - Egbert Eich + +- Fix broken magic in HPC module file. This has been broken since: + Wed Apr 19 23:20:41 UTC 2023 - Christoph G + + - Fix two rpmlint warning. +- Add rpmlintrc. + +------------------------------------------------------------------- +Wed Apr 19 23:20:41 UTC 2023 - Christoph G + +- Fix two rpmlint warning. + +------------------------------------------------------------------- +Sun Apr 16 07:22:44 UTC 2023 - Atri Bhattacharya + +- Make doc and example packages noarch. + +------------------------------------------------------------------- +Sun Apr 9 03:01:30 UTC 2023 - Christoph G + +- update to version 6.0.0 + * Add 64-bit indexing support, with mixed int and int64_t types. + * Add METIS ordering option. + * Add FORTRAN/CMakeLists.txt +- Update and rename patch superlu-5.2-remove-mc64ad.patch to + superlu-remove-mc64ad.patch +- update superlu-examples_Makefile_remove_itersol.patch + +------------------------------------------------------------------- +Thu Sep 30 19:47:48 UTC 2021 - Antoine Ginies + +- update to version 5.3.0 (JSC#SLE-22138) + +------------------------------------------------------------------- +Thu Jan 28 17:45:16 UTC 2021 - Egbert Eich + +- Change 'Requires:' to other HPC packages to %requires_eq to depend + on the exact version. This should take care of HPC packages ignoring + proper ABI versioning. + +------------------------------------------------------------------- +Mon Nov 16 14:41:49 UTC 2020 - Ana Guerrero Lopez + +- Fix package name, re-add lines removed by mistake. + This fix duplicate binary names. (boo#1178840) + +------------------------------------------------------------------- +Mon Oct 26 14:11:13 UTC 2020 - Ana Guerrero Lopez + +- New version 5.2.2 (boo#1178112) + - bugfixes, documentation and examples update. +- Update URL and Source0 and Source1, use get_tarball.sh to remove + non distributable files. +- Install superlu_ug.pdf provided by the tarball. +- Remove patch, merged upstream + * superlu-4.3-include.patch + * superlu-4.3-dont-opt-away.diff + * superlu-5.2-make.patch +- Refresh patch: + * superlu-examples_Makefile_remove_itersol.patch + * superlu-make.linux.patch + +------------------------------------------------------------------- +Fri Sep 11 06:13:46 UTC 2020 - Egbert Eich + +- Add build support for gcc10 to HPC build (bsc#1174439). + +------------------------------------------------------------------- +Wed Feb 26 12:30:51 UTC 2020 - Egbert Eich + +- Add support for gcc8/9 building (jsc#SLE-8604). + +------------------------------------------------------------------- +Thu Feb 14 09:16:02 UTC 2019 - Jan Engelhardt + +- Fix the package group fix. + +------------------------------------------------------------------- +Sun Feb 10 23:11:37 UTC 2019 - Egbert Eich + +- Fix dependencies. +- Fix %%post and %%postun scripts for HPC. +- Fix HPC modulefile. +- Fix package groups. +- Generate and add pkgconfig files. + +------------------------------------------------------------------- +Fri Feb 8 10:50:43 UTC 2019 - eich@suse.com + +- Set default module version correctly when installing + master package, unset when deinstalling the default library + package. +- make example make.inc work with non-HPC builds as well. + +------------------------------------------------------------------- +Fri Feb 8 09:40:33 UTC 2019 - Antoine Ginies + +- Add superlu-examples_Makefile_remove_itersol.patch + superlu-make.linux.patch: + get a buildable examples test suite (bsc#1124765) + fixing Makefile + adding missing make.inc + +------------------------------------------------------------------- +Tue Jan 22 11:58:01 UTC 2019 - eich@suse.com + +- Disable HPC builds for ring testing on Factory submissions. + +------------------------------------------------------------------- +Mon Jan 21 15:09:13 UTC 2019 - eich@suse.com + +- Fix a word in a comment. +- Remove some colloquialism from a package description. + +------------------------------------------------------------------- +Fri Jan 18 14:46:44 UTC 2019 - eich@suse.com + +- Reenable ldconfig in %post and %postun for HPC but don't let it + update the cache: this would be pointless for libraries in + non-standard locations. + +------------------------------------------------------------------- +Thu Jan 10 09:31:45 UTC 2019 - eich@suse.com + +- Moved HPC module from devel to library package. +- Modified summary for devel package. + +------------------------------------------------------------------- +Fri Oct 26 19:55:59 UTC 2018 - eich@suse.com + +- Add environment module support for HPC. + * create baselib.conf on the fly. +- Add superlu-5.2-make.patch: + add compiler and build flags in make.inc. +- Separate off documentation and examples to separate packages. + +------------------------------------------------------------------- +Tue Jun 14 12:56:22 UTC 2016 - badshah400@gmail.com + +- Use system blas by passing the cmake option + -DUSE_XSDK_DEFAULTS='TRUE'. +- Disable building tests for now because they have linking issues. +- Use cmake macros wherever appropriate. +- A minimum of cmake >= 2.8.12 is required for building. + +------------------------------------------------------------------- +Sun May 29 16:30:52 UTC 2016 - foss@grueninger.de + +- Update to SuperLU 5.2.1 +- Switch to CMake as build-system +- Drop superlu-4.3-disable-hsl.patch as CMake is now used +- Update to latest SuperLU User Guide +- superlu-4.3.diff, superlu-4.3-remove-hsl.patch: removed +- superlu-5.2-remove-mc64ad.patch: new, routine was removed + +------------------------------------------------------------------- +Wed Jul 29 09:34:51 UTC 2015 - dimstar@opensuse.org + +- Add baselibs.conf: build libsuperlu4-32bit, as needed by + libarmadillo. + +------------------------------------------------------------------- +Tue Jan 15 21:14:51 UTC 2013 - scorot@free.fr + +- repackage original source tarball in order to remove the + HSL mc64ad routine that caonnt be redistributed bnc#796236 +- add README.SUSE file in the %%doci in order to explain + that change + +------------------------------------------------------------------- +Tue Jan 8 20:47:13 UTC 2013 - scorot@free.fr + +- add patch superlu-4.3-disable-hsl.patch in order to disable HSL + code from the library +- update patch superlu-4.3.diff so that test routines are run + against the shared library +- build tests routines in %%check section + +------------------------------------------------------------------- +Tue Dec 18 22:21:27 UTC 2012 - scorot@free.fr + +- Update to SuperLU 4.3: + * Remove recursive DFS for postordering elimination tree in + sp_coletree.c (The nonrecursive routine nr_etdfs() was + contributed by Cedric Doucet, CEDRAT Group, Meylan, France.) + * Make supermatrix.h the same for all three libraries + * Include an on-line HTML documentation for the source code + * Corrected backward error BERR formula when a component of the + RHS and the residual are exactly zero + * Change parameter "delta" to genmmd() from 1 to 0 in get_perm_c + remove "static" declaration in EXAMPLE/xlinsolx*.c + * Include threshold-based incomplete factorization (ILU) + * Removed the static global variables so that it is thread-safe. + * Make superlu_options_t{} structure and enum constants the same + for both superlu & superlu_dist. + * Replace qsort by "quick select" (qselect) in ILU's secondary + dropping. + * Replace mc64ad.f by mc64ad.c using f2c. + * Bug fixes in ilu_sdrop_row.c. + * Bug fixes in xgsisx.c, so that when mc64 permutation is used + in ILU, the right-hand side is permuted properly. + * Add parameter #7 in sp_ienv(), setting as the maxsuper for ILU + code (smaller than parameter #3). + * Update Users Guide. + * Update doxygen code documentation. + * Fix a bug in ILU driver routine dgsisx.c, so that on return, + the initial row permutation is combined with perm_r[] from + partial pivoting. + * Modify 2 ILU examples: EXAMPLE/ditersol.c, EXAMPLE/ditersol1.c + * Update superlu_timer.c +- Remove unneeded patches + + superlu-overflow.patch : Applied upstream + + superlu-initialize.diff : Applied upstream + + superlu-undef-code.diff : Applied upstream +- Updated patches + + superlu-4.3.diff + + superlu-4.3-include.patch + + superlu-4.3-dont-opt-away.diff +- Build shared libraries +- Put shared libs and devel files in separate packages +- Use rpm macros instead of plain directory names +- Add %%ckeck +- Update documentation file %%source1 and put html and examples + files in %%doc +- Spec file reformating + +------------------------------------------------------------------- +Sun Jan 29 01:48:27 UTC 2012 - jengelh@medozas.de + +- Remove redundant tags/sections per specfile guideline suggestions +- Parallel building using %_smp_mflags + +------------------------------------------------------------------- +Thu Jun 22 18:18:46 CEST 2006 - ro@suse.de + +- remove selfprovides + +------------------------------------------------------------------- +Mon Mar 27 02:23:29 CEST 2006 - garloff@suse.de + +- superlu-undef-code.diff: Fix undefined code (#160443). + +------------------------------------------------------------------- +Wed Jan 25 21:41:53 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Thu Dec 22 19:26:34 CET 2005 - garloff@suse.de + +- Install header files into /usr/include/superlu/ +- Update User Guide. + +------------------------------------------------------------------- +Wed Dec 21 13:33:20 CET 2005 - garloff@suse.de + +- Include EXAMPLE dir as documentation. +- Build as non-root. +- Nuke unused local vars referencing uninitialized vars. + +------------------------------------------------------------------- +Wed Dec 21 02:17:35 CET 2005 - garloff@suse.de + +- Update to SuperLU-3.0: [#133821] + * Added "options" input argument and "stat" output argument + for the driver routines + * More Examples + * Added a "symmetric mode" for (nearly) symmetric matrices + * Better Fortran interface. + * fixed a bug in the complex drivers sgssvx/zgssvx when the + input matrix is stored in compressed row format. + * prefixed the header files by "slu_". + * Fixed a memory leak in get_perm_c() when bnz=0. + * Changed "abs" to "fabs" in izmax1. + * Upgraded COLAMD to the latest version (2.3).15 +- Add various declarations and #include statements +- Trick compiler into not optimizing away a loop in our timing + measurement. + +------------------------------------------------------------------- +Fri Nov 25 14:20:00 CET 2005 - yxu@suse.de + +- add missing function prototypes + +------------------------------------------------------------------- +Tue Nov 15 13:42:23 CET 2005 - dmueller@suse.de + +- avoid an endless loop during building (#133820) + +------------------------------------------------------------------- +Mon May 9 17:24:12 CEST 2005 - meissner@suse.de + +- fixed 1 byte buffer overflows. + +------------------------------------------------------------------- +Mon Dec 20 02:58:44 CET 2004 - garloff@suse.de + +- Pass $(RPM_OPT_FLAGS) -Os -fPIC for files that don't need to be + optimized. + +------------------------------------------------------------------- +Sat Sep 6 19:31:26 CEST 2003 - garloff@suse.de + +- Add -fPIC to allow inclusion in dynamic lib. + +------------------------------------------------------------------- +Sun Aug 10 22:19:09 CEST 2003 - garloff@suse.de + +- -O3 leads to an endless loop in dlamanch test on x86. Probably + some compiler of FPU weirdness. Remove -O3 on x86 again. + +------------------------------------------------------------------- +Thu Aug 7 16:49:54 CEST 2003 - garloff@suse.de + +- Adapt chown syntax to owner:group. +- Reenable -O3 (compiler bug fixed?), but limit automatical + inlining. + +------------------------------------------------------------------- +Wed Jun 18 02:23:54 CEST 2003 - ro@suse.de + +- added directory to filelist. + +------------------------------------------------------------------- +Wed Aug 28 11:40:33 CEST 2002 - ro@suse.de + +- remove -O3 from cflags (results in endless loop). + +------------------------------------------------------------------- +Wed May 8 18:40:16 CEST 2002 - garloff@suse.de + +- lib64 fix. + +------------------------------------------------------------------- +Wed May 8 15:52:24 MEST 2002 - garloff@suse.de + +- Fix test scripts. +- Use BuildRoot. + +------------------------------------------------------------------- +Wed May 8 13:59:11 MEST 2002 - garloff@suse.de + +- Remove BLAS, Lapack. +- Rename package into SuperLU. + +------------------------------------------------------------------- +Sat Apr 20 14:42:04 MEST 2002 - garloff@suse.de + +- Disable -fast-math +- In SuperLU, use CBLAS that ships with it + +------------------------------------------------------------------- +Fri Apr 19 20:17:57 MEST 2002 - garloff@suse.de + +- Update to + * CLAPACK-3.0 + * SuperLU-2.0 +- Added SuperLU user guide + +------------------------------------------------------------------- +Fri Apr 19 20:17:23 MEST 2002 - garloff@suse.de + +- Fixed compilation with gcc-3.1: + link with -lfrtbegin (which contains main formerly in g2c) + +------------------------------------------------------------------- +Wed Apr 10 01:49:54 CEST 2002 - ro@suse.de + +- fix owner for README.SuperLU + +------------------------------------------------------------------- +Mon Aug 7 22:12:27 CEST 2000 - garloff@suse.de + +- Use %{_docdir} to put docu in the right place. + +------------------------------------------------------------------- +Mon Aug 7 19:32:14 CEST 2000 - garloff@suse.de + +- Add -mcpu=pentiumpro for i386 + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Wed Sep 1 00:21:25 CEST 1999 - garloff@suse.de + +- First creation of package. diff --git a/superlu.rpmlintrc b/superlu.rpmlintrc new file mode 100644 index 0000000..6f5d6e6 --- /dev/null +++ b/superlu.rpmlintrc @@ -0,0 +1,8 @@ +# In multibuild spec file names are expected to be different from source package names +addFilter(".*-hpc.*: E: invalid-spec-name") +# 'hidden' file names are standard for environment modules +addFilter(".*: W: hidden-file-or-dir /usr/share/lmod/.*/.version.*") +# Not a macro but the file magic for environment module files +addFilter(".*: W: macro-in-comment %Module1") +# Not a doc but an example package +addFilter(".*-examples.noarch: W: package-with-huge-docs .*") diff --git a/superlu.spec b/superlu.spec new file mode 100644 index 0000000..c29561e --- /dev/null +++ b/superlu.spec @@ -0,0 +1,303 @@ +# +# spec file +# +# 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/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} + +# Base package name +%define pname superlu +%define ver 7.0.0 +%define _ver %(echo %{ver} | tr . _) + +%if "%flavor" == "" +ExclusiveArch: do_not_build +%endif + +%if "%{flavor}" == "serial" +%bcond_with hpc +%endif + +%if "%{flavor}" == "gnu-hpc" +%bcond_without hpc +%global compiler_family gnu +%undefine c_f_ver +%endif + +%if "%{flavor}" == "gnu7-hpc" +%bcond_without hpc +%global compiler_family gnu +%define c_f_ver 7 +%endif + +%if "%{flavor}" == "gnu8-hpc" +%bcond_without hpc +%global compiler_family gnu +%define c_f_ver 8 +%endif + +%if "%{flavor}" == "gnu9-hpc" +%bcond_without hpc +%global compiler_family gnu +%define c_f_ver 9 +%endif + +%if "%{flavor}" == "gnu10-hpc" +%bcond_without hpc +%global compiler_family gnu +%define c_f_ver 10 +%endif + +%bcond_with ringdisabled + +%if %{with hpc} && %{with ringdisabled} +ExclusiveArch: do_not_build +%endif + +%define package_name %pname +%if %{without hpc} +%define p_prefix %_prefix +%define p_includedir %_includedir +%define p_libdir %_libdir +%define _sover 7 +%define libname lib%{name}%{?_sover} +%else +%{hpc_init -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} %{?ext:-e %{ext}}} +%define package_name %{hpc_package_name %_ver} +%define p_prefix %hpc_prefix +%define p_includedir %hpc_includedir +%define p_libdir %hpc_libdir +%define libname lib%{name} +%endif + +Name: %{package_name} +Summary: A general purpose library for the direct solution of linear equations +License: BSD-3-Clause +Group: Productivity/Scientific/Math +Version: %{ver} +Release: 0 +URL: https://portal.nersc.gov/project/sparse/superlu/ +Source0: %{pname}-%{version}.tar.gz +# Tarball above is generated with the script below +Source1: get-tarball.sh +Source2: README.SUSE +Source3: superlu.rpmlintrc +# PATCH-FIX-OPENSUSE superlu-remove-mc64ad.patch [bnc#796236] +# The Harwell Subroutine Library (HSL) routine mc64ad.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 +Patch0: superlu-remove-mc64ad.patch +Patch1: superlu-make.linux.patch +BuildRequires: cmake >= 3.5 +BuildRequires: fdupes +BuildRequires: tcsh +%if %{without hpc} +BuildRequires: blas-devel +BuildRequires: gcc-fortran +%else +Requires: %{compiler_family}%{?c_f_ver}-compilers-hpc +BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel +BuildRequires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel +BuildRequires: suse-hpc >= 0.5.20230501 +%endif + +%description +SuperLU is an algorithm that uses group theory to optimize LU +decomposition of sparse matrices. + +Documentation can be found in the %{name}-doc package or on +https://portal.nersc.gov/project/sparse/superlu/. + +%package -n %libname +Summary: SuperLU matrix solver +Group: System/Libraries +%if %{with hpc} +%{requires_eq libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc} +Requires: lua-lmod >= 7.6.1 +%hpc_requires +%endif + +%description -n %libname +SuperLU is an algorithm that uses group theory to optimize LU +decomposition of sparse matrices. + +%package devel +Summary: Headers and development library for lib%{name}%{?_sover} +Group: Development/Libraries/C and C++ +Requires: %libname = %version +%if %{with hpc} +%{requires_eq libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel} +%hpc_requires_devel +%endif +Recommends: %name-doc + +%description devel +SuperLU headers and libraries files needed for development %{with_hpc:(HPC variant)} + +%package doc +Summary: Documentation for %name +Group: Documentation/Other +BuildArch: noarch + +%description doc +Documentation (HTML/PDF) for SuperLU. +SuperLU is an algorithm that uses group theory to optimize LU +decomposition of sparse matrices. + +%package examples +Summary: Examples for %name +Group: Documentation/Other +Recommends: %name-devel +BuildArch: noarch + +%description examples +Example programs for SuperLU. +SuperLU is an algorithm that uses group theory to optimize LU +decomposition of sparse matrices. + +%if %{with hpc} +%{hpc_master_package -l -L} +%{hpc_master_package -L devel} +%{hpc_master_package doc} +%{hpc_master_package -L examples} +%endif + +%prep +%setup -q -n superlu-%{version} +%autopatch -p1 +cp %SOURCE2 ./ +# Create baselibs.conf dynamically (non-HPC build only). +%if %{without hpc} +cat > %{_sourcedir}/baselibs.conf <