head	1.2;
access;
symbols
	RELENG_2_1_7_RELEASE:1.1.1.1
	RELENG_2_1_6_1_RELEASE:1.1.1.1
	RELENG_2_1_6_RELEASE:1.1.1.1
	gmp_2_0_2:1.1.1.2
	RELENG_2_1_5_RELEASE:1.1.1.1
	RELENG_2_1_0:1.1.1.1.0.2
	gmp_1_3_2:1.1.1.1
	GNU:1.1.1;
locks; strict;
comment	@# @;


1.2
date	96.10.20.09.06.04;	author markm;	state dead;
branches;
next	1.1;

1.1
date	95.11.12.14.40.37;	author markm;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	95.11.12.14.40.37;	author markm;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	96.10.20.08.07.49;	author markm;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Remove the old libgmp. Version 2.0.2 is about to hit prime time.
@
text
@Here is how to compile GNU MP.

You probably want to use the GNU C compiler to build this library.
With other compilers the speed of the library will be 3-10 times
slower for many CPU:s.  The reason for this is that the GNU C compiler
will use inline assembler for some important operations, while other C
compilers will have to stick to plain C code.

This is how to build the library:

  Type "make" to build libgmp.a and libmp.a.  The former is the main
  GNU MP library.  The latter is the Berkeley MP compatible library.

  If you don't have GCC, type "make CC=cc".  The compilation should, at
  least with GCC, proceed without any kind of warnings from the compiler
  programs.  On the DEC Alpha, you have to use GCC because of bugs in DEC's
  own compiler.  GCC 2.3.3 for x86, Alpha, and HP-PA has bugs that make
  several functions be mis-optimized.  Later version of GCC does not have
  this problem.

  To build and run the tests, do "make check".

The documentation is an a texinfo file, gmp.texi.

To create the documentation from the texinfo source, type "make doc".
This requires the "tex" and "makeinfo" commands to be available in
your search path.  If you have only one of them, you can create the
dvi file (for the paper manual) with "make gmp.dvi", and the info file
(for the GNU online manual facility) with "make gmp.info".

You need version 2.06 or later of texinfo in order to build the
documentation.

Please report problems to tege@@gnu.ai.mit.edu.
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@GNU MP (Multiprecision) library. This is needed by secure RPC (being
done by Bill Paul) and various other BSD programs.
Obtained from:FSF
@
text
@@


1.1.1.2
log
@Import of GNU MP 2.0.2
This is a clean import with only the non-x86 bits removed. Makefiles and
other will follow.

Requested by:	Andrey Chernov
Made world by:	Chuck Robey
@
text
@d1 1
a1 2
INSTALLING GMP
==============
d3 5
a7 3
These instructions are only for the impatient.  Others should read the install
instructions in the manual, gmp.info.  Use "info -f gmp.info", or, if you
don't have info, use type "C-h i g (gmp.info)Top" in emacs.
d9 1
a9 2
Here are short instructions how to install MP, and some examples that help you
get started using MP.
d11 2
a12 2
First, you need to compile, and optionally install, MP.  Since you're
impatient, try this:
d14 6
a19 1
	./configure; make
d21 1
a21 2
If that fails, or you care about the performance of MP, you need to read the
full instructions in the chapter "Installing MP", in the manual.
d23 1
a23 1
Next, you need to try some small test programs, for example the ones below.
d25 5
a29 4
In MP programs, all variables need to be initialized before they are assigned,
and cleared out before program flow leaves the scope in which it was declared.
Here is an example of a program that reads two numbers from the command line,
multiplies them, and prints the result to stdout.
d31 2
a32 2
    #include <stdio.h>
    #include <gmp.h>         /* All MP programs need to include gmp.h */
d34 1
a34 126
    main (int argc, char **argv)
    {
      mpz_t a, b, p;

      /* Initialize variables */
      mpz_init (a);
      mpz_init (b);
      mpz_init (p);

      /* Assign a and b from base 10 strings in argv */
      mpz_set_str (a, argv[1], 10);
      mpz_set_str (b, argv[2], 10);

      /* Multiply a and b and put the result in p */
      mpz_mul (p, a, b);

      /* Print p in base 10 */
      mpz_out_str (stdout, 10, p);
      fputc ('\n', stdout);

      /* Clear out variables */
      mpz_clear (a);
      mpz_clear (b);
      mpz_clear (p);
      exit (0);
    }


In practice, that example would be written like this instead:

    #include <stdio.h>
    #include <gmp.h>

    main (int argc, char **argv)
    {
      mpz_t a, b, p;

      /* Initialize and assign a and b from base 10 strings in argv */
      mpz_init_set_str (a, argv[1], 10);
      mpz_init_set_str (b, argv[2], 10);
      /* Initialize p */
      mpz_init (p);

      /* Multiply a and b and put the result in p */
      mpz_mul (p, a, b);

      /* Print p in base 10 */
      mpz_out_str (stdout, 10, p);
      fputc ('\n', stdout);

      /* Since we're about to exit, no need to clear out variables */
      exit (0);
    }

Finally, you have to compile your test program, and link it with the MP
library.  Assuming your working directory is still the gmp source directory,
type:

	gcc -g -I. example.c libgmp.a


Now try to run the example:

	a.out 98365871231256752134 319378318340103345227
	31415926535897932384618573336104570964418

The functions used here all operate on the domain of signed integers.
Functions operating on that domain have names starting with "mpz_".  There are
many more such functions than used in these examples.  See the chapter
"Integer Functions" in the manual, for a complete list.

There are two other main classes of functions in MP.  They operate on rational
numbers and floating-point numbers, respectively.  The chapters "Rational
Number Functions", and "Floating-point Functions" documents these classes.

To run a set of tests, do "make check".  This will take a while.

To create the printable documentation from the texinfo source, type "make
dvi".  This requires the "tex" command to be available in your search path.

To install the library, do "make install".

If you decide to use MP, It is a good idea you read at least the chapter "MP
Basics" in the manual.


Known Build Problems
--------------------

Note that GCC 2.7.2 (as well as 2.6.3) for the RS/6000 and PowerPC can not
be used to compile GMP, due to a bug in GCC.  If you want to use GCC, you
need to apply the patch at the end of this file, or use a later version of
the compiler.

If you are on a Sequent Symmetry, use GAS instead of the system's assembler
due to the latter's serious bugs.

The system compiler on NeXT is a massacred and old gcc, even if the
compiler calls itself cc.  This compiler cannot be used to build GMP.  You
need to get a real gcc, and install that before you compile GMP.  (NeXT
might have fixed this in newer releases of their system.)

Please report other problems to bug-gmp@@prep.ai.mit.edu.


Patch to apply to GCC 2.6.3 and 2.7.2:

*** config/rs6000/rs6000.md	Sun Feb 11 08:22:11 1996
--- config/rs6000/rs6000.md.new	Sun Feb 18 03:33:37 1996
***************
*** 920,926 ****
     (set (match_operand:SI 0 "gpc_reg_operand" "=r")
  	(not:SI (match_dup 1)))]
    ""
!   "nor. %0,%2,%1"
    [(set_attr "type" "compare")])
  
  (define_insn ""
--- 920,926 ----
     (set (match_operand:SI 0 "gpc_reg_operand" "=r")
  	(not:SI (match_dup 1)))]
    ""
!   "nor. %0,%1,%1"
    [(set_attr "type" "compare")])
  
  (define_insn ""
@
