1 |
commit: 28d840bc2275b9d2614291ba41d6b1ff93e0ddfe |
2 |
Author: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 31 15:38:51 2018 +0000 |
4 |
Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 31 15:38:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=28d840bc |
7 |
|
8 |
sci-libs/trilinos: fix compilation with superlu 5 |
9 |
|
10 |
Package-Manager: Portage-2.3.48, Repoman-2.3.10 |
11 |
|
12 |
.../files/trilinos-12.12.1-superlu-5.patch | 161 +++++++++++++++++++++ |
13 |
sci-libs/trilinos/trilinos-12.12.1-r1.ebuild | 1 + |
14 |
2 files changed, 162 insertions(+) |
15 |
|
16 |
diff --git a/sci-libs/trilinos/files/trilinos-12.12.1-superlu-5.patch b/sci-libs/trilinos/files/trilinos-12.12.1-superlu-5.patch |
17 |
new file mode 100644 |
18 |
index 000000000..24e8dbabd |
19 |
--- /dev/null |
20 |
+++ b/sci-libs/trilinos/files/trilinos-12.12.1-superlu-5.patch |
21 |
@@ -0,0 +1,161 @@ |
22 |
+From 83bec239ac6a63ed895a52567eab18925dd6a8cb Mon Sep 17 00:00:00 2001 |
23 |
+From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= <nico.schloemer@×××××.com> |
24 |
+Date: Wed, 1 Jun 2016 19:38:01 +0200 |
25 |
+Subject: [PATCH] compatibility with SuperLU 5 |
26 |
+ |
27 |
+Thanks to Eric Bavier <bavier@××××.com>. |
28 |
+--- |
29 |
+ cmake/TPLs/FindTPLSuperLU.cmake | 42 +++++++++++++++++++++++- |
30 |
+ packages/amesos/cmake/Amesos_config.h.in | 3 ++ |
31 |
+ packages/amesos/src/Amesos_Superlu.cpp | 15 ++++++--- |
32 |
+ packages/ifpack/cmake/Ifpack_config.h.in | 3 ++ |
33 |
+ packages/ifpack/src/Ifpack_SILU.cpp | 6 +++- |
34 |
+ packages/ifpack/src/Ifpack_SILU.h | 2 ++ |
35 |
+ 6 files changed, 65 insertions(+), 6 deletions(-) |
36 |
+ |
37 |
+diff --git a/cmake/TPLs/FindTPLSuperLU.cmake b/cmake/TPLs/FindTPLSuperLU.cmake |
38 |
+index fae2db230b0..f2321ba93dc 100644 |
39 |
+--- a/cmake/TPLs/FindTPLSuperLU.cmake |
40 |
++++ b/cmake/TPLs/FindTPLSuperLU.cmake |
41 |
+@@ -56,5 +56,45 @@ |
42 |
+ |
43 |
+ TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( SuperLU |
44 |
+ REQUIRED_HEADERS supermatrix.h slu_ddefs.h |
45 |
+- REQUIRED_LIBS_NAMES "superlu superlu_3.0 superlu_4.0 superlu_4.1 superlu_4.2 superlu_4.3" |
46 |
++ REQUIRED_LIBS_NAMES "superlu superlu_3.0 superlu_4.0 superlu_4.1 superlu_4.2 superlu_4.3 superlu_5.0" |
47 |
+ ) |
48 |
++ |
49 |
++include(CheckCSourceCompiles) |
50 |
++include(MultilineSet) |
51 |
++ |
52 |
++# API change in SuperLU 5.0 requires a 'GlobalLU_t' parameter for |
53 |
++# *gssvx, *gsisx, *gstrf, and *gsitrf routines. Check whether these |
54 |
++# parameters are needed. |
55 |
++ |
56 |
++FUNCTION(CHECK_SUPERLU_GLOBALLU_T_ARG VARNAME) |
57 |
++ SET(SOURCE |
58 |
++ " |
59 |
++#include <slu_ddefs.h> |
60 |
++ |
61 |
++int main() |
62 |
++{ |
63 |
++ GlobalLU_t lu; |
64 |
++ superlu_options_t opt; |
65 |
++ SuperMatrix M; |
66 |
++ int *i; |
67 |
++ double *d; |
68 |
++ void *v; |
69 |
++ char *c; |
70 |
++ SuperLUStat_t stat; |
71 |
++ mem_usage_t mem; |
72 |
++ |
73 |
++ dgsisx(&opt,&M,i,i,i,c,d,d,&M,&M,v,*i,&M,&M,d,d,&lu,&mem,&stat,i); |
74 |
++ return 0; |
75 |
++} |
76 |
++" |
77 |
++ ) |
78 |
++ |
79 |
++ SET(CMAKE_REQUIRED_INCLUDES ${TPL_SuperLU_INCLUDE_DIRS}) |
80 |
++ SET(CMAKE_REQUIRED_LIBRARIES ${TPL_SuperLU_LIBRARIES} ${TPL_METIS_LIBRARIES} ${TPL_BLAS_LIBRARIES}) |
81 |
++ SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) |
82 |
++ CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) |
83 |
++ENDFUNCTION() |
84 |
++ |
85 |
++IF (TPL_ENABLE_SuperLU) |
86 |
++ CHECK_SUPERLU_GLOBALLU_T_ARG(HAVE_SUPERLU_GLOBALLU_T_ARG) |
87 |
++ENDIF(TPL_ENABLE_SuperLU) |
88 |
+diff --git a/packages/amesos/cmake/Amesos_config.h.in b/packages/amesos/cmake/Amesos_config.h.in |
89 |
+index bc4967e3433..6150ed80d2f 100644 |
90 |
+--- a/packages/amesos/cmake/Amesos_config.h.in |
91 |
++++ b/packages/amesos/cmake/Amesos_config.h.in |
92 |
+@@ -93,3 +93,6 @@ |
93 |
+ |
94 |
+ /* Define to 1 if SuperLU_DIST's LUstructInit is declared with 2 arguments. */ |
95 |
+ #cmakedefine HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG |
96 |
++ |
97 |
++/* Define to 1 if SuperLU's *gssvx and *gsisx routines need a GlobalLU_t argument. */ |
98 |
++#cmakedefine HAVE_SUPERLU_GLOBALLU_T_ARG |
99 |
+diff --git a/packages/amesos/src/Amesos_Superlu.cpp b/packages/amesos/src/Amesos_Superlu.cpp |
100 |
+index 3651b65f4da..7adf0dff62d 100644 |
101 |
+--- a/packages/amesos/src/Amesos_Superlu.cpp |
102 |
++++ b/packages/amesos/src/Amesos_Superlu.cpp |
103 |
+@@ -55,6 +55,7 @@ class SLUData { |
104 |
+ #endif |
105 |
+ SLU::superlu_options_t SLU_options; |
106 |
+ SLU::mem_usage_t mem_usage; |
107 |
++ SLU::GlobalLU_t lu; // Use for gssvx and gsisx in SuperLU 5.0 |
108 |
+ SLU::fact_t refactor_option ; // SamePattern or SamePattern_SameRowPerm |
109 |
+ |
110 |
+ SLUData() { |
111 |
+@@ -480,8 +481,11 @@ int Amesos_Superlu::NumericFactorization() |
112 |
+ &perm_c_[0], &perm_r_[0], &etree_[0], &equed_, &R_[0], |
113 |
+ &C_[0], &(data_->L), &(data_->U), NULL, 0, |
114 |
+ &(data_->B), &(data_->X), &rpg, &rcond, &ferr_[0], |
115 |
+- &berr_[0], &(data_->mem_usage), &SLU_stat, |
116 |
+- &Ierr[0] ); |
117 |
++ &berr_[0], |
118 |
++#ifdef HAVE_SUPERLU_GLOBALLU_T_ARG |
119 |
++ &(data_->lu), |
120 |
++#endif |
121 |
++ &(data_->mem_usage), &SLU_stat, &Ierr[0] ); |
122 |
+ SLU::StatFree( &SLU_stat ) ; |
123 |
+ } |
124 |
+ |
125 |
+@@ -611,8 +615,11 @@ int Amesos_Superlu::Solve() |
126 |
+ &perm_c_[0], &perm_r_[0], &etree_[0], &equed_, &R_[0], |
127 |
+ &C_[0], &(data_->L), &(data_->U), NULL, 0, |
128 |
+ &(data_->B), &(data_->X), &rpg, &rcond, &ferr_[0], |
129 |
+- &berr_[0], &(data_->mem_usage), &SLU_stat, |
130 |
+- &Ierr); |
131 |
++ &berr_[0], |
132 |
++#ifdef HAVE_SUPERLU_GLOBALLU_T_ARG |
133 |
++ &(data_->lu), |
134 |
++#endif |
135 |
++ &(data_->mem_usage), &SLU_stat, &Ierr); |
136 |
+ // assert( equed_ == 'N' ) ; |
137 |
+ StatFree( &SLU_stat ) ; |
138 |
+ } |
139 |
+diff --git a/packages/ifpack/cmake/Ifpack_config.h.in b/packages/ifpack/cmake/Ifpack_config.h.in |
140 |
+index 81fba21a99f..91f11101f87 100644 |
141 |
+--- a/packages/ifpack/cmake/Ifpack_config.h.in |
142 |
++++ b/packages/ifpack/cmake/Ifpack_config.h.in |
143 |
+@@ -53,6 +53,9 @@ |
144 |
+ /* Define if Ifpack_DynamicFactory is enabled */ |
145 |
+ #cmakedefine HAVE_IFPACK_DYNAMIC_FACTORY |
146 |
+ |
147 |
++/* Define to 1 if SuperLU's dgsitrf routine needs a GlobalLU_t argument. */ |
148 |
++#cmakedefine HAVE_SUPERLU_GLOBALLU_T_ARG |
149 |
++ |
150 |
+ /* Add macros for declaring functions deprecated */ |
151 |
+ @IFPACK_DEPRECATED_DECLARATIONS@ |
152 |
+ |
153 |
+diff --git a/packages/ifpack/src/Ifpack_SILU.cpp b/packages/ifpack/src/Ifpack_SILU.cpp |
154 |
+index e69f32b1277..32b58e1a60b 100644 |
155 |
+--- a/packages/ifpack/src/Ifpack_SILU.cpp |
156 |
++++ b/packages/ifpack/src/Ifpack_SILU.cpp |
157 |
+@@ -297,7 +297,11 @@ int Ifpack_SILU::Compute() |
158 |
+ int panel_size = sp_ienv(1); |
159 |
+ int relax = sp_ienv(2); |
160 |
+ int info=0; |
161 |
+- dgsitrf(&options_,&SAc_,relax,panel_size,etree_,NULL,0,perm_c_,perm_r_,&SL_,&SU_,&stat_,&info); |
162 |
++ dgsitrf(&options_,&SAc_,relax,panel_size,etree_,NULL,0,perm_c_,perm_r_,&SL_,&SU_, |
163 |
++#ifdef HAVE_SUPERLU_GLOBALLU_T_ARG |
164 |
++ &lu_, |
165 |
++#endif |
166 |
++ &stat_,&info); |
167 |
+ if(info<0) IFPACK_CHK_ERR(info); |
168 |
+ |
169 |
+ IsComputed_ = true; |
170 |
+diff --git a/packages/ifpack/src/Ifpack_SILU.h b/packages/ifpack/src/Ifpack_SILU.h |
171 |
+index a1c7b1a86f0..0a7a7d8dc63 100644 |
172 |
+--- a/packages/ifpack/src/Ifpack_SILU.h |
173 |
++++ b/packages/ifpack/src/Ifpack_SILU.h |
174 |
+@@ -428,6 +428,8 @@ class Ifpack_SILU: public Ifpack_Preconditioner { |
175 |
+ mutable double ApplyInverseTime_; |
176 |
+ //! Used for timing issues |
177 |
+ mutable Epetra_Time Time_; |
178 |
++ //! SuperLU global LU data |
179 |
++ mutable GlobalLU_t lu_; |
180 |
+ //! SuperLU stats |
181 |
+ mutable SuperLUStat_t stat_; |
182 |
+ //! SuperLU options |
183 |
|
184 |
diff --git a/sci-libs/trilinos/trilinos-12.12.1-r1.ebuild b/sci-libs/trilinos/trilinos-12.12.1-r1.ebuild |
185 |
index b74f3c8c6..432977e10 100644 |
186 |
--- a/sci-libs/trilinos/trilinos-12.12.1-r1.ebuild |
187 |
+++ b/sci-libs/trilinos/trilinos-12.12.1-r1.ebuild |
188 |
@@ -64,6 +64,7 @@ PATCHES=( |
189 |
"${FILESDIR}"/${PN}-11.14.1-fix-install-paths.patch \ |
190 |
"${FILESDIR}"/${P}-fix_install_paths_for_destdir.patch |
191 |
"${FILESDIR}"/${P}-fix_sundance_compilation.patch |
192 |
+ "${FILESDIR}"/${P}-superlu-5.patch |
193 |
) |
194 |
|
195 |
trilinos_conf() { |