1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
|
===============================================================================
zn_poly: a library for polynomial arithmetic (version 0.9)
Copyright (C) 2007, 2008, David Harvey
Copyright (C) 2018 David Harvey, E. M. Bray
See the file COPYING for copyright and licensing information.
===============================================================================
Installation instructions
-------------------------
(1) Unpack the tarball somewhere.
(2) From the tarball directory, run the configure script, i.e.
./configure <options>
This creates a makefile. Python must be available for this to work. The
configure script doesn't do anything intelligent (like examine your system);
it just writes the makefile based on the supplied options.
Available options are the following:
--cflags=<flags>
Flags passed to gcc. Default is "-O2". You might need "-O2 -m64".
--ldflags=<flags>
Flags passed to linker. You might need "-m64", especially on some macs.
--prefix=<path>
Where to put zn_poly header and library files. Default is "/usr/local".
The header file is stored at <path>/include. The library is stored at
<path>/lib.
--gmp-prefix=<path>
Location of GMP include/library files (assumed to be under
<path>/include and <path>/lib). Default is "/usr/local".
--ntl-prefix=<path>
Location of NTL include/library files (assumed to be under
<path>/include and <path>/lib). This is only necessary if
you want to build the profiling targets with NTL profiling support.
Default is "/usr/local".
--use-flint
Use the FLINT library instead of GMP for large integer multiplication.
--flint-prefix=<path>
Location of FLINT include/library files (assumed to be under
<path>/include and <path>/lib). Default is "/usr/local".
--(en/dis)able-tuning
Enable (the default) or disable automatic tuning.
(3) (optional) Run "make tune" and then "tune/tune > src/tuning.c". This
determines optimal tuning values on your platform and overwrites the
tuning.c source file with the new values.
This only works on platforms where cycle counter code is available
(currently x86, x86_64 and powerpc). If you don't run "make tune", you'll
just get some default tuning values that work well on my development
machine.
Note: Tuning is now always done by default as a prerequisite to other
make targets; to disable it run ./configure with --disable-tuning
(4) Run "make" to build the library.
(5) Run "make install". This copies the library and include files to
the requested destination directory.
(6) (optional) Step (5) only installs the static version of the library.
The makefile also has targets for shared libraries (you might need to add
-fPIC to --cflags):
* libzn_poly.dylib: for darwin
* libzn_poly.dylib64: darwin, 64 bit
* libzn_poly.so: linux
* libzn_poly-0.9.so: linux, with sonames
* cygzn_poly.dll: for cygwin
===============================================================================
Other makefile targets
----------------------
make demo/bernoulli/bernoulli
An example program for computing bernoulli numbers mod p.
make clean
Remove all temporary files.
make distclean
Remove all temporary files including the generated makefile.
make check
Runs some quick tests to make sure that everything appears to be working.
make test
Builds a test program. Running "test/test all" runs the whole zn_poly test
suite, which tests zn_poly much more thoroughly than "make check".
make profile/mul-profile
A program for profiling various polynomial multiplication algorithms over
various modulus sizes and polynomial lengths.
make profile/mul-profile-ntl
As above, but also includes support for profiling NTL's multiplication.
make profile/invert-profile
make profile/invert-profile-ntl
A program for profiling series inversion.
make profile/negamul-profile
A program for profiling various negacyclic multiplication algorithms.
make profile/mulmid-profile
A program for profiling various middle product algorithms.
make profile/array-profile
A program for profiling linear-time array functions, including butterfly
routines used in the FFT multiplication routines, GMP's mpn_add and mpn_sub,
and others.
===============================================================================
|