From aaef16b14cf9dc0b28f55f9537f0557ea042f245 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 21 Feb 2023 13:56:40 +0100 Subject: [PATCH] Port to C99 Related to: --- SuperLU-c99.patch | 291 ++++++++++++++++++++++++++++++++++++++++++++++ SuperLU.spec | 6 +- 2 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 SuperLU-c99.patch diff --git a/SuperLU-c99.patch b/SuperLU-c99.patch new file mode 100644 index 0000000..4f7cf33 --- /dev/null +++ b/SuperLU-c99.patch @@ -0,0 +1,291 @@ +Avoid implicit function declarations and implicit ints for improved +compatibility with future compilers. + +Submitted upstream: + +diff --git a/EXAMPLE/cfgmr.c b/EXAMPLE/cfgmr.c +index 0f25f58923aa0c7e..d8f523f9b67fa5ca 100644 +--- a/EXAMPLE/cfgmr.c ++++ b/EXAMPLE/cfgmr.c +@@ -33,6 +33,8 @@ For information on ITSOL contact saad@cs.umn.edu + + #define epsmac 1.0e-16 + ++extern int ccopy_(int *, complex *, int *, complex *, int *); ++extern void caxpy_(int *, complex *, complex *, int *, complex *, int *); + extern void cdotc_(complex *, int *, complex [], int *, complex [], int *); + extern float scnrm2_(int *, complex [], int *); + +diff --git a/EXAMPLE/clinsolx.c b/EXAMPLE/clinsolx.c +index bcf91124458cabbd..e4401b01b03e087f 100644 +--- a/EXAMPLE/clinsolx.c ++++ b/EXAMPLE/clinsolx.c +@@ -18,6 +18,8 @@ at the top-level directory. + */ + #include "slu_cdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + char equed[1]; +diff --git a/EXAMPLE/clinsolx1.c b/EXAMPLE/clinsolx1.c +index 8c540d172194c9ad..8a4e8e5a2aa79ea9 100644 +--- a/EXAMPLE/clinsolx1.c ++++ b/EXAMPLE/clinsolx1.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_cdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/clinsolx2.c b/EXAMPLE/clinsolx2.c +index 7fd680456c2baf3e..038bb4a77e41b3c8 100644 +--- a/EXAMPLE/clinsolx2.c ++++ b/EXAMPLE/clinsolx2.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_cdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/clinsolx3.c b/EXAMPLE/clinsolx3.c +index 973eb2736b00fb4b..33a1ac2e164841b3 100644 +--- a/EXAMPLE/clinsolx3.c ++++ b/EXAMPLE/clinsolx3.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_cdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/dfgmr.c b/EXAMPLE/dfgmr.c +index e19f11968199b7d3..97a3250c884d5495 100644 +--- a/EXAMPLE/dfgmr.c ++++ b/EXAMPLE/dfgmr.c +@@ -33,6 +33,8 @@ For information on ITSOL contact saad@cs.umn.edu + + #define epsmac 1.0e-16 + ++extern int dcopy_(int *, double *, int *, double *, int *); ++extern void daxpy_(int *, double *, double *, int *, double *, int *); + extern double ddot_(int *, double [], int *, double [], int *); + extern double dnrm2_(int *, double [], int *); + +diff --git a/EXAMPLE/dlinsolx.c b/EXAMPLE/dlinsolx.c +index fdfd6727909f3308..271dd0b94815649c 100644 +--- a/EXAMPLE/dlinsolx.c ++++ b/EXAMPLE/dlinsolx.c +@@ -18,6 +18,8 @@ at the top-level directory. + */ + #include "slu_ddefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + char equed[1]; +diff --git a/EXAMPLE/dlinsolx1.c b/EXAMPLE/dlinsolx1.c +index e6993f956f31c5fe..7038ece2ac29aa46 100644 +--- a/EXAMPLE/dlinsolx1.c ++++ b/EXAMPLE/dlinsolx1.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_ddefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/dlinsolx2.c b/EXAMPLE/dlinsolx2.c +index 7050f438a8f29a96..5d93b81d9871fb11 100644 +--- a/EXAMPLE/dlinsolx2.c ++++ b/EXAMPLE/dlinsolx2.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_ddefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/dlinsolx3.c b/EXAMPLE/dlinsolx3.c +index 0a82c7bbea362a2d..bc51680e3ddc205d 100644 +--- a/EXAMPLE/dlinsolx3.c ++++ b/EXAMPLE/dlinsolx3.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_ddefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/sfgmr.c b/EXAMPLE/sfgmr.c +index f2428200f0b27040..1358b5c95c2c1ff2 100644 +--- a/EXAMPLE/sfgmr.c ++++ b/EXAMPLE/sfgmr.c +@@ -33,6 +33,8 @@ For information on ITSOL contact saad@cs.umn.edu + + #define epsmac 1.0e-16 + ++extern int scopy_(int *, float *, int *, float *, int *); ++extern void saxpy_(int *, float *, float *, int *, float *, int *); + extern float sdot_(int *, float [], int *, float [], int *); + extern float snrm2_(int *, float [], int *); + +diff --git a/EXAMPLE/slinsolx.c b/EXAMPLE/slinsolx.c +index 32f1788b67bb3a28..9de609badc07c614 100644 +--- a/EXAMPLE/slinsolx.c ++++ b/EXAMPLE/slinsolx.c +@@ -18,6 +18,8 @@ at the top-level directory. + */ + #include "slu_sdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + char equed[1]; +diff --git a/EXAMPLE/slinsolx1.c b/EXAMPLE/slinsolx1.c +index 2d9ab0875aba1ac6..c1726cb73f484747 100644 +--- a/EXAMPLE/slinsolx1.c ++++ b/EXAMPLE/slinsolx1.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_sdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/slinsolx2.c b/EXAMPLE/slinsolx2.c +index aca9dc13b405b48a..ad4a06f8ed906723 100644 +--- a/EXAMPLE/slinsolx2.c ++++ b/EXAMPLE/slinsolx2.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_sdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/slinsolx3.c b/EXAMPLE/slinsolx3.c +index cb3356cd48bd5df9..0aefbd90e698b992 100644 +--- a/EXAMPLE/slinsolx3.c ++++ b/EXAMPLE/slinsolx3.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_sdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/sp_ienv.c b/EXAMPLE/sp_ienv.c +index 266b4eeb59f9ee99..2a8d99f48080aa0e 100644 +--- a/EXAMPLE/sp_ienv.c ++++ b/EXAMPLE/sp_ienv.c +@@ -23,7 +23,7 @@ at the top-level directory. + * File name: sp_ienv.c + * History: Modified from lapack routine ILAENV + */ +-#include "slu_Cnames.h" ++#include "slu_sdefs.h" + + /*! \brief + +diff --git a/EXAMPLE/superlu.c b/EXAMPLE/superlu.c +index fd42a6ad5ded236a..b32d7e697c76c8e4 100644 +--- a/EXAMPLE/superlu.c ++++ b/EXAMPLE/superlu.c +@@ -20,7 +20,7 @@ at the top-level directory. + */ + #include "slu_ddefs.h" + +-main(int argc, char *argv[]) ++int main(int argc, char *argv[]) + { + /* + * Purpose +diff --git a/EXAMPLE/zfgmr.c b/EXAMPLE/zfgmr.c +index 223a4f48ebe6f488..7d094dfbc0864d2c 100644 +--- a/EXAMPLE/zfgmr.c ++++ b/EXAMPLE/zfgmr.c +@@ -33,6 +33,8 @@ For information on ITSOL contact saad@cs.umn.edu + + #define epsmac 1.0e-16 + ++extern int zcopy_(int *, doublecomplex *, int *, doublecomplex *, int *); ++extern void zaxpy_(int *, doublecomplex *, doublecomplex *, int *, doublecomplex *, int *); + extern void zdotc_(doublecomplex *, int *, doublecomplex [], int *, doublecomplex [], int *); + extern double dznrm2_(int *, doublecomplex [], int *); + +diff --git a/EXAMPLE/zlinsolx.c b/EXAMPLE/zlinsolx.c +index 0540461dc043e2bc..bb2f3851aa57584d 100644 +--- a/EXAMPLE/zlinsolx.c ++++ b/EXAMPLE/zlinsolx.c +@@ -18,6 +18,8 @@ at the top-level directory. + */ + #include "slu_zdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + char equed[1]; +diff --git a/EXAMPLE/zlinsolx1.c b/EXAMPLE/zlinsolx1.c +index badbf94cc33ca410..780e87cf594b9b1f 100644 +--- a/EXAMPLE/zlinsolx1.c ++++ b/EXAMPLE/zlinsolx1.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_zdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/zlinsolx2.c b/EXAMPLE/zlinsolx2.c +index 902c3535c3a905f5..579922433a7d2464 100644 +--- a/EXAMPLE/zlinsolx2.c ++++ b/EXAMPLE/zlinsolx2.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_zdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* +diff --git a/EXAMPLE/zlinsolx3.c b/EXAMPLE/zlinsolx3.c +index 5080c03a34d6c7ae..a1763ed45ccbb028 100644 +--- a/EXAMPLE/zlinsolx3.c ++++ b/EXAMPLE/zlinsolx3.c +@@ -20,6 +20,8 @@ at the top-level directory. + */ + #include "slu_zdefs.h" + ++#include ++ + int main(int argc, char *argv[]) + { + /* diff --git a/SuperLU.spec b/SuperLU.spec index a52fb0a..8413236 100644 --- a/SuperLU.spec +++ b/SuperLU.spec @@ -3,7 +3,7 @@ Name: SuperLU Version: 5.3.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Subroutines to solve sparse linear systems License: BSD and GPLv2+ URL: https://portal.nersc.gov/project/sparse/superlu/ @@ -19,6 +19,7 @@ Patch1: %{name}-set_soname.patch # Fix ldflags of example files Patch2: %{name}-fix_example_builds.patch +Patch3: SuperLU-c99.patch %if 0%{?fedora} >= 33 BuildRequires: pkgconfig(flexiblas) @@ -145,6 +146,9 @@ popd %doc DOC %changelog +* Tue Feb 21 2023 Florian Weimer - 5.3.0-5 +- Port to C99 + * Wed Jan 18 2023 Fedora Release Engineering - 5.3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild