Skip to content

Commit

Permalink
sagemathgh-39291: Workaround to allow flint to be compiled with numpy 2
Browse files Browse the repository at this point in the history
As discussed in sagemath#39241 .

Based on mkoeppe@6247975f786c85c35124a66a
0d32df00260461c5 , but also change the template file.

Note that for tests to pass, sagemath#39242
is also needed.

URL: sagemath#39291
Reported by: user202729
Reviewer(s): Tobias Diez
  • Loading branch information
Release Manager committed Jan 7, 2025
2 parents 82687f8 + e88cac0 commit 9ea3d64
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tarball=configure-VERSION.tar.gz
sha1=852d0d200a6a73aa5ddb9e00874cbe4a61c211e9
sha256=c4b089d90850dfdf15b905f66e4f6a0d961b96eb0663d8603beaff1a9efb2cbe
sha1=3c99d49a9d117032e8e93bda955a952d9b903f14
sha256=a9ecd4a138ebb241a3028558c04f5fdc9c22e21df5cd0514a29290c7847db8d4
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a2ba1f943f88775218c385efe55509c4548d1b44
0fd247e338266c36e4cff6653f3f1eb4ff021dbd
5 changes: 5 additions & 0 deletions src/sage/libs/flint/flint_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#pragma push_macro("ulong")
#undef ulong

/* Reserved in C99, needed for FLINT without https://github.com/flintlib/flint/pull/2027 */
#pragma push_macro("I")
#define I Iv

#include <flint/flint.h>

/* If flint was already previously included via another header (e.g.
Expand Down Expand Up @@ -169,6 +173,7 @@
#undef mp_bitcnt_t

#pragma pop_macro("ulong")
#pragma pop_macro("I")

/* CPU_SIZE_1 and SIZE_RED_FAILURE_THRESH are defined as macros in flint/fmpz_lll.h
* and as variables in fplll/defs.h, which breaks build if linbox is compiled with fplll */
Expand Down
5 changes: 5 additions & 0 deletions src/sage_setup/autogen/flint/templates/flint_wrap.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#pragma push_macro("ulong")
#undef ulong

/* Reserved in C99, needed for FLINT without https://github.com/flintlib/flint/pull/2027 */
#pragma push_macro("I")
#define I Iv

#include <flint/flint.h>

/* If flint was already previously included via another header (e.g.
Expand All @@ -43,6 +47,7 @@
#undef mp_bitcnt_t

#pragma pop_macro("ulong")
#pragma pop_macro("I")

/* CPU_SIZE_1 and SIZE_RED_FAILURE_THRESH are defined as macros in flint/fmpz_lll.h
* and as variables in fplll/defs.h, which breaks build if linbox is compiled with fplll */
Expand Down

0 comments on commit 9ea3d64

Please sign in to comment.