I'm working on some p-adic modular symbols code, and am writing a file that uses zn_poly. Unfortunately, when I try to compile, I get the following error from gcc:
$SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of typedef 'pari_ulong' $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration of 'pari_ulong' was here
The relevant lines in those header files are: zn_poly.h: typedef unsigned long ulong;
parigen.h: typedef unsigned long pari_ulong; #define ulong pari_ulong
I don't even need pari in this file, but it's getting included somehow. Any ideas for how to fix the conflict, or at least how to figure out where parigen.h is getting included? The cython file I'm working on is accessible at
> I'm working on some p-adic modular symbols code, and am writing a file that > uses zn_poly. Unfortunately, when I try to compile, I get the following > error from gcc:
> $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of > typedef 'pari_ulong' > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration of > 'pari_ulong' was here
> The relevant lines in those header files are: > zn_poly.h: > typedef unsigned long ulong;
> I don't even need pari in this file, but it's getting included somehow. > Any ideas for how to fix the conflict, or at least how to figure out where > parigen.h is getting included? The cython file I'm working on is > accessible at
They are essentially the same type. In sage-on-gentoo we actually did a small patch to zn_poly because ulong is defined in both flint and zn_poly and it gave rise to problems. Essentially it boils to this: -typedef unsigned long ulong; +#ifndef ulong +#define ulong unsigned long +#endif
That should solve your issue but of course it is a hack if we don't patch zn_poly as shipped by sage.
Does anyone know if this change has been incorporated into FLINT 2? It's not worth spending a lot of time on it if it will be fixed once we upgrade to FLINT 2. David
francois.bis...@canterbury.ac.nz> wrote: > On Tue, 17 Apr 2012 16:56:52 David Roe wrote: > > I'm working on some p-adic modular symbols code, and am writing a file > that > > uses zn_poly. Unfortunately, when I try to compile, I get the following > > error from gcc:
> > $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of > > typedef 'pari_ulong' > > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration > of > > 'pari_ulong' was here
> > The relevant lines in those header files are: > > zn_poly.h: > > typedef unsigned long ulong;
> > I don't even need pari in this file, but it's getting included somehow. > > Any ideas for how to fix the conflict, or at least how to figure out > where > > parigen.h is getting included? The cython file I'm working on is > > accessible at
> They are essentially the same type. In sage-on-gentoo we actually did a > small > patch to zn_poly because ulong is defined in both flint and zn_poly and it > gave > rise to problems. Essentially it boils to this: > -typedef unsigned long ulong; > +#ifndef ulong > +#define ulong unsigned long > +#endif
> That should solve your issue but of course it is a hack if we don't patch > zn_poly as shipped by sage.
> Francois
> -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org
> Does anyone know if this change has been incorporated into FLINT 2? It's
> not worth spending a lot of time on it if it will be fixed once we upgrade
> to FLINT 2.
> David
> On Tue, Apr 17, 2012 at 17:25, François Bissey <
> francois.bis...@canterbury.ac.nz> wrote:
> > On Tue, 17 Apr 2012 16:56:52 David Roe wrote:
> > > I'm working on some p-adic modular symbols code, and am writing a file
> > that
> > > uses zn_poly. Unfortunately, when I try to compile, I get the following
> > > error from gcc:
> > > $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of
> > > typedef 'pari_ulong'
> > > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration
> > of
> > > 'pari_ulong' was here
> > > The relevant lines in those header files are:
> > > zn_poly.h:
> > > typedef unsigned long ulong;
> > > I don't even need pari in this file, but it's getting included somehow.
> > > Any ideas for how to fix the conflict, or at least how to figure out
> > where
> > > parigen.h is getting included? The cython file I'm working on is
> > > accessible at
> > They are essentially the same type. In sage-on-gentoo we actually did a
> > small
> > patch to zn_poly because ulong is defined in both flint and zn_poly and it
> > gave
> > rise to problems. Essentially it boils to this:
> > -typedef unsigned long ulong;
> > +#ifndef ulong
> > +#define ulong unsigned long
> > +#endif
> > That should solve your issue but of course it is a hack if we don't patch
> > zn_poly as shipped by sage.
> > Francois
> > --
> > To post to this group, send an email to sage-devel@googlegroups.com
> > To unsubscribe from this group, send an email to
> > sage-devel+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/sage-devel > > URL:http://www.sagemath.org
> On Tue, Apr 17, 2012 at 17:25, François Bissey <francois.bis...@canterbury.ac.nz> wrote:
> > On Tue, 17 Apr 2012 16:56:52 David Roe wrote:
> > > I'm working on some p-adic modular symbols code, and am writing a file
> > that
> > > uses zn_poly. Unfortunately, when I try to compile, I get the following
> > > error from gcc:
> > > $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of
> > > typedef 'pari_ulong'
> > > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration
> > of
> > > 'pari_ulong' was here
> > > The relevant lines in those header files are:
> > > zn_poly.h:
> > > typedef unsigned long ulong;
> > > I don't even need pari in this file, but it's getting included somehow.
> > > Any ideas for how to fix the conflict, or at least how to figure out
> > where
> > > parigen.h is getting included? The cython file I'm working on is
> > > accessible at
> > They are essentially the same type. In sage-on-gentoo we actually did a
> > small
> > patch to zn_poly because ulong is defined in both flint and zn_poly and it
> > gave
> > rise to problems. Essentially it boils to this:
> > -typedef unsigned long ulong;
> > +#ifndef ulong
> > +#define ulong unsigned long
> > +#endif
> > That should solve your issue but of course it is a hack if we don't patch
> > zn_poly as shipped by sage.
> We may be incorporating some code from zn_poly in flint 2.3 in the
> future, but will not need to have a dependence on zn_poly proper.
> Bill.
> On Apr 17, 10:30 pm, David Roe <roed.m...@gmail.com> wrote:
> > Does anyone know if this change has been incorporated into FLINT 2? It's
> > not worth spending a lot of time on it if it will be fixed once we upgrade
> > to FLINT 2.
> > David
> > On Tue, Apr 17, 2012 at 17:25, François Bissey <
> > francois.bis...@canterbury.ac.nz> wrote:
> > > On Tue, 17 Apr 2012 16:56:52 David Roe wrote:
> > > > I'm working on some p-adic modular symbols code, and am writing a file
> > > that
> > > > uses zn_poly. Unfortunately, when I try to compile, I get the following
> > > > error from gcc:
> > > > $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of
> > > > typedef 'pari_ulong'
> > > > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous declaration
> > > of
> > > > 'pari_ulong' was here
> > > > The relevant lines in those header files are:
> > > > zn_poly.h:
> > > > typedef unsigned long ulong;
> > > > I don't even need pari in this file, but it's getting included somehow.
> > > > Any ideas for how to fix the conflict, or at least how to figure out
> > > where
> > > > parigen.h is getting included? The cython file I'm working on is
> > > > accessible at
> > > They are essentially the same type. In sage-on-gentoo we actually did a
> > > small
> > > patch to zn_poly because ulong is defined in both flint and zn_poly and it
> > > gave
> > > rise to problems. Essentially it boils to this:
> > > -typedef unsigned long ulong;
> > > +#ifndef ulong
> > > +#define ulong unsigned long
> > > +#endif
> > > That should solve your issue but of course it is a hack if we don't patch
> > > zn_poly as shipped by sage.
On Thu, Apr 19, 2012 at 13:27, leif <not.rea...@online.de> wrote: > On 17 Apr., 23:30, David Roe <roed.m...@gmail.com> wrote: > > Patching zn_poly in Sage sounds good to me....
> I could include such a patch into the zn_poly spkg at
> > On Tue, Apr 17, 2012 at 17:25, François Bissey < > francois.bis...@canterbury.ac.nz> wrote: > > > On Tue, 17 Apr 2012 16:56:52 David Roe wrote: > > > > I'm working on some p-adic modular symbols code, and am writing a > file > > > that > > > > uses zn_poly. Unfortunately, when I try to compile, I get the > following > > > > error from gcc:
> > > > $SAGE_ROOT/local/include/zn_poly/zn_poly.h:72: error: redefinition of > > > > typedef 'pari_ulong' > > > > $SAGE_ROOT/local/include/pari/parigen.h:19: error: previous > declaration > > > of > > > > 'pari_ulong' was here
> > > > The relevant lines in those header files are: > > > > zn_poly.h: > > > > typedef unsigned long ulong;
> > > > I don't even need pari in this file, but it's getting included > somehow. > > > > Any ideas for how to fix the conflict, or at least how to figure out > > > where > > > > parigen.h is getting included? The cython file I'm working on is > > > > accessible at
> > > They are essentially the same type. In sage-on-gentoo we actually did a > > > small > > > patch to zn_poly because ulong is defined in both flint and zn_poly > and it > > > gave > > > rise to problems. Essentially it boils to this: > > > -typedef unsigned long ulong; > > > +#ifndef ulong > > > +#define ulong unsigned long > > > +#endif
> > > That should solve your issue but of course it is a hack if we don't > patch > > > zn_poly as shipped by sage.
> > > Francois
> -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org
On 17 Apr., 23:25, François Bissey <francois.bis...@canterbury.ac.nz>
wrote:
> They are essentially the same type. In sage-on-gentoo we actually did a small
> patch to zn_poly because ulong is defined in both flint and zn_poly and it gave
> rise to problems. Essentially it boils to this:
> -typedef unsigned long ulong;
> +#ifndef ulong
> +#define ulong unsigned long
> +#endif
I changed the typedef in zn_poly.h to
#undef ulong
#define ulong unsigned long
and then also had to fix the order of includes in profiler/profiler.c
since otherwise the build breaks on Solaris; see attached (p8) diff at