fix multiple defination

Signed-off-by: shdluan <shdluan@163.com>
This commit is contained in:
shdluan 2021-08-04 16:50:41 +08:00
parent ffb629271c
commit a8033e42a5
2 changed files with 168 additions and 1 deletions

View File

@ -0,0 +1,160 @@
diff -urN a/src/arkode/fcmix/farknulllinsol.c b/src/arkode/fcmix/farknulllinsol.c
--- a/src/arkode/fcmix/farknulllinsol.c 2021-08-04 15:14:58.092488860 +0800
+++ b/src/arkode/fcmix/farknulllinsol.c 2021-08-04 15:06:12.679957136 +0800
@@ -26,8 +26,8 @@
/* Define global matrix variables */
-SUNLinearSolver F2C_ARKODE_linsol;
-SUNLinearSolver F2C_ARKODE_mass_sol;
+extern SUNLinearSolver F2C_ARKODE_linsol;
+extern SUNLinearSolver F2C_ARKODE_mass_sol;
/*=============================================================*/
diff -urN a/src/arkode/fcmix/farknullmatrix.c b/src/arkode/fcmix/farknullmatrix.c
--- a/src/arkode/fcmix/farknullmatrix.c 2021-08-04 15:15:14.396629485 +0800
+++ b/src/arkode/fcmix/farknullmatrix.c 2021-08-04 15:06:12.679957136 +0800
@@ -26,8 +26,8 @@
/* Define global matrix variables */
-SUNMatrix F2C_ARKODE_matrix;
-SUNMatrix F2C_ARKODE_mass_matrix;
+extern SUNMatrix F2C_ARKODE_matrix;
+extern SUNMatrix F2C_ARKODE_mass_matrix;
/*=============================================================*/
diff -urN a/src/sunlinsol/dense/fsunlinsol_dense.c b/src/sunlinsol/dense/fsunlinsol_dense.c
--- a/src/sunlinsol/dense/fsunlinsol_dense.c 2021-08-04 15:11:55.930917705 +0800
+++ b/src/sunlinsol/dense/fsunlinsol_dense.c 2021-08-04 15:13:55.679950547 +0800
@@ -25,11 +25,11 @@
/* Define global linsol variables */
-SUNLinearSolver F2C_CVODE_linsol;
-SUNLinearSolver F2C_IDA_linsol;
-SUNLinearSolver F2C_KINSOL_linsol;
-SUNLinearSolver F2C_ARKODE_linsol;
-SUNLinearSolver F2C_ARKODE_mass_sol;
+extern SUNLinearSolver F2C_CVODE_linsol;
+extern SUNLinearSolver F2C_IDA_linsol;
+extern SUNLinearSolver F2C_KINSOL_linsol;
+extern SUNLinearSolver F2C_ARKODE_linsol;
+extern SUNLinearSolver F2C_ARKODE_mass_sol;
/* Declarations of external global variables */
diff -urN a/src/sunlinsol/spgmr/fsunlinsol_spgmr.c b/src/sunlinsol/spgmr/fsunlinsol_spgmr.c
--- a/src/sunlinsol/spgmr/fsunlinsol_spgmr.c 2021-08-04 15:15:49.436931712 +0800
+++ b/src/sunlinsol/spgmr/fsunlinsol_spgmr.c 2021-08-04 15:06:12.679957136 +0800
@@ -25,11 +25,11 @@
/* Define global linsol variables */
-SUNLinearSolver F2C_CVODE_linsol;
-SUNLinearSolver F2C_IDA_linsol;
-SUNLinearSolver F2C_KINSOL_linsol;
-SUNLinearSolver F2C_ARKODE_linsol;
-SUNLinearSolver F2C_ARKODE_mass_sol;
+extern SUNLinearSolver F2C_CVODE_linsol;
+extern SUNLinearSolver F2C_IDA_linsol;
+extern SUNLinearSolver F2C_KINSOL_linsol;
+extern SUNLinearSolver F2C_ARKODE_linsol;
+extern SUNLinearSolver F2C_ARKODE_mass_sol;
/* Declarations of external global variables */
diff -urN a/src/sunmatrix/dense/fsunmatrix_dense.c b/src/sunmatrix/dense/fsunmatrix_dense.c
--- a/src/sunmatrix/dense/fsunmatrix_dense.c 2021-08-04 15:11:55.930917705 +0800
+++ b/src/sunmatrix/dense/fsunmatrix_dense.c 2021-08-04 15:13:10.683562450 +0800
@@ -25,11 +25,11 @@
/* Define global matrix variables */
-SUNMatrix F2C_CVODE_matrix;
-SUNMatrix F2C_IDA_matrix;
-SUNMatrix F2C_KINSOL_matrix;
-SUNMatrix F2C_ARKODE_matrix;
-SUNMatrix F2C_ARKODE_mass_matrix;
+extern SUNMatrix F2C_CVODE_matrix;
+extern SUNMatrix F2C_IDA_matrix;
+extern SUNMatrix F2C_KINSOL_matrix;
+extern SUNMatrix F2C_ARKODE_matrix;
+extern SUNMatrix F2C_ARKODE_mass_matrix;
/* Fortran callable interfaces */
diff -urN a/src/cvode/fcmix/fcvnulllinsol.c b/src/cvode/fcmix/fcvnulllinsol.c
--- a/src/cvode/fcmix/fcvnulllinsol.c 2021-08-04 16:13:56.423007237 +0800
+++ b/src/cvode/fcmix/fcvnulllinsol.c 2021-08-04 16:16:46.760476411 +0800
@@ -26,7 +26,7 @@
/* Define global linear solver variable */
-SUNLinearSolver F2C_CVODE_linsol;
+extern SUNLinearSolver F2C_CVODE_linsol;
/*=============================================================*/
diff -urN a/src/cvode/fcmix/fcvnullmatrix.c b/src/cvode/fcmix/fcvnullmatrix.c
--- a/src/cvode/fcmix/fcvnullmatrix.c 2021-08-04 16:13:56.423007237 +0800
+++ b/src/cvode/fcmix/fcvnullmatrix.c 2021-08-04 16:17:07.408654503 +0800
@@ -26,7 +26,7 @@
/* Define global matrix variable */
-SUNMatrix F2C_CVODE_matrix;
+extern SUNMatrix F2C_CVODE_matrix;
/*=============================================================*/
diff -urN a/src/cvode/fcmix/fcvnullnonlinsol.c b/src/cvode/fcmix/fcvnullnonlinsol.c
--- a/src/cvode/fcmix/fcvnullnonlinsol.c 2021-08-04 16:13:56.423007237 +0800
+++ b/src/cvode/fcmix/fcvnullnonlinsol.c 2021-08-04 16:17:31.512862405 +0800
@@ -26,7 +26,7 @@
/* Define global linear solver variable */
-SUNNonlinearSolver F2C_CVODE_nonlinsol;
+extern SUNNonlinearSolver F2C_CVODE_nonlinsol;
/*=============================================================*/
diff -urN a/src/sunmatrix/sparse/fsunmatrix_sparse.c b/src/sunmatrix/sparse/fsunmatrix_sparse.c
--- a/src/sunmatrix/sparse/fsunmatrix_sparse.c 2021-08-04 16:27:46.222164321 +0800
+++ b/src/sunmatrix/sparse/fsunmatrix_sparse.c 2021-08-04 16:28:54.458752870 +0800
@@ -26,7 +26,7 @@
/* Define global matrix variables */
SUNMatrix F2C_CVODE_matrix;
-SUNMatrix F2C_IDA_matrix;
+extern SUNMatrix F2C_IDA_matrix;
SUNMatrix F2C_KINSOL_matrix;
SUNMatrix F2C_ARKODE_matrix;
SUNMatrix F2C_ARKODE_mass_matrix;
diff -urN a/src/kinsol/fcmix/fkinnullmatrix.c b/src/kinsol/fcmix/fkinnullmatrix.c
--- a/src/kinsol/fcmix/fkinnullmatrix.c 2021-08-04 16:33:54.485340623 +0800
+++ b/src/kinsol/fcmix/fkinnullmatrix.c 2021-08-04 16:34:24.573600132 +0800
@@ -26,7 +26,7 @@
/* Define global matrix variable */
-SUNMatrix F2C_KINSOL_matrix;
+extern SUNMatrix F2C_KINSOL_matrix;
/*=============================================================*/
diff -urN a/src/kinsol/fcmix/fkinnulllinsol.c b/src/kinsol/fcmix/fkinnulllinsol.c
--- a/src/kinsol/fcmix/fkinnulllinsol.c 2021-08-04 16:40:38.028821213 +0800
+++ b/src/kinsol/fcmix/fkinnulllinsol.c 2021-08-04 16:41:02.225029907 +0800
@@ -26,7 +26,7 @@
/* Define global linear solver variable */
-SUNLinearSolver F2C_KINSOL_linsol;
+extern SUNLinearSolver F2C_KINSOL_linsol;
/*=============================================================*/

View File

@ -27,7 +27,7 @@
Summary: Suite of nonlinear solvers
Name: sundials
Version: 5.3.0
Release: 1
Release: 2
License: BSD
URL: https://github.com/LLNL/%{name}
Source0: https://github.com/LLNL/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
@ -38,6 +38,8 @@ Patch1: %{name}-3.1.1-set_superlumt64_name.patch
Patch2: %{name}-change_petsc_variable.patch
Patch3: %{name}-fix-multiple-defination.patch
BuildRequires: gcc-gfortran
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: %{?dts}gcc, %{?dts}gcc-c++
@ -94,6 +96,8 @@ pushd %{name}-%{version}
%patch0 -p0 -b .set_superlumt_name
%endif
%patch3 -p1
##Set serial library's paths
sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/nvector|g' src/nvector/serial/CMakeLists.txt
sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/nvector|g' src/nvector/openmp/CMakeLists.txt
@ -336,5 +340,8 @@ popd
%doc sundials-%{version}/doc/arkode/*
%changelog
* Wed Aug 4 2021 shdluan <shdluan@163.com> - 5.3.0-2
- fix multiple defination
* Wed May 12 2021 caodongxia <caodongxia@huawei.com> - 5.3.0-1
- Package init