                              INSTALLATION GUIDE


1) To print the users' manual, type "make manual" in the main directory
   (after having copied an appropriate Makefile as explained below),
   or make in the tex subdirectory.
   This will create a file users.dvi containing the manual and a table of
   contents, and a separate index.dvi containing the index. You must
   then send the two .dvi files to your favorite printer in the usual way.
   A tutorial for GP is being written. If you want the available part of the
   tutorial to be included in the manual, uncomment the line \input tutorial
   in the file users.tex.
2) To compile the library and the calculator (gp).
   a) Choose the Makefile appropriate to your system. Choose Makefile.sun3 if
      your machine is 68020/68030/68040 based. In that case, you must also
      choose which assembly file to use (see 8) below).
      Choose Makefile.sun4 if your machine is Sparc based.
      Choose Makefile.hppa if your machine has the HP-PA architecture.
      For any other machine, use Makefile.port. On DECstations, for example, a
      few extra modifications are necessary. For example, if you have a
      sun4, type cp Makefile.sun4 Makefile.
   b) If you have the GNU gcc compiler installed (we recommend that you do),
      then replace in the Makefile CC=cc by CC=gcc, add the flag -g in the 
      CFLAGS if you know how to use dbx or gdb and want to debug PARI yourself,
      and add the flag -traditional in the compilation options of plot.o if
      in addition you are under suntools.
   c) If you are not running under suntools or X11, change in the Makefile 
      plot.sun to plot.null. If you are using the X11 window system, 
      change plot.sun (or plot.null in the port version) to plot.X.
      Some slight modifications may have to be made so that the compiler knows
      where to access the X11 libraries.
   d) If you have the GNU readline library installed (distributed with gdb),
      replace gp.c by gpreadline.c, i.e. mv gp.c gpold.c; mv gpreadline.c gp.c.
      Then in the Makefile add -lreadline -ltermcap to the list of libraries
      in the compilation line for gp.
      Note: if you are compiling with sunview (-lsuntool -lsunwindow -lpixrect)
      you will have an error message about a redefined function rl_copy.
      Since the sun source code is not available, the way out is to recompile
      the GNU readline library by changing in the file readline.c rl_copy to
      some weird name, say rl_copy_kludge.
      The use of the readline and history library (suggested to us by E. Roeder)
      is not documented but is similar to emacs commands. However note that
      it is incompatible with SUN commandtools (but not with shelltools).
   e) Some special-purpose application programs may be available in Pari and
      GP. By default in the distribution they are available under GP, but are
      not linked in with the other library modules during the creation of the
      file libpari.a. In the present version 1.36.3, these are the functions
      buchimag() and buchreal(), both in the file buch.c. If you want to have
      the smallest possible GP executable, you will have to do two things. 
      First suppress all occurrences of buch.c and buch.o in the Makefile.
      Second, in the files anal.c, helpmessages.c and gencom.h, suppress the
      lines corresponding to buchimag() and buchreal().
      If on the contrary you want these functions to be available in library
      mode as well as under GP, in the Makefile add buch.o to the files which
      are listed during the creation of libpari.a.
   f) Then simply type "make" in the distribution directory. Be sure to 
      "make clean" before changing to another architecture using the same
      file system. Note that the 68020 version is especially fast compared
      to the processor speed because a large part of the kernel is written in
      assembly language.
   g) To test the executable, run gp on the file testin as follows:
      gp < testin >& fileout &. Then do a diff with the file testout. If any
      difference occurs other than the heading (version number and type),
      and the functions random() and tchirnhausen()
      this means something is wrong. Most probably with your installation
      procedure, but it may be a bug in the system, in which case we would
      appreciate a report. Note that testin is not a severe test and is
      quite fast (a few minutes), but does check at least one instance of
      every function. Do NOT forget the & after >, since testin tests one
      special error message. Testin does not check the optional functions
      such as buchimag and buchreal. You should check them yourself
      (you can take as examples the commented calls of these functions which
      are in the testin file).
   h) If you want to test the graphic routines, use 
      gp<testplotin. You will have to click 5 times on the mouse
      button after seeing each image (under X11; under suntools you must kill
      the images). The testin script produces a Postscript file pari.ps which 
      you can send to a Postscript printer. The printed output should be similar
      (although not identical) to the screen images.
3) To install the PARI library so that it can be easily used from a user
   program, create the directory /usr/include/pari-include, and type 
   "make install". This puts the executable gp in /usr/local/bin, the library 
   in the directory /usr/local/lib, and the necessary include files in 
   /usr/include/pari-include. If these directories do not suit your 
   installation, change the LIBDIR or the INCLUDEDIR in the Makefile. 
4) Once installed, to link to the PARI library just add -lpari in your
   link command. A sample makefile (Makesimple) is given for gp itself.
   All modifications made to the Makefile should of course be made on the
   Makesimple file.
5) If you want to use gp under gnuemacs (see section 3.11 of the users' manual)
   change the pathnames in the file pari.el to suit your installation, and read
   the file pari.txt.
6) If you want to get rid of your .o files and the created binaries in the
   working directory, type "make clean".
7) For the example of section 4.3 of the user's manual, type make
   in the directory examples. Two complete sample GP programs are also given in
   that directory (Shanks's SQUFOF factoring method and a general class group
   and fundamental unit algorithm). See the file Newin1.36.3 for more
   explanations.
8) The syntax used by the SUN 3 assembler is not standard. On the MacII 
   distribution, the correct Mac assembler syntax is given. In the present
   distribution, in addition to mp.s which has the SUN 3 syntax, two files
   called mp.news and mp.ami are included so as to help people having machines
   with a 680x0 processor (x>=2) but a more standard syntax.

   This may not correspond to the actual syntax used, but may be closer than
   mp.s.
   In principle, apart from whitespace and the different syntax, the semantics
   of the two files should be identical. In case of conflict, correct 
   mp.news or mp.ami (i.e. NEVER touch mp.s).

   The file mp.news has been successfully tested on a Sony NEWS, and the file
   mp.ami on a Commodore Amiga 2500 running Lattice C 5.10.
9) Send bugs, comments, etc... to:
   pari@alioth.greco-prog.fr
10) Good luck!
