-
Notifications
You must be signed in to change notification settings - Fork 8
/
README
324 lines (239 loc) · 12.3 KB
/
README
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
LiDIA --- A library for computational number theory
LiDIA was developed from 1994 to 2004 at TU Darmstadt. It is not under active development.
The authoritative repository for LiDIA used to reside at
http://www.informatik.tu-darmstadt.de/TI/LiDIA/ftp/LiDIA/
The present version, named 2.3.0+latte-patches-YYYY-MM-DD,
is based on the last official release, 2.3.0, of the LiDIA library.
It has minimal patches for using LiDIA within the LattE integrale project
with newer compilers and other infrastructure.
It is maintained at https://github.com/mkoeppe/LiDIA
LiDIA's build system has a mechanism to create two types of distribution archives:
the whole archive (LiDIA-2.3.0) or just packages (LiDIA-base-2.3.0,
LiDIA-FF-2.3.0, LiDIA-LA-2.3.0, LiDIA-LT-2.3.0, LiDIA-NF-2.3.0,
LiDIA-EC-2.3.0, LiDIA-ECO-2.3.0, and LiDIA-GEC-2.3.0). All packages
are provided in tar.gz format. Everything unpacks into the directory
./LiDIA-2.3.0.
Package dependencies: base
* The FF (Finite Fields) package depends only on the base package. |
* The LA (Linear Algebra) package depends on the FF package. FF
* The LT (Lattice) package depends on the LA package. |
* The NF (Number Field) package depends on the LT package. LA
* The EC (Elliptic Curve) package depends on the LA package. / \
* The ECO (Elliptic Curve Order) package depends on the EC package. LT EC
* The GEC (Generate Elliptic Curves) package depends on both the NF | |
and the ECO package. NF ECO
\ /
GEC
CHANGES
See the file NEWS for a list of major changes in the current release.
C++ COMPILER REQUIREMENTS
In order to compile LiDIA, your C++ compiler MUST support some ISO C++
features. These are:
- type bool
- inlining
- mutable class members
- explicit constructors
- C++ style casts (i.e. static_cast<...> and const_cast<...>)
- explicit template instantiation by ISO C++
- template specialization by ISO C++ (template <>)
- ISO C++ headers, such as <iostream>, <fstream>, <string>, but also
<cstdlib>, <cstdio>, etc.
Moreover, LiDIA makes use of some basic classes from the C++ standard
library, such as fstream, string.
If your compiler fails to support one of the above items, you should
upgrade. Sorry for the inconvenience, but that's what a standard is for.
However, LiDIA still doesn't make use of exceptions and run-time type
information if you don't want it to.
As of release 2.1pre6, only g++ has been tested. The g++ versions 3.x and 4.x
compile LiDIA successfully, whereas g++ 2.95.3 and 2.96 are
known to fail when compiling LiDIA. Note that this is not LiDIA's fault...
DISK SPACE AND MAIN MEMORY REQUIREMENTS
LiDIA is a quite large system which requires a remarkable amount of
resources. The full LiDIA distribution occupies about 70MByte when
unpacked. Configuring and building all packages typically takes about 135MByte
disk space on an i386-linux-gnu platform with ELF object file format, plus
about 25MByte for temporaries. Installing all packages can take additional
90MByte. These amounts depend very much on the platform and on the configuration
options. You can easily consume more than 1.8GByte if you configure LiDIA with
configure --disable-shared CXXFLAGS='-O0 -g2'
and run
make check
On the other hand, you can reduce the disk space requirements significantly by
using appropriate configuration options if you do not need all the features
of the full LiDIA distribution and if you build only those test programs you
are interested in.
With older versions of g++, 64MByte of RAM used to be sufficient for building
LiDIA. Since recent g++ version have a much more heavy memory footprint, we
recommend you have at least 512MByte free RAM. This recommendation also
applies to building LiDIA applications, particularly when
instantiating some of LiDIA's template classes.
INSTALLATION (Unix-like systems, using configure)
If you used `git clone` to obtain the source code of LiDIA,
you will first have to generate the build scripts using:
./bootstrap
Then proceed using `./configure' to configure LiDIA, see the file INSTALL for
compilation and generic installation instructions.
LiDIA-specific configure options:
--enable-inline
If set to `yes', the multi-precision arithmetic routines from the
underlying kernel are inlined, otherwise separate function calls are
generated. The default is `yes'.
--enable-exceptions
If set to `yes', then LiDIA is built with support for
exceptions and errors are reported by exceptions.
If set to `no', then LiDIA is built without support for
exceptions. (g++ compiler switch `-fno-exceptions'.)
Consult the description of class LiDIA::BasicError in the
LiDIA manual for details.
The default is `yes'.
--enable-namespaces
If set to `yes', then all of LiDIA's symbols will be defined in the
name space LiDIA (your C++ compiler must support name spaces). The
default is `yes'.
--enable-assert
If set to `yes', the assert macros will be activated by not defining
`NDEBUG'. The default is `no'.
--enable-ff
If set to `yes', the finite-fields package will be built. The
default is `yes'.
--enable-la
If set to `yes', the linear-algebra package will be built. Since
this package depends on the finite-fields package, the
linear-algebra package will be built only if the finite-fields
package is built. The default is `yes'.
--enable-lt
If set to `yes', the lattice package will be built. Since this
package depends on the linear-algebra package, the lattice package
will be built only if the linear-algebra package is built. The
default is `yes'.
--enable-nf
If set to `yes', the number-fields package will be built. Since
this package depends on the lattice package, the number-fields
package will be built only if the lattice package is built. The
default is `yes'.
--enable-ec
If set to `yes', the elliptic-curves package will be built. Since
this package depends on the lattice package, the elliptic-curves
package will be built only if the lattice package is built. The
default is `yes'.
--enable-eco
If set to `yes', the elliptic-curve-order package will be built.
Since this package depends on the elliptic-curves package, the
elliptic-curve-order package will be built only if the
elliptic-curves package is built. The default is `yes'.
--enable-gec
If set to `yes', the elliptic curve generation package will be
built. Since this package depends on the elliptic curve order
package, the elliptic curve generation package will be built only
if the elliptic curve order package is built. The default is
`yes'.
--with-arithmetic
Determines the multi-precision kernel for LiDIA. Valid values are
`gmp', `cln', `piologie', and `libI'.
YOUR SYSTEM MUST PROVIDE THE LIBRARY OF YOUR CHOICE BEFORE
CONFIGURING LiDIA!
Note for Piologie users on Unix-like systems: For some reason the
Piologie library is created as `piologie.a' instead of
`libpiologie.a'. Rename `piologie.a' to `libpiologie.a', or create
a link, otherwise the configure script will not find the Piologie
library.
--with-extra-includes
If the headers of the multi-precision library reside in a directory
that is not searched by your C++ compiler, then add the path with
this option.
--with-extra-libs
If the multi-precision library resides in a directory that is not
searched by your linker, then add the path with this option.
LiDIA's build procedure uses GNU Libtool, which adds the following
options to "configure":
--enable-shared
--enable-static
These options determine whether shared and/or static library
versions will be built. Only the latter option defaults to `yes'.
--with-pic
--without-pic
Normally, shared libraries use position-independent code, and
static libraries use direct jump instructions which need to be
edited by the linker. The --with-pic option enforces
position-independent code even for static libraries, whereas
--without-pic does not demand position-independent code even when
building shared libraries. Using one of these options can halven
compilation time and reduce disk space usage because they save
the source files from being compiled twice. Note that only
position-independent code can be shared in main memory among
applications; using position-dependent code for dynamically linked
libraries just defers the linking step to program load time and
then requires private memory for the relocated library code.
--enable-fast-install
LiDIA comes with some example applications, which you may want to
run in the build tree without having installed the shared library.
To make this work, Libtool creates wrapper scripts for the actual
binaries. With --enable-fast-install=yes, the (hidden) binaries
are prepared for installation and must be run from the (visible)
wrapper scripts until the shared library is installed. With
--enable-fast-install=no, the binaries are linked with the
uninstalled library, thus necessitating a relinking step when
installing them. As long as you do not run the hidden binaries
directly and use the provided make targets for installing, you need
not care about these details. However, note that installing the
example applications without having installed the shared library in
the configured libdir will work only with the setting
--enable-fast-install=yes, which is the default. This can be
important when preparing binary installation images.
COMPILER FLAGS
You can provide any desired compiler flag by setting the variable CXXFLAGS
in the environment or in the command line passed to `configure'. For
example, type
./configure CXXFLAGS="<your desired flags>"
The configure script presets CFLAGS and CXXFLAGS with -O2, if these are
empty or unset.
If you have problems to build LiDIA due to memory exhaustion, it will
probably help to limit inlining (some packages contain quite large inlined
functions). If you are using GCC, the appropriate option to limit inlining
is -finline-limit-N (GCC-2.x) resp. -finline-limit=N (GCC-3.x), where N
should be chosen to be between 300 and 1000 (GCC's default is 10000). This
will also result in faster compilation times and smaller object files for
some source files.
Likewise, the GNU g++ compiler flags -Wreturn-type might drastically
increase memory consumption (see the GCC FAQ, e.g. http://gcc.gnu.org/faq/).
Note that -Wall implies -Wreturn-type.
EXTENDED FEATURES
LiDIA's Makefile suite provides all targets proposed in the GNU Makefile
standards, including `install-exec', `install-data', and `uninstall'.
Furthermore, VPATH builds and staged installs (using DESTDIR) are supported.
BUILDING AND INSTALLING THE EXAMPLES
To build the examples, type
make examples
and to install the examples type
make install-examples
BUILDING THE DOCUMENTATION
To run the documentation through LaTeX2e and produce the DVI file
doc/LiDIA.dvi, type
make dvi
Note: As of release 2.1pre6, this also requires the "texi2dvi" script,
which comes with the GNU texinfo tools, to be available on your system.
You can additionally convert the DVI file into Postscript, yielding
doc/LiDIA.ps, by running
make ps
and generate compressed versions doc/LiDIA.ps.{gz,bz2} using
make psgz
make psbz2
If you have pdflatex, you can as well build doc/LiDIA.pdf. Just type
make pdf
or
make dsc
The latter produces doc/LiDIA.dsc in addition to doc/LiDIA.pdf. The dsc
file is a Postscript wrapper providing access to LiDIA.pdf for PS tools
like psselect, Ghostview, and others. Making the dsc file requires the
"pdf2dsc" utility which comes with Ghostscript 6.x. Note that the
combination of pdf+dsc is as compact as a compressed PS file. However, you
will probably not be able to print doc/LiDIA.dsc because that file uses
pointers into LiDIA.pdf which will be dangling when copied into a spool
directory. For printing, better make doc/LiDIA.ps.
BUILDING THE MANUAL
You can build the manual with "make doc" once the package is configured. Note
that you need a (PDF-)LaTeX installation for this to work.
If you do not have the EC and EM Type 1 fonts installed, then edit
doc/LiDIA.tex and uncomment the line that instructs LaTeX to use the package
ae. Using package "ae" will produce better-looking postscript output for
on-screen viewing.