Skip to content

Commit 67eed46

Browse files
committed
diffs
1 parent 6921b27 commit 67eed46

File tree

2 files changed

+155
-2
lines changed

2 files changed

+155
-2
lines changed

patches/eigen-3.4.0.diff

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
diff '--exclude=CMakeLists.txt' -ruw eigen-3.4.0/Eigen/CholmodSupport inst/include/Eigen/CholmodSupport
2+
--- eigen-3.4.0/Eigen/CholmodSupport 2021-08-19 04:41:58.000000000 +0800
3+
+++ inst/include/Eigen/CholmodSupport 2021-10-26 12:58:06.061753725 +0800
4+
@@ -13,7 +13,7 @@
5+
#include "src/Core/util/DisableStupidWarnings.h"
6+
7+
extern "C" {
8+
- #include <cholmod.h>
9+
+ #include <RcppEigenCholmod.h>
10+
}
11+
12+
/** \ingroup Support_modules
13+
diff '--exclude=CMakeLists.txt' -ruw eigen-3.4.0/Eigen/src/CholmodSupport/CholmodSupport.h inst/include/Eigen/src/CholmodSupport/CholmodSupport.h
14+
--- eigen-3.4.0/Eigen/src/CholmodSupport/CholmodSupport.h 2021-08-19 04:41:58.000000000 +0800
15+
+++ inst/include/Eigen/src/CholmodSupport/CholmodSupport.h 2021-10-26 14:01:03.556869005 +0800
16+
@@ -167,12 +167,10 @@
17+
// template specializations for int and long that call the correct cholmod method
18+
19+
#define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \
20+
- template<typename _StorageIndex> inline ret cm_ ## name (cholmod_common &Common) { return cholmod_ ## name (&Common); } \
21+
- template<> inline ret cm_ ## name<SuiteSparse_long> (cholmod_common &Common) { return cholmod_l_ ## name (&Common); }
22+
+ template<typename _StorageIndex> inline ret cm_ ## name (cholmod_common &Common) { return cholmod_ ## name (&Common); }
23+
24+
#define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \
25+
- template<typename _StorageIndex> inline ret cm_ ## name (t1& a1, cholmod_common &Common) { return cholmod_ ## name (&a1, &Common); } \
26+
- template<> inline ret cm_ ## name<SuiteSparse_long> (t1& a1, cholmod_common &Common) { return cholmod_l_ ## name (&a1, &Common); }
27+
+ template<typename _StorageIndex> inline ret cm_ ## name (t1& a1, cholmod_common &Common) { return cholmod_ ## name (&a1, &Common); }
28+
29+
EIGEN_CHOLMOD_SPECIALIZE0(int, start)
30+
EIGEN_CHOLMOD_SPECIALIZE0(int, finish)
31+
@@ -184,15 +182,15 @@
32+
EIGEN_CHOLMOD_SPECIALIZE1(cholmod_factor*, analyze, cholmod_sparse, A)
33+
34+
template<typename _StorageIndex> inline cholmod_dense* cm_solve (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common &Common) { return cholmod_solve (sys, &L, &B, &Common); }
35+
-template<> inline cholmod_dense* cm_solve<SuiteSparse_long> (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common &Common) { return cholmod_l_solve (sys, &L, &B, &Common); }
36+
+// template<> inline cholmod_dense* cm_solve<SuiteSparse_long> (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common &Common) { return cholmod_l_solve (sys, &L, &B, &Common); }
37+
38+
template<typename _StorageIndex> inline cholmod_sparse* cm_spsolve (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_spsolve (sys, &L, &B, &Common); }
39+
-template<> inline cholmod_sparse* cm_spsolve<SuiteSparse_long> (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_l_spsolve (sys, &L, &B, &Common); }
40+
+// template<> inline cholmod_sparse* cm_spsolve<SuiteSparse_long> (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_l_spsolve (sys, &L, &B, &Common); }
41+
42+
template<typename _StorageIndex>
43+
inline int cm_factorize_p (cholmod_sparse* A, double beta[2], _StorageIndex* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_factorize_p (A, beta, fset, fsize, L, &Common); }
44+
-template<>
45+
-inline int cm_factorize_p<SuiteSparse_long> (cholmod_sparse* A, double beta[2], SuiteSparse_long* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_l_factorize_p (A, beta, fset, fsize, L, &Common); }
46+
+// template<>
47+
+// inline int cm_factorize_p<SuiteSparse_long> (cholmod_sparse* A, double beta[2], SuiteSparse_long* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_l_factorize_p (A, beta, fset, fsize, L, &Common); }
48+
49+
#undef EIGEN_CHOLMOD_SPECIALIZE0
50+
#undef EIGEN_CHOLMOD_SPECIALIZE1
51+
diff '--exclude=CMakeLists.txt' -ruw eigen-3.4.0/Eigen/src/Core/util/DisableStupidWarnings.h inst/include/Eigen/src/Core/util/DisableStupidWarnings.h
52+
--- eigen-3.4.0/Eigen/src/Core/util/DisableStupidWarnings.h 2021-08-19 04:41:58.000000000 +0800
53+
+++ inst/include/Eigen/src/Core/util/DisableStupidWarnings.h 2021-10-26 14:09:07.167883764 +0800
54+
@@ -37,40 +37,40 @@
55+
#elif defined __clang__
56+
// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
57+
// this is really a stupid warning as it warns on compile-time expressions involving enums
58+
- #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
59+
- #pragma clang diagnostic push
60+
- #endif
61+
- #pragma clang diagnostic ignored "-Wconstant-logical-operand"
62+
- #if __clang_major__ >= 3 && __clang_minor__ >= 5
63+
- #pragma clang diagnostic ignored "-Wabsolute-value"
64+
- #endif
65+
- #if __clang_major__ >= 10
66+
- #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
67+
- #endif
68+
- #if ( defined(__ALTIVEC__) || defined(__VSX__) ) && __cplusplus < 201103L
69+
- // warning: generic selections are a C11-specific feature
70+
- // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
71+
- #pragma clang diagnostic ignored "-Wc11-extensions"
72+
- #endif
73+
+ // #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
74+
+ // #pragma clang diagnostic push
75+
+ // #endif
76+
+ // #pragma clang diagnostic ignored "-Wconstant-logical-operand"
77+
+ // #if __clang_major__ >= 3 && __clang_minor__ >= 5
78+
+ // #pragma clang diagnostic ignored "-Wabsolute-value"
79+
+ // #endif
80+
+ // #if __clang_major__ >= 10
81+
+ // #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
82+
+ // #endif
83+
+ // #if ( defined(__ALTIVEC__) || defined(__VSX__) ) && __cplusplus < 201103L
84+
+ // // warning: generic selections are a C11-specific feature
85+
+ // // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
86+
+ // #pragma clang diagnostic ignored "-Wc11-extensions"
87+
+ // #endif
88+
89+
#elif defined __GNUC__
90+
91+
- #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
92+
- #pragma GCC diagnostic push
93+
- #endif
94+
- // g++ warns about local variables shadowing member functions, which is too strict
95+
- #pragma GCC diagnostic ignored "-Wshadow"
96+
- #if __GNUC__ == 4 && __GNUC_MINOR__ < 8
97+
- // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
98+
- #pragma GCC diagnostic ignored "-Wtype-limits"
99+
- #endif
100+
- #if __GNUC__>=6
101+
- #pragma GCC diagnostic ignored "-Wignored-attributes"
102+
- #endif
103+
- #if __GNUC__==7
104+
- // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
105+
- #pragma GCC diagnostic ignored "-Wattributes"
106+
- #endif
107+
+ // #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
108+
+ // #pragma GCC diagnostic push
109+
+ // #endif
110+
+ // // g++ warns about local variables shadowing member functions, which is too strict
111+
+ // #pragma GCC diagnostic ignored "-Wshadow"
112+
+ // #if __GNUC__ == 4 && __GNUC_MINOR__ < 8
113+
+ // // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
114+
+ // #pragma GCC diagnostic ignored "-Wtype-limits"
115+
+ // #endif
116+
+ // #if __GNUC__>=6
117+
+ // #pragma GCC diagnostic ignored "-Wignored-attributes"
118+
+ // #endif
119+
+ // #if __GNUC__==7
120+
+ // // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
121+
+ // #pragma GCC diagnostic ignored "-Wattributes"
122+
+ // #endif
123+
#endif
124+
125+
#if defined __NVCC__
126+
diff '--exclude=CMakeLists.txt' -ruw eigen-3.4.0/Eigen/src/Core/util/ReenableStupidWarnings.h inst/include/Eigen/src/Core/util/ReenableStupidWarnings.h
127+
--- eigen-3.4.0/Eigen/src/Core/util/ReenableStupidWarnings.h 2021-08-19 04:41:58.000000000 +0800
128+
+++ inst/include/Eigen/src/Core/util/ReenableStupidWarnings.h 2021-10-26 14:20:01.194903723 +0800
129+
@@ -11,9 +11,9 @@
130+
#elif defined __INTEL_COMPILER
131+
#pragma warning pop
132+
#elif defined __clang__
133+
- #pragma clang diagnostic pop
134+
+ // #pragma clang diagnostic pop
135+
#elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
136+
- #pragma GCC diagnostic pop
137+
+ // #pragma GCC diagnostic pop
138+
#endif
139+
140+
#if defined __NVCC__
141+
diff '--exclude=CMakeLists.txt' -ruw eigen-3.4.0/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h
142+
--- eigen-3.4.0/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h 2021-08-19 04:41:58.000000000 +0800
143+
+++ inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h 2021-10-26 13:07:49.922771543 +0800
144+
@@ -193,7 +193,9 @@
145+
std::string curfile;
146+
curfile = m_folder + "/" + m_curs_id->d_name;
147+
// Discard if it is a folder
148+
+#if !(defined(__sun) || defined(_AIX) || defined(__hpux) || defined(__sgi) || defined(__HAIKU__))
149+
if (m_curs_id->d_type == DT_DIR) continue; //FIXME This may not be available on non BSD systems
150+
+#endif
151+
// struct stat st_buf;
152+
// stat (curfile.c_str(), &st_buf);
153+
// if (S_ISDIR(st_buf.st_mode)) continue;

patches/howToDiff.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
### Hint
33

44
```sh
5-
diff --exclude=CMakeLists.txt -ruw eigen-3.3.9/Eigen/ inst/include/Eigen/ > patches/eigen-3.3.9.diff
6-
diff --exclude=CMakeLists.txt -ruw eigen-3.3.9/unsupported/Eigen/ inst/include/unsupported/Eigen/ >> patches/eigen-3.3.9.diff
5+
diff --exclude=CMakeLists.txt -ruw eigen-3.4.0/Eigen/ inst/include/Eigen/ > patches/eigen-3.4.0.diff
6+
diff --exclude=CMakeLists.txt -ruw eigen-3.4.0/unsupported/Eigen/ inst/include/unsupported/Eigen/ >> patches/eigen-3.4.0.diff
77
```

0 commit comments

Comments
 (0)