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 b) 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 b) below). Note that the modifications to be made for Solaris 2.x are more complicated, so for the moment we provide only compiled binaries. i386 if your machine is based on a 386+387, 486 or Pentium and you use a Un*x OS (it has been successfully tested with linux). dos if your machine is based on a 386+387, 486 or Pentium 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. In particular, the flag -DULONG_NOT_DEFINED which is set by default may have to be removed (if the type ulong is defined), and of course the flag -DLONG_IS_32BIT has to be changed to -DLONG_IS_64BIT in case of 64 bit machines. 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) In the case of 680x0 or sparcv8 systems you must choose which assembly file to use: 680x0 systems: 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. sparcv8 systems: 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. c) 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 d) 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. e) 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). f) 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.x, these are the functions buchxxx(), isprincipal() and isunit(), all 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 all the buchxxx(), isprincipal() and isunit() programs. 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. g) 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. h) 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. i) If you want to test the graphic routines, use gp