Skip to content

Commit 227b91e

Browse files
author
Release Manager
committed
gh-36930: `build/pkgs/normaliz`: Add patch for FLINT 3 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [ ] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> - Depends on #36901 <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36930 Reported by: Matthias Köppe Reviewer(s): Travis Scrimshaw
2 parents 06fa900 + 6115c96 commit 227b91e

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.1
1+
3.10.1.p0
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
--- a/source/libnormaliz/vector_operations.h
2+
+++ b/source/libnormaliz/vector_operations.h
3+
@@ -547,7 +547,10 @@
4+
5+
fmpq_poly_fit_length(flp, n);
6+
for (size_t i = 0; i < poly_vector.size(); ++i) {
7+
- fmpq_poly_set_coeff_mpq(flp, (slong)i, poly_vector[i].get_mpq_t());
8+
+ fmpq_t fcurrent_coeff;
9+
+ fmpq_init(fcurrent_coeff);
10+
+ fmpq_set_mpq(fcurrent_coeff, poly_vector[i].get_mpq_t());
11+
+ fmpq_poly_set_coeff_fmpq(flp, (slong)i, fcurrent_coeff);
12+
}
13+
}
14+
15+
@@ -560,8 +563,11 @@
16+
poly_vector.resize(length);
17+
for (slong i = 0; i < length; i++) {
18+
mpq_t current_coeff;
19+
+ fmpq_t fcurrent_coeff;
20+
mpq_init(current_coeff);
21+
- fmpq_poly_get_coeff_mpq(current_coeff, flp, (slong)i);
22+
+ fmpq_init(fcurrent_coeff);
23+
+ fmpq_poly_get_coeff_fmpq(fcurrent_coeff, flp, (slong)i);
24+
+ fmpq_get_mpq(current_coeff, fcurrent_coeff);
25+
poly_vector[i] = mpq_class(current_coeff);
26+
}
27+
}
28+
--- a/source/libnormaliz/HilbertSeries.cpp
29+
+++ b/source/libnormaliz/HilbertSeries.cpp
30+
@@ -72,7 +72,10 @@
31+
slong n = (slong)nmzp.size();
32+
fmpz_poly_fit_length(flp, n);
33+
for (size_t i = 0; i < nmzp.size(); ++i) {
34+
- fmpz_poly_set_coeff_mpz(flp, (slong)i, nmzp[i].get_mpz_t());
35+
+ fmpz_t fc;
36+
+ fmpz_init(fc);
37+
+ fmpz_set_mpz(fc, nmzp[i].get_mpz_t());
38+
+ fmpz_poly_set_coeff_fmpz(flp, (slong)i, fc);
39+
}
40+
}
41+
42+
@@ -80,9 +83,12 @@
43+
size_t n = (size_t)fmpz_poly_length(flp);
44+
nmzp.resize(n);
45+
mpz_t c;
46+
+ fmpz_t fc;
47+
mpz_init(c);
48+
+ fmpz_init(fc);
49+
for (size_t i = 0; i < nmzp.size(); ++i) {
50+
- fmpz_poly_get_coeff_mpz(c, flp, i);
51+
+ fmpz_poly_get_coeff_fmpz(fc, flp, i);
52+
+ fmpz_get_mpz(c, fc);
53+
nmzp[i] = mpz_class(c);
54+
}
55+
mpz_clear(c);

build/pkgs/normaliz/spkg-install.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ cd src
88
# that an error will be signalled if FLINT or E-ANTIC cannot be found, rather
99
# than building normaliz without it.
1010

11+
export ac_cv_lib_flint_fmpz_poly_set_coeff_mpz=yes
12+
1113
sdh_configure --with-flint --with-e-antic --with-nauty
1214
sdh_make
1315
sdh_make_install
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.18
1+
2.18.p0

0 commit comments

Comments
 (0)