zn_poly: C library for polynomial arithmetic in Z/nZ[x]¶
zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any modulus that fits into an unsigned long.
Note: Original website is at https://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/ but is no longer maintained. Sage maintains an “official” continuation of the project at the above link.
GPL V2 or V3. Some of the code has been copied from other projects - see the file src/COPYING for details.
(some) Python (to create the Makefile)
NTL apparently only if we configured zn_poly differently (same for FLINT)
Special Update/Build Instructions¶
Make sure the patches still apply.
Especially changes in
makemakefile.pymay also require changes to
spkg-install(and perhaps also
There’s also a
configure; no idea what it does, and we currently don’t use it either.
make installinstead of manually “installing” (copying and symlinking) the [shared] libraries and header files. This requires further tweaking of
makemakefile.py, since it currently only installs a static library and the headers.
If everything’s fine, i.e., no problems arise, some comments and especially some code I currently just commented out can certainly be removed. (-leif, 04/2012)
The version number “0.9.p11” is used as a doctest in the function package_versions in sage/misc/packages.py, so if this package gets upgraded, that doctest needs to be changed.
All patches from Sage have been merged into upstream. These include:
Improves the Python script creating the Makeefile for better use at least within Sage; see patch for details. (Last modified at #12433, which added and changed a lot.)
Fix potential redefinition of
ulong(in combination with other headers).
mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch:
Fix “jump into scope of identifier with variably modified type” errors. (See #8771).
Fix a potential problem when the value of ZNP_mpn_smp_kara_thresh is SIZE_MAX, this is usually irrealistic but can happen at least on linux on power7 with gcc-4.7.1 (see #14098).
As the name says; fix provided by upstream (David Harvey); see #13947.
Equivalent System Packages¶
$ sudo pacman -S zn-poly libzn-poly
$ conda install zn-poly libzn-poly
$ sudo apt-get install zn-poly libzn-poly
$ sudo yum install zn-poly libzn-poly
$ sudo pkg install zn-poly libzn-poly
$ nix-env --install zn-poly libzn-poly
$ sudo zypper install zn-poly libzn-poly
If the system package is installed, ./configure will check whether it can be used.