                  INSTALLATION GUIDE FOR THE UNIX VERSIONS


This is the installation guide to the Un*x versions of Pari/GP. Starting
with release 1.38, we assume that you have either an ANSI C or a C++ compiler
available.
If your machine does not have one (for example if you still use /bin/cc
in SunOS 4.1), we strongly suggest that you obtain the gcc/g++ compiler
from the Free Software Foundation or by anonymous ftp. A non-ANSI version
of version 1.37.3 is available, but no more changes or corrections will be
made to this version in the future.

1) To compile the library and the calculator (gp). 
   a) First, create a Makefile which is as close as possible to your system
      by typing "Makemakefile arch", where "arch" can be the following.

sun3    if your machine is 68020/68030/68040/68060 based. In that case, you 
        will also have to choose which assembly file to use (see 7 below).
hppa    if your machine has the HP-PA architecture.
sparcv7 if your machine is based on Sparc version 7 (example: Sparcstations 1,
        1+, 2, IPC, IPX).
sparcv8 if your machine is based on Sparc version 8 (example: Sparcstations 10,
        Classic, LX). In this case you will have to choose which assembly
        file to use (see 8 below).
i386    if your machine is based on a 386+387 or 486 and you use a Un*x OS
        (it has been successfully tested with linux).
dos     if your machine is based on a 386+387 or 486 and you are still in the 
        DOS world. This requires the emx/gcc compiler. Note also that it is
	incompatible with the Windows environment.
	
	If you do not give any argument to Makemakefile, the Makefile which
	is generated is for other Un*x machines, for example DECstations.
	A few modifications to the Makefile may be necessary in this case.

	Note: starting with the present release, we hope to be able to support
	64-bit machines. The present version has been tested on a DEC Alpha,
	and still has specific bugs, probably due to the compiler (whether gcc
	or cc) but is usable.

   b) Decide if you want to compile with an ANSI C or a C++ compiler. The
      C++ version of Pari is always a little faster because of inlining, but
      can be used in library mode only with C++ programs. Hence you may want,
      for example, to install GP compiled in C++, but the ANSI C library if
      you want to link it with ANSI C programs.
      The Makefile is generated by default for ANSI C. If you want it for C++,
      you must perform the following changes in the Makefile: replace gcc by
      g++ (if this is your C++ compiler), remove the -ansi flag, and if you
      use a non-68k version, replace 
      $(CC) $(CFLAGS) -c mp.c by $(CC) $(CFLAGS) -c -o mp.o mpin.c

   c) The Makefile assumes by default that you are using X11 as a windowing
      system. If this is not the case, modify the Makefile accordingly:
      you are given the choice of X11 (the default), sunview or no plotting.
      For this, comment/uncomment the lines corresponding to PLOTFILE,
      PLOTCFLAGS and PLOTLIBS.
      Some slight modifications may also have to be made so that the compiler 
      knows where to access the X11 libraries if they are in some non-standard
      place.
   d) If you have the GNU readline library installed (distributed with gdb),
      and want to use its facilities (this is not so useful if, as we advise,
      you work in an Emacs buffer, see below), comment/uncomment the
      appropriate lines involving GPMAIN in the Makefile.
      Note: if you are compiling with sunview, 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.38, these are the functions
      buchimag(), buchreal() and buchgen(), all three 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(), buchreal() and buchgen().
      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.  Note also that the Sparcv7 version runs on Sparcv8
      machines, but slower than the specific Sparcv8 version. On the contrary
      the Sparcv8 version cannot run on Sparcv7 machines.

   g) To test the executable, run gp on the file testin as follows:
      gp < testin >& fileout &. Then do a diff with the file testout. Apart
      from the header (version number and type) and the very last line which
      gives the user elapsed time in milliseconds, any difference probably
      means that something is wrong. Most probably with your installation
      procedure, but it may be a bug in the Pari 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. 
   h) If you want to test the graphic routines, use 
      gp<testplotin. You will have to click 6 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.
2) To install the PARI library so that it can be easily used from a user
   program, 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/local/include/pari, which is created if it does not
   already exist. If these directories do not suit your 
   installation, change the LIBDIR or the INCLUDEDIR in the Makefile.
   You can install separately the library and gp by using the targets
   "install-lib" and "install-bin".
3) Once installed, to link to the PARI library just add -lpari in your
   link command and -I/usr/local/include/pari to your compilation commands.
   A sample makefile (Makesimple) is given for gp itself.
   All modifications made to the Makefile should of course be made on the
   Makesimple file.
4) 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. If you are familiar with Emacs, we strongly suggest
   that you do so.
5) If you want to get rid of your .o files and the created binaries in the
   working directory, type "make clean".
6) 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 simple general class
   group and fundamental unit algorithm, much worse than buchgen). See the 
   file Newin1.37 for more explanations.
7) 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.
8) The different implementations of the Sparc Version 8 architecture (at 
   present mainly Microsparc and Supersparc) need slightly different assembly
   language modules for optimum speed, although they are compatible.
   If you have a Supersparc (e.g. SparcStation 10), then make a symbolic
   link from sparcv8super.s to sparcv8.s. If you have a Microsparc (e.g. Sparc
   Classic and LX), make a symbolic link from sparcv8micro.s to sparc.s.
   By default, the link in the distrinution is from sparcv8super.s.
9) To print the users' manual, go in the doc directory and type "make"
   This will automatically create a file users.dvi containing the manual with
   a table of contents and an index in two passes. You must then send the 
   .dvi file 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.
10) Send bugs, comments, etc... to:
   pari@ceremab.u-bordeaux.fr
   In any case, we would like to start a Pari mailing list, so if you get
   this software, even if you are an old-timer of Pari, we would appreciate
   if you could send us an e-mail message giving us some information about
   yourself. Put as header of your message "mailing list", so we can recognize
   it easily. In exchange, we will try to keep you informed on the progress of
   the system.
11) Good luck and enjoy!
