-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsymengine_patch.diff
More file actions
140 lines (131 loc) · 5.6 KB
/
symengine_patch.diff
File metadata and controls
140 lines (131 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
diff --git src/upstream/CMakeLists.txt src/upstream/CMakeLists.txt
index 467a589..f15af08 100644
--- src/upstream/CMakeLists.txt
+++ src/upstream/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18...4.2.0)
+cmake_minimum_required(VERSION 3.5..4.0)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UserOverride.cmake)
@@ -504,10 +504,6 @@ if (WITH_OPENMP)
set(WITH_SYMENGINE_THREAD_SAFE yes)
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang|GNU)
- set(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} -Wno-unknown-pragmas")
- set(CMAKE_CXX_FLAGS_RELEASE
- "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unknown-pragmas")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
diff --git src/upstream/cmake/SymEngineConfig.cmake.in src/upstream/cmake/SymEngineConfig.cmake.in
index 43d9c62..7a480b1 100644
--- src/upstream/cmake/SymEngineConfig.cmake.in
+++ src/upstream/cmake/SymEngineConfig.cmake.in
@@ -33,7 +33,7 @@
# We are compatible with 3.18, but also updated to support policies
# in 4.0.0
-cmake_minimum_required(VERSION 3.18...4.0.0)
+cmake_minimum_required(VERSION 3.5..4.0)
include(CMakeFindDependencyMacro)
diff --git src/upstream/cmake/UserOverride.cmake src/upstream/cmake/UserOverride.cmake
index 523ce49..3e27a3f 100644
--- src/upstream/cmake/UserOverride.cmake
+++ src/upstream/cmake/UserOverride.cmake
@@ -8,7 +8,7 @@
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# g++
- set(common "-Wall -Wextra -Wno-unused-parameter -fno-common")
+ set(common "-Wall -Wextra -fno-common")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
@@ -18,7 +18,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -O0")
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
# clang
- set(common "-Wall -Wextra -Wno-unused-parameter")
+ set(common "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
diff --git src/upstream/symengine/lambda_double.h src/upstream/symengine/lambda_double.h
index bf6f00d..633605a 100644
--- src/upstream/symengine/lambda_double.h
+++ src/upstream/symengine/lambda_double.h
@@ -562,7 +562,6 @@ public:
}
void bvisit(const NaN &nan)
{
- assert(&nan == &(*Nan) /* singleton, or do we support NaN quiet/singaling nan with payload? */);
result_ = [](const double * /* x */) {
return std::numeric_limits<double>::signaling_NaN();
};
diff --git src/upstream/symengine/mp_class.h src/upstream/symengine/mp_class.h
index 2cd9f4e..12d103e 100644
--- src/upstream/symengine/mp_class.h
+++ src/upstream/symengine/mp_class.h
@@ -1222,6 +1222,9 @@ inline int mp_cmpabs(const integer_class &a, const integer_class &b)
return mpz_cmpabs(get_mpz_t(a), get_mpz_t(b));
}
+// from Rmath.h
+extern "C" double unif_rand(void);
+
class mp_randstate
{
public:
@@ -1241,7 +1244,8 @@ public:
mp_randstate()
{
gmp_randinit_default(_state);
- gmp_randseed_ui(_state, std::rand());
+ unsigned long int randres = (int)(unif_rand() * (RAND_MAX - 1.0));
+ gmp_randseed_ui(_state, randres);
}
~mp_randstate()
diff --git src/upstream/symengine/parser/parser.tab.cc src/upstream/symengine/parser/parser.tab.cc
index b5ce819..5e8179b 100644
--- src/upstream/symengine/parser/parser.tab.cc
+++ src/upstream/symengine/parser/parser.tab.cc
@@ -1054,7 +1054,6 @@ namespace yy {
case 32: // pwise: PIECEWISE '(' piecewise_list ')'
#line 259 "parser.yy"
{
- assert(yystack_[3].value.as < std::string > () == "Piecewise");
yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = piecewise(std::move(yystack_[1].value.as < SymEngine::PiecewiseVec > ()));
}
#line 1061 "parser.tab.cc"
diff --git src/upstream/symengine/parser/parser.yy src/upstream/symengine/parser/parser.yy
index 0657e7a..f20d870 100644
--- src/upstream/symengine/parser/parser.yy
+++ src/upstream/symengine/parser/parser.yy
@@ -256,7 +256,6 @@ piecewise_list:
pwise:
PIECEWISE '(' piecewise_list ')'
{
- assert($1 == "Piecewise");
$$ = piecewise(std::move($3));
}
;
diff --git src/upstream/symengine/utilities/fast_float/include/fast_float/fast_float.h src/upstream/symengine/utilities/fast_float/include/fast_float/fast_float.h
index e85220a..65c9446 100644
--- src/upstream/symengine/utilities/fast_float/include/fast_float/fast_float.h
+++ src/upstream/symengine/utilities/fast_float/include/fast_float/fast_float.h
@@ -397,7 +397,6 @@ int leading_zeroes_generic(uint64_t input_num, int last_bit = 0) {
/* result might be undefined when input_num is zero */
fastfloat_really_inline FASTFLOAT_CONSTEXPR20
int leading_zeroes(uint64_t input_num) {
- assert(input_num > 0);
if (cpp20_and_in_constexpr()) {
return leading_zeroes_generic(input_num);
}
diff --git src/upstream/symengine/utilities/matchpycpp/substitution.h src/upstream/symengine/utilities/matchpycpp/substitution.h
index 056e52a..b6e1760 100644
--- src/upstream/symengine/utilities/matchpycpp/substitution.h
+++ src/upstream/symengine/utilities/matchpycpp/substitution.h
@@ -50,7 +50,6 @@ substitution_union(const SubstitutionMultiset &subst,
for (const SubstitutionMultiset &other : others) {
for (const pair<const string, multiset_basic> &p : other) {
int ret = try_add_variable(new_subst, p.first, p.second);
- assert(ret == 0);
}
}
return new_subst;