Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

Testing latest pari + WASM + node.js... and it works?! Wow.

Views: 1566
License: GPL3
Image: ubuntu2004
1
% Copyright (c) 2000 The PARI Group
2
%
3
% This file is part of the PARI/GP documentation
4
%
5
% Permission is granted to copy, distribute and/or modify this document
6
% under the terms of the GNU General Public License
7
\appendix{Installation Guide for the UNIX Versions}
8
9
\def\tocwrite#1{}
10
\section{Required tools}
11
12
Compiling PARI requires an \kbd{ANSI C} or a \kbd{C++} compiler. If you do
13
not have one, we suggest that you obtain the \kbd{gcc/g++} compiler. As for
14
all GNU software mentioned afterwards, you can find the most convenient site
15
to fetch \kbd{gcc} at the address
16
$$\url{http://www.gnu.org/order/ftp.html}$$
17
%
18
(On Mac OS X, this is also provided in the \kbd{Xcode} tool
19
suite; or the lightweight ``Command-line tools for \kbd{Xcode}''.) You can
20
certainly compile PARI with a different compiler, but the PARI kernel takes
21
advantage of optimizations provided by \kbd{gcc}. This results in at least
22
20\% speedup on most architectures.
23
24
\misctitle{Optional libraries and programs} The following programs and libraries are useful
25
in conjunction with \kbd{gp}, but not mandatory. In any case, get them before
26
proceeding if you want the functionalities they provide. All of them are free.
27
The download page on our website
28
$$
29
\url{http://pari.math.u-bordeaux.fr/download.html}
30
$$
31
contains pointers on how to get these.
32
33
\item GNU \kbd{MP} library. This provides an alternative multiprecision
34
kernel, which is faster than PARI's native one, but unfortunately binary
35
incompatible, so the resulting PARI library SONAME is libpari-gmp.
36
37
\item GNU \kbd{readline} library. This provides line editing under
38
\kbd{gp}, an automatic context-dependent completion, and an editable history
39
of commands.
40
41
\item GNU \kbd{emacs} and the \tet{PariEmacs} package. The \kbd{gp}
42
calculator can be run in an Emacs buffer, with all the obvious advantages if
43
you are familiar with this editor. Note that \kbd{readline} is still useful
44
in this case since it provides a better automatic completion than is provided
45
by Emacs's GP-mode.
46
47
\item GNU \kbd{gzip/gunzip/gzcat} package enables \kbd{gp} to read
48
compressed data.
49
50
\item \kbd{perl} provides extended online help (full text from the
51
manual) about functions and concepts. The script handling this online help
52
can be used under \kbd{gp} or independently.
53
54
\section{Compiling the library and the \kbd{gp} calculator}
55
56
\subsec{Basic configuration} Type
57
58
\kbd{./Configure}
59
60
\noindent in the toplevel directory. This attempts to configure PARI/GP
61
without outside help. Note that if you want to install the end product in
62
some nonstandard place, you can use the \kbd{--prefix} option, as in
63
64
\kbd{./Configure --prefix=}\var{/an/exotic/directory}
65
66
\noindent (the default prefix is \kbd{/usr/local}). For example, to build a
67
package for a Linux distribution, you may want to use
68
69
\kbd{./Configure --prefix=/usr}
70
71
This phase extracts some files and creates a \var{build directory}, names
72
\kbd{O}\var{osname}\kbd{-}\var{arch}, where the
73
object files and executables will be built. The
74
\var{osname} and \var{arch} components depends on your architecture and
75
operating system, thus you can build PARI/GP for several different machines
76
from the same source tree (the builds are independent and can be done
77
simultaneously).
78
79
Decide whether you agree with what \kbd{Configure} printed on your screen, in
80
particular the architecture, compiler and optimization flags. Look for
81
messages prepended by \kbd{\#\#\#}, which report genuine problems.
82
Look especially for the \kbd{gmp}, \kbd{readline} and \kbd{X11} libraries,
83
and the \kbd{perl} and \kbd{gunzip} (or \kbd{zcat}) binaries.
84
If anything should have been found and was not, consider that \kbd{Configure}
85
failed and follow the instructions in section~3.
86
87
The \kbd{Configure} run creates a file \kbd{config.log} in the build
88
directory, which contains debugging information --- in particular, all
89
messages from compilers --- that may help diagnose problems. This file
90
is erased and recreated from scratch each time \kbd{Configure} is run.
91
92
\subsec{Advanced configuration}
93
\kbd{Configure} accepts many other flags, and you may use any number of them
94
to build quite a complicated configuration command. See \kbd{Configure
95
--help} for a complete list. In particular, there are sets of flags related
96
to GNU MP (\kbd{--with-gmp*}) and GNU readline library
97
(\kbd{--with-readline*}).
98
99
Here, we focus on the nonobvious ones:
100
101
\kbd{--tune}: fine tunes the library for the host used for compilation. This
102
adjusts thresholds by running a large number of comparative tests and creates
103
a file \kbd{tune.h} in the build directory, that will be used from now on,
104
overriding the ones in \kbd{src/kernel/none/} and \kbd{src/kernel/gmp/}. It
105
will take a while: about 30 minutes. Expect a small
106
performance boost, perhaps a 10\% speed increase
107
compared to default settings.
108
109
If you are using GMP, tune it first, then PARI. Make sure you tune PARI on
110
the machine that will actually run your computations. Do not use a heavily
111
loaded machine for tunings.
112
113
You may speed up the compilation by using a parallel make:
114
\bprog
115
env MAKE="make -j4" Configure --tune
116
@eprog
117
118
\kbd{--graphic=}\var{lib}: enables a particular graphic library.
119
The default is \kbd{X11} on most platforms, but PARI can use
120
\kbd{Qt}, \kbd{fltk} or \kbd{win32} (GDI), or even dump a \kbd{ps}
121
or \kbd{svg} file and open it using an external viewer.
122
123
\kbd{--time=}\var{function}: chooses a timing function. The default usually
124
works fine, however you can use a different one that better fits your needs.
125
PARI can use \kbd{getrusage}, \kbd{clock\_gettime}, \kbd{times} or
126
\kbd{ftime} as timing functions. (Not all timing functions are available on
127
all platforms.) The three first functions give timings in terms of CPU usage
128
of the current task, approximating the complexity of the algorithm. The last
129
one, \kbd{ftime}, gives timings in terms of absolute (wall-clock) time.
130
Moreover, the \kbd{clock\_gettime} function is more precise, but much slower
131
(at the time of this writing), than \kbd{getrusage} or \kbd{times}.
132
133
\kbd{--with-runtime-perl=}\var{perl}: absolute path to the runtime \kbd{perl}
134
binary to be used by the \kbd{gphelp} and \kbd{tex2mail} scripts. Defaults
135
to the path found by \kbd{Configure} on the build host (usually
136
\kbd{/usr/bin/perl}). For cross-compiling builds, when the target and build
137
hosts have mismatched configurations; suggested values are
138
139
\kbd{/usr/bin/env perl}: the first \kbd{perl} executable found in user's
140
\kbd{PATH},
141
142
\kbd{/usr/bin/perl}: \kbd{perl}'s standard location.
143
144
The remaining options are specific to parallel programming. We provide an
145
\emph{Introduction to parallel GP programming} in the file
146
\kbd{doc/parallel.dvi}, and to multi-threaded \kbd{libpari} programs
147
in Appendix~D. Beware that these options change the library ABI:
148
149
\kbd{--mt=}\var{engine}: specify the engine used for parallel computations.
150
Supported value are
151
152
\item single: (default) no parallellism.
153
154
\item pthread: use POSIX threads. This is well-suited for multi-core systems.
155
Setting this option also set \kbd{--enable-tls}, see below. This option
156
requires the pthread library.
157
For benchmarking, it is often useful to set \kbd{--time=ftime} so that GP
158
report wall-clock instead of the sum of the time spent by each thread.
159
160
\item mpi: use the MPI interface to parallelism. This allows to take
161
advantage of clusters using MPI. This option requires a MPI library.
162
It is usually necessary to set the environment variable \kbd{CC} to
163
\kbd{mpicc}.
164
165
\kbd{--enable-tls}: build the thread-safe version of the library. Implied by
166
\kbd{--mt=pthread}. This tends to slow down the \emph{shared} library
167
\kbd{libpari.so} by about $25\%$, so you probably want to use the static
168
library \kbd{libpari.a} instead.
169
170
\subsec{Compilation} To compile the \kbd{gp} binary and build the
171
documentation, type
172
173
\kbd{make all}
174
175
\noindent To only compile the \kbd{gp} binary, type
176
177
\kbd{make gp}
178
179
\noindent in the toplevel directory. If your \kbd{make} program supports
180
parallel make, you can speed up the process by going to the build
181
directory that \kbd{Configure} created and doing a parallel make here, for
182
instance \kbd{make -j4} with GNU make. It should even work from the toplevel
183
directory.
184
185
\subsec{Basic tests}
186
187
To test the binary, type \kbd{make bench}. This runs a quick series of
188
tests, for a few seconds on modern machines.
189
190
In many cases, this will also build a different binary (named \kbd{gp-sta} or
191
\kbd{gp-dyn}) linked in a slightly different way and run the tests with both.
192
(In exotic configurations, one may pass all the tests while the other fails
193
and we want to check for this.) To test only the default binary, use
194
\kbd{make dobench} which starts the bench immediately.
195
196
If a \kbd{[BUG]} message shows up, something went wrong. The testing utility
197
directs you to files containing the differences between the test output and
198
the expected results. Have a look and decide for yourself if something is
199
amiss. If it looks like a bug in the Pari system, we would appreciate a
200
report, see the last section.
201
202
\subsec{Cross-compiling}
203
204
When cross-compiling, you can set the environment variable \kbd{RUNTEST} to a
205
program that is able to run the target binaries, e.g. an emulator. It will be
206
used for both the \kbd{Configure} tests and \kbd{make bench}.
207
208
\section{Troubleshooting and fine tuning}
209
In case the default \kbd{Configure} run fails miserably, try
210
211
\kbd{./Configure -a}
212
213
\noindent (interactive mode) and answer all the questions: there are about 30
214
of them, and default answers are provided. If you accept all default answers,
215
\kbd{Configure} will fail just the same, so be wary. In any case, we would
216
appreciate a bug report (see the last section).
217
218
\subsec{Installation directories} The precise default destinations are as
219
follows: the \kbd{gp} binary, the scripts \kbd{gphelp} and \kbd{tex2mail} go
220
to \kbd{\$prefix/bin}. The pari library goes to \kbd{\$prefix/lib} and
221
include files to \kbd{\$prefix/include/pari}. Other system-dependent data go
222
to \kbd{\$prefix/lib/pari}.
223
224
Architecture independent files go to various subdirectories of
225
\kbd{\$share\_prefix}, which defaults to \kbd{\$prefix/share}, and can be
226
specified via the \kbd{--share-prefix} argument. Man pages go into
227
\kbd{\$share\_prefix/man}, and other system-independent data
228
under \kbd{\$share\_prefix/pari}: documentation,
229
sample GP scripts and C code, extra packages like \kbd{elldata} or
230
\kbd{galdata}.
231
232
\noindent You can also set directly \kbd{--bindir} (executables),
233
\kbd{--libdir} (library), \kbd{--includedir} (include files), \kbd{--mandir}
234
(manual pages), \kbd{--datadir} (other architecture-independent data), and
235
finally \kbd{--sysdatadir} (other architecture-dependent data).
236
237
\subsec{Environment variables} \kbd{Configure} lets the following environment
238
variable override the defaults if set:
239
240
\kbd{CC}: C compiler.
241
242
\kbd{DLLD}: Dynamic library linker.
243
244
\kbd{LD}: Static linker.
245
246
\noindent For instance, \kbd{Configure} may avoid \kbd{/bin/cc} on some
247
architectures due to various problems which may have been fixed in your
248
version of the compiler. You can try
249
250
\kbd{env CC=cc Configure}
251
252
\noindent and compare the benches. Also, if you insist on using a \kbd{C++}
253
compiler and run into trouble with a fussy \kbd{g++}, try to use
254
\kbd{g++ -fpermissive}.
255
256
257
\noindent The contents of the following variables are \emph{appended} to the
258
values computed by \kbd{Configure}:
259
260
\kbd{CFLAGS}: Flags for \kbd{CC}.
261
262
\kbd{CPPFLAGS}: Flags for \kbd{CC} (preprocessor).
263
264
\kbd{LDFLAGS}: Flags for \kbd{LD}.
265
266
\noindent The contents of the following variables are \emph{prepended} to
267
the values computed by \kbd{Configure}:
268
269
\kbd{C\_INCLUDE\_PATH} is prepended to the list of directories
270
searched for include files. Note that adding \kbd{-I} flags to
271
\kbd{CFLAGS} is not enough since \kbd{Configure} sometimes
272
relies on finding the include files and parsing them, and it does not
273
parse \kbd{CFLAGS} at this time.
274
275
\kbd{LIBRARY\_PATH} is prepended to the list of directories
276
searched for libraries.
277
278
\noindent You may disable inlining by adding \kbd{-DDISABLE\_INLINE} to
279
\kbd{CFLAGS}, and prevent the use of the \kbd{volatile} keyword with
280
\kbd{-DDISABLE\_VOLATILE}.
281
282
\subsec{Debugging/profiling}: If you also want to debug the PARI library,
283
284
\kbd{Configure -g}
285
286
\noindent creates a directory \kbd{O$xxx$.dbg} containing a special
287
\kbd{Makefile} ensuring that the \kbd{gp} and PARI library built there is
288
suitable for debugging. If you want to
289
profile \kbd{gp} or the library, using \kbd{gprof} for instance,
290
291
\kbd{Configure -pg}
292
293
\noindent will create an \kbd{O$xxx$.prf} directory where a suitable version
294
of PARI can be built.
295
296
The \kbd{gp} binary built above with \kbd{make all} or \kbd{make gp} is
297
optimized. If you have run \kbd{Configure -g} or \kbd{-pg} and want to build
298
a special purpose binary, you can \kbd{cd} to the \kbd{.dbg} or \kbd{.prf}
299
directory and type \kbd{make gp} there. You can also invoke \kbd{make gp.dbg}
300
or \kbd{make gp.prf} directly from the toplevel.
301
302
\subsec{Multiprecision kernel} The kernel can be specified via the
303
304
\kbd{--kernel=\emph{fully\_qualified\_kernel\_name}}
305
306
\noindent switch. The PARI kernel consists of two levels: Level 0 (operation
307
on words) and Level 1 (operation on multi-precision integers and reals),
308
which can take the following values.
309
310
Level 0: \kbd{auto} (as detected), \kbd{none} (portable C) or
311
one of the assembler micro-kernels
312
\bprog
313
alpha
314
hppa hppa64
315
ia64
316
ix86 x86_64
317
m68k
318
ppc ppc64
319
sparcv7 sparcv8_micro sparcv8_super
320
@eprog
321
322
Level 1: \kbd{auto} (as detected), \kbd{none} (native code only), or \kbd{gmp}
323
324
\noindent\item A fully qualified kernel name is of the form
325
\kbd{\var{Level0}-\var{Level1}}, the default value being \kbd{auto-auto}.
326
327
\noindent\item A \emph{name} not containing a dash '\kbd{-}' is an alias
328
for a fully qualified kernel name. An alias stands for
329
\kbd{\emph{name}-none}, but \kbd{gmp} stands for \kbd{auto-gmp}.
330
331
\subsec{Problems related to readline}
332
\kbd{Configure} does not try very hard to find the \kbd{readline} library and
333
include files. If they are not in a standard place, it will not find them.
334
You can invoke \kbd{Configure} with one of the following arguments:
335
336
\kbd{--with-readline[=\emph{prefix to \kbd{lib/libreadline}.xx and
337
\kbd{include/readline.h}}]}
338
339
\kbd{--with-readline-lib=\emph{path to \kbd{libreadline}.xx}}
340
341
\kbd{--with-readline-include=\emph{path to \kbd{readline.h}}}
342
343
\misctitle{Known problems}
344
345
\item on Linux: Linux distributions have separate \kbd{readline} and
346
\kbd{readline-devel} packages. You need both of them installed to
347
compile gp with readline support. If only \kbd{readline} is installed,
348
\kbd{Configure} will complain. \kbd{Configure} may also complain about a
349
missing libncurses.so, in which case, you have to install the
350
\kbd{ncurses-devel} package (some distributions let you install
351
\kbd{readline-devel} without \kbd{ncurses-devel}, which is a bug in
352
their package dependency handling).
353
354
\item on OS X.4 or higher: these systems comes equipped with a fake
355
\kbd{readline}, which is not sufficient for our purpose. As a result, gp is
356
built without readline support. Since \kbd{readline} is not trivial to
357
install in this environment, a step by step solution can be found in the PARI
358
FAQ, see
359
$$
360
\url{http://pari.math.u-bordeaux.fr/}.
361
$$
362
363
\subsec{Testing}
364
365
\subsubsec{Known problems} if \kbd{BUG} shows up in \kbd{make bench}
366
367
\item If when running \kbd{gp-dyn}, you get a message of the form
368
369
\kbd{ld.so: warning: libpari.so.$xxx$ has older revision than expected $xxx$}
370
371
\noindent (possibly followed by more errors), you already have a dynamic PARI
372
library installed \emph{and} a broken local configuration. Either remove the
373
old library or unset the \kbd{LD\_LIBRARY\_PATH} environment variable. Try to
374
disable this variable in any case if anything \emph{very} wrong occurs with
375
the \kbd{gp-dyn} binary, like an Illegal Instruction on startup. It does not
376
affect \kbd{gp-sta}.
377
378
\item Some implementations of the \kbd{diff} utility (on HPUX for
379
instance) output \kbd{No differences encountered} or some similar
380
message instead of the expected empty input, thus producing a spurious
381
\kbd{[BUG]} message.
382
383
\subsubsec{Some more testing} [{\sl Optional\/}]
384
385
You can test \kbd{gp} in compatibility mode with \kbd{make test-compat}. If
386
you want to test the graphic routines, use \kbd{make test-ploth}. You will
387
have to click on the mouse button after seeing each image. There will be
388
eight of them, probably shown twice (try to resize at least one of them as a
389
further test).
390
391
The \kbd{make bench}, \kbd{make test-compat} and \kbd{make test-ploth} runs
392
all produce a Postscript file \kbd{pari.ps} in \kbd{O$xxx$} which you can
393
send to a Postscript printer. The output should bear some similarity to the
394
screen images.
395
396
\subsubsec{Heavy-duty testing} [{\sl Optional\/}]
397
There are a few extra tests which should be useful only for developers.
398
399
\kbd{make test-kernel} checks whether the low-level kernel seems to work,
400
and provides simple diagnostics if it does not. Only useful if \kbd{make
401
bench} fails horribly, e.g.~things like \kbd{1+1} do not work.
402
403
\kbd{make test-all} runs all available test suites. Thorough, but slow. Some
404
of the tests require extra packages (\kbd{elldata}, \kbd{galdata}, etc.)
405
to be available. If you want to test such an extra package \emph{before}
406
\kbd{make install} (which would install it to its final location, where
407
\kbd{gp} expects to find it), run
408
\bprog
409
env GP_DATA_DIR=$PWD/data make test-all
410
@eprog\noindent from the PARI toplevel directory, otherwise the test will
411
fail.
412
413
\kbd{make test-io} tests writing to and reading from files. It requires
414
a working \kbd{system()} command (fails on Windows + MingW).
415
416
\kbd{make test-time} tests absolute and relative timers. This test has a
417
tendency to fail when the machine is heavily loaded or if the granularity
418
of the chosen system timer is bigger than 2ms. Try it a few times before
419
reporting a problem.
420
421
\kbd{make test-install} tests the GP function \kbd{install}. This may not be
422
available on your platform, triggering an error message (``not yet available
423
for this architecture''). The implementation may be broken on your platform
424
triggering an error or a crash when an install'ed function is used.
425
426
\section{Installation} When everything looks fine, type
427
428
\kbd{make install}
429
430
\noindent You may have to do this with superuser privileges, depending on the
431
target directories. (Tip for MacOS X beginners: use \kbd{sudo make install}.)
432
In this case, it is advised to type \kbd{make all} first to avoid running
433
unnecessary commands as \kbd{root}.
434
435
\misctitle{Caveat} Install directories are created honouring your \kbd{umask}
436
settings: if your umask is too restrictive, e.g.~\kbd{077}, the installed
437
files will not be world-readable. (Beware that running \kbd{sudo} may change
438
your user umask.)
439
440
This installs in the directories chosen at \kbd{Configure} time the default
441
\kbd{gp} executable (probably \kbd{gp-dyn}) under the name \kbd{gp}, the
442
default PARI library (probably \kbd{libpari.so}), the necessary include
443
files, the manual pages, the documentation and help scripts.
444
445
To save on disk space, you can manually \kbd{gzip} some of the documentation
446
files if you wish: \kbd{usersch*.tex} and all \kbd{dvi} files (assuming your
447
\kbd{xdvi} knows how to deal with compressed files); the online-help system
448
can handle it.
449
450
\subsec{Static binaries and libraries}
451
By default, if a dynamic library \kbd{libpari.so} can be built, the \kbd{gp}
452
binary we install is \kbd{gp-dyn}, pointing to \kbd{libpari.so}. On the other
453
hand, we can build a \kbd{gp} binary into which the \kbd{libpari} is
454
statically linked (the library code is copied into the binary); that binary
455
is not independent of the machine it was compiled on, and may still refer to
456
other dynamic libraries than \kbd{libpari}.
457
458
You may want to compile your own programs in the same way, using the static
459
\kbd{libpari.a} instead of \kbd{libpari.so}. By default this static library
460
\kbd{libpari.a} is not created. If you want it as well, use the target
461
\kbd{make install-lib-sta}. You can install a statically linked \kbd{gp} with
462
the target \kbd{make install-bin-sta}. As a rule, programs linked statically
463
(with \kbd{libpari.a}) may be slightly faster (about 5\% gain, possibly
464
up to 20\% when using \kbd{pthreads}), but use more disk space and take more
465
time to compile. They are also harder to upgrade: you will have to recompile
466
them all instead of just installing the new dynamic library. On the other
467
hand, there is no risk of breaking them by installing a new pari library.
468
469
\subsec{Extra packages} The following optional packages endow PARI with some
470
extra capabilities:
471
472
\item \kbd{elldata}: This package contains the elliptic curves in
473
John Cremona's database. It is needed by the functions \kbd{ellidentify},
474
\kbd{ellsearch}, \kbd{forell} and can be used by \kbd{ellinit} to initialize a curve given by its standard code.
475
476
\item \kbd{galdata}: The default \kbd{polgalois} function can only
477
compute Galois groups of polynomials of degree less or equal to 7. Install
478
this package if you want to handle polynomials of degree bigger than 7 (and
479
less than 11).
480
481
\item \kbd{seadata}: This package contains the database of modular
482
polynomials extracted from the ECHIDNA databases and computed by David R.
483
Kohel. It is used to speed up the functions \kbd{ellap}, \kbd{ellcard} and
484
\kbd{ellgroup} for primes larger than $10^{20}$.
485
486
\item \kbd{galpol}: This package contains the GALPOL database of polynomials
487
defining Galois extensions of the rationals, accessed by \kbd{galoisgetpol}.
488
489
\medskip
490
491
To install package \emph{pack}, you need to fetch the separate archive:
492
\emph{pack}\kbd{.tgz} which you can download from the \kbd{pari} server.
493
Copy the archive in the PARI toplevel directory, then extract its
494
contents; these will go to \kbd{data/\emph{pack}/}. Typing \kbd{make
495
install} installs all such packages.
496
497
\subsec{The \kbd{GPRC} file} Copy the file \kbd{misc/gprc.dft} (or
498
\kbd{gprc.dos} if you are using \kbd{GP.EXE}) to \kbd{\$HOME/.gprc}. Modify
499
it to your liking. For instance, if you are not using an ANSI terminal,
500
remove control characters from the \kbd{prompt} variable. You can also
501
enable colors.
502
503
If desired, read \kbd{\$datadir/misc/gpalias} from the \kbd{gprc}
504
file, which provides some common shortcuts to lengthy names; fix the path in
505
gprc first. (Unless you tampered with this via Configure, \kbd{datadir} is
506
\kbd{\$prefix/share/pari}.) If you have superuser privileges and want to
507
provide system-wide defaults, copy your customized \kbd{.gprc} file to
508
\kbd{/etc/gprc}.
509
510
In older versions, \kbd{gphelp} was hidden in pari lib directory and was not
511
meant to be used from the shell prompt, but not anymore. If gp complains it
512
cannot find \kbd{gphelp}, check whether your \kbd{.gprc} (or the system-wide
513
\kbd{gprc}) does contain explicit paths. If so, correct them according to the
514
current \kbd{misc/gprc.dft}.
515
516
\section{Getting Started}
517
518
\subsec{Printable Documentation} Building gp with \kbd{make all} also builds
519
its documentation. You can also type directly \kbd{make doc}. In any case,
520
you need a working (plain) \TeX\ installation.
521
522
After that, the \kbd{doc} directory contains various \kbd{dvi} files:
523
\kbd{libpari.dvi} (manual for the PARI library), \kbd{users.dvi} (manual
524
for the \kbd{gp} calculator), \kbd{tutorial.dvi} (a tutorial), and
525
\kbd{refcard.dvi} (a reference card for GP). You can send these files to your
526
favorite printer in the usual way, probably via \kbd{dvips}. The reference
527
card is also provided as a \kbd{PostScript} document, which may be easier to
528
print than its \kbd{dvi} equivalent (it is in Landscape orientation and
529
assumes A4 paper size).
530
531
\noindent If \kbd{pdftex} is part of your \TeX\ setup, you can produce these
532
documents in PDF format, which may be more convenient for online browsing
533
(the manual is complete with hyperlinks); type
534
535
\kbd{make docpdf}
536
537
\noindent All these documents are available online from PARI home page
538
(see the last section).
539
540
\subsec{C programming} Once all libraries and include files are installed,
541
you can link your C programs to the PARI library. A sample makefile
542
\kbd{examples/Makefile} is provided to illustrate the use of the various
543
libraries. Type \kbd{make all} in the \kbd{examples} directory to see how
544
they perform on the \kbd{extgcd.c} program, which is commented in the
545
manual.
546
547
This should produce a statically linked binary \kbd{extgcd-sta}
548
(standalone), a dynamically linked binary \kbd{extgcd-dyn} (loads libpari
549
at runtime) and a shared library \kbd{libextgcd}, which can be used from
550
\kbd{gp} to \kbd{install} your new \kbd{extgcd} command.
551
552
The standalone binary should be bulletproof, but the other two may fail
553
for various reasons. If when running \kbd{extgcd-dyn}, you get a message
554
of the form ``DLL not found'', then stick to statically linked binaries
555
or look at your system documentation to see how to indicate at linking
556
time where the required DLLs may be found! (E.g.~on Windows, you will
557
need to move \kbd{libpari.dll} somewhere in your \kbd{PATH}.)
558
559
\subsec{GP scripts} Several complete sample GP programs are also given in
560
the \kbd{examples} directory, for example Shanks's SQUFOF factoring method,
561
the Pollard rho factoring method, the Lucas-Lehmer primality test for
562
Mersenne numbers and a simple general class group and fundamental unit
563
algorithm. See the file \kbd{examples/EXPLAIN} for some explanations.
564
565
\subsec{The PARI Community} PARI's home page at the address
566
$$\url{http://pari.math.u-bordeaux.fr/}$$
567
%
568
maintains an archive of mailing lists dedicated to PARI, documentation
569
(including Frequently Asked Questions), a download area and our Bug Tracking
570
System (BTS). Bug reports should be submitted online to the BTS, which may be
571
accessed from the navigation bar on the home page or directly at
572
$$\url{http://pari.math.u-bordeaux.fr/Bugs/}$$
573
%
574
Further information can be found at that address but, to report a
575
configuration problem, make sure to include the relevant \kbd{*.dif} files in
576
the \kbd{O$xxx$} directory and the file \kbd{pari.cfg}.
577
\smallskip
578
579
There are a number of mailing lists devoted to PARI/GP, and most feedback
580
should be directed there. Instructions and archives can be consulted at
581
$$ \url{http://pari.math.u-bordeaux.fr/lists-index.html} $$
582
%
583
The most important are:
584
585
\item \kbd{pari-announce} (\emph{read-only}): to announce major version
586
changes. You cannot write to this one, but you should probably subscribe.
587
588
\item \kbd{pari-dev}: for everything related to the development of PARI,
589
including suggestions, technical questions or patch submissions. Bug reports
590
can be discussed here, but as a rule it is better to submit them directly
591
to the BTS.
592
593
\item \kbd{pari-users}: for everything else.
594
595
\noindent You may send an email to the last two without being subscribed.
596
To subscribe, send an message respectively to
597
\def\@{@}
598
\bprog
599
pari-announce-request@@pari.math.u-bordeaux.fr
600
pari-users-request@@pari.math.u-bordeaux.fr
601
pari-dev-request@@pari.math.u-bordeaux.fr
602
@eprog\noindent with the word \kbd{subscribe} in the \kbd{Subject:}.
603
You can also write to us at the address
604
\bprog
605
pari@@math.u-bordeaux.fr
606
@eprog\noindent but we cannot promise you will get an individual answer.
607
\smallskip
608
609
If you have used PARI in the preparation of a paper, please cite it in the
610
following form (BibTeX format):
611
612
\bprog
613
@@preamble{\usepackage{url}}
614
@@manual{PARI2,
615
organization = "{The PARI~Group}",
616
title = "{PARI/GP version @vers}",
617
year = 2021,
618
address = "Bordeaux",
619
note = "available from \url{http://pari.math.u-bordeaux.fr/}"
620
}
621
@eprog
622
\smallskip
623
624
\noindent In any case, if you like this software, we would be indebted if you
625
could send us an email message giving us some information about yourself and
626
what you use PARI for.
627
628
\medskip
629
{\bf Good luck and enjoy!}
630
\vfill\eject
631
632