Opened 2 years ago
Last modified 2 years ago
#27714 closed defect
Sagelib build error on Cygwin using system GMP — at Version 8
Reported by: | embray | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | sage-duplicate/invalid/wontfix |
Component: | porting: Cygwin | Keywords: | cygwin sagelib gmp flint |
Cc: | jdemeyer | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Fixed upstream, but not in a stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Since #27212 I get an error building sagelib:
[sagelib-8.8.beta3] gcc -shared -Wl,--enable-auto-image-base -L/home/embray/src/sagemath/sage/local/lib -Wl,-rpath,/home/embray/src/sagemath/sage/local/lib -L/home/embray/src/sagemath/sage/local/lib -Wl,-rpath,/home/embray/src/sagemath/sage/local/lib build/temp.cygwin-2.9.0-x86_64-2.7/build/cythonized/sage/ext/fast_callable.o -L/home/embray/src/sagemath/sage/local/lib -L/home/embray/src/sagemath/sage/local/lib/python2.7/config -L/home/embray/src/sagemath/sage/local/lib -lpython2.7 -o build/lib.cygwin-2.9.0-x86_64-2.7/sage/ext/fast_callable.dll [sagelib-8.8.beta3] build/cythonized/sage/data_structures/bounded_integer_sequences.c:3442:29: error: conflicting types for ‘__pyx_f_4sage_15data_structures_25bounded_integer_sequences_limb_one_set_bit’ [sagelib-8.8.beta3] static CYTHON_INLINE mp_limb_t __pyx_f_4sage_15data_structures_25bounded_integer_sequences_limb_one_set_bit(mp_bitcnt_t __pyx_v_n) { [sagelib-8.8.beta3] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [sagelib-8.8.beta3] build/cythonized/sage/data_structures/bounded_integer_sequences.c:3170:29: note: previous declaration of ‘__pyx_f_4sage_15data_structures_25bounded_integer_sequences_limb_one_set_bit’ was here [sagelib-8.8.beta3] static CYTHON_INLINE mp_limb_t __pyx_f_4sage_15data_structures_25bounded_integer_sequences_limb_one_set_bit(mp_bitcnt_t); /*proto*/ [sagelib-8.8.beta3] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
followed by a long string of similar errors in the same module.
This is probably similar to the error fixed in #27713 but a different manifestation thereof.
This is partially fixed by the PR linked below, but then another related error arises related to flint and/or zn_poly abusing GMP type definitions:
[sagelib-8.8.beta3] g++ -shared -Wl,--enable-auto-image-base -L/home/embray/src/sagemath/sage/local/lib -Wl,-rpath,/home/embray/src/sagemath/sage/local/lib -L/home/embray/src/sagemath/sage/local/lib -Wl,-rpath,/home/embray/src/sagemath/sage/local/lib build/temp.cygwin-2.9.0-x86_64-2.7/build/cythonized/sage/rings/polynomial/polynomial_zz_pex.o -L/home/embray/src/sagemath/sage/local/lib -L/home/embray/src/sagemath/sage/local/lib/python2.7/config -L/home/embray/src/sagemath/sage/local/lib -lntl -lgmp -lstdc++ -lpython2.7 -o build/lib.cygwin-2.9.0-x86_64-2.7/sage/rings/polynomial/polynomial_zz_pex.dll -lpari [sagelib-8.8.beta3] [380/437] gcc -I/usr/include/ncurses -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I./sage/cpython -I./sage/libs/ntl -I/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/cysignals -I/home/embray/src/sagemath/sage/local/include -I/home/embray/src/sagemath/sage/src -I/home/embray/src/sagemath/sage/src/sage/ext -I/home/embray/src/sagemath/sage/local/include/python2.7 -I/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/numpy/core/include -Ibuild/cythonized -I/home/embray/src/sagemath/sage/local/include/python2.7 -c build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.cpp -o build/temp.cygwin-2.9.0-x86_64-2.7/build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=gnu++11 [sagelib-8.8.beta3] In file included from build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.cpp:697:0: [sagelib-8.8.beta3] ../local/include/zn_poly/zn_poly.h:72:23: error: conflicting declaration ‘typedef long unsigned int mp_limb_t’ [sagelib-8.8.beta3] typedef unsigned long ulong; [sagelib-8.8.beta3] ^~~~~~~ [sagelib-8.8.beta3] In file included from build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.cpp:676:0: [sagelib-8.8.beta3] /usr/include/gmp.h:138:32: note: previous declaration as ‘typedef long long unsigned int mp_limb_t’ [sagelib-8.8.beta3] typedef unsigned long long int mp_limb_t; ...
and followed by some other errors that look related.
Upstream PR: https://github.com/wbhart/flint2/pull/557
Change History (8)
comment:1 Changed 2 years ago by
- Cc jdemeyer added
- Description modified (diff)
comment:2 Changed 2 years ago by
comment:3 Changed 2 years ago by
- Keywords flint added
I traced the problem to this line in flint.h
:
#define mp_bitcnt_t ulong
I have no idea why it would do this, but it's almost certainly wrong.
comment:4 Changed 2 years ago by
Added 10 years ago for no readily apparent reason in https://github.com/wbhart/flint2/commit/f988d3eaab92ad477fe73cb346060fc0b700c566
Later it was changed to #define mp_bitcnt_t ulong
in a mass rename. But flint's ulong
type is defined in terms of mp_limb_t
hence the breakage.
comment:5 Changed 2 years ago by
- Description modified (diff)
- Report Upstream changed from N/A to Reported upstream. No feedback yet.
comment:6 Changed 2 years ago by
- Description modified (diff)
comment:7 Changed 2 years ago by
- Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.
comment:8 Changed 2 years ago by
- Description modified (diff)
The previous PR to flint partially fixed the problem, but not fully. See updated description.
Hmm, changing these ctypedefs to what I actually have in my
gmp.h
does not seem to fix it. If my reading of the Cython docs is correct this actually should't matter anyways: It's still going to output literallymp_limb_t
to the C code and does not redefine it in any way.The "conflicting types" error first appears just after
so I wonder if one of these is somehow responsible.