Annotation of OpenXM/src/kan96xx/gmp-2.0.2-ssh-2/INSTALL, Revision 1.1
1.1 ! takayama 1: THIS IS A MODIFIED VERSION OF GMP-2.0.2. THE MODIFICATIONS WERE MADE
! 2: TO INTEGRATE THIS CODE TO THE SSH SOFTWARE PACKAGE. PLEASE CONTACT
! 3: ssh-bugs@cs.hut.fi IF MORE INFORMATION IS NEEDED.
! 4: -------------------------------------------------------------------------
! 5: INSTALLING GMP
! 6: ==============
! 7:
! 8: These instructions are only for the impatient. Others should read the install
! 9: instructions in the manual, gmp.info. Use "info -f gmp.info", or, if you
! 10: don't have info, use type "C-h i g (gmp.info)Top" in emacs.
! 11:
! 12: Here are short instructions how to install MP, and some examples that help you
! 13: get started using MP.
! 14:
! 15: First, you need to compile, and optionally install, MP. Since you're
! 16: impatient, try this:
! 17:
! 18: ./configure; make
! 19:
! 20: If that fails, or you care about the performance of MP, you need to read the
! 21: full instructions in the chapter "Installing MP", in the manual.
! 22:
! 23: Next, you need to try some small test programs, for example the ones below.
! 24:
! 25: In MP programs, all variables need to be initialized before they are assigned,
! 26: and cleared out before program flow leaves the scope in which it was declared.
! 27: Here is an example of a program that reads two numbers from the command line,
! 28: multiplies them, and prints the result to stdout.
! 29:
! 30: #include <stdio.h>
! 31: #include <gmp.h> /* All MP programs need to include gmp.h */
! 32:
! 33: main (int argc, char **argv)
! 34: {
! 35: mpz_t a, b, p;
! 36:
! 37: /* Initialize variables */
! 38: mpz_init (a);
! 39: mpz_init (b);
! 40: mpz_init (p);
! 41:
! 42: /* Assign a and b from base 10 strings in argv */
! 43: mpz_set_str (a, argv[1], 10);
! 44: mpz_set_str (b, argv[2], 10);
! 45:
! 46: /* Multiply a and b and put the result in p */
! 47: mpz_mul (p, a, b);
! 48:
! 49: /* Print p in base 10 */
! 50: mpz_out_str (stdout, 10, p);
! 51: fputc ('\n', stdout);
! 52:
! 53: /* Clear out variables */
! 54: mpz_clear (a);
! 55: mpz_clear (b);
! 56: mpz_clear (p);
! 57: exit (0);
! 58: }
! 59:
! 60:
! 61: In practice, that example would be written like this instead:
! 62:
! 63: #include <stdio.h>
! 64: #include <gmp.h>
! 65:
! 66: main (int argc, char **argv)
! 67: {
! 68: mpz_t a, b, p;
! 69:
! 70: /* Initialize and assign a and b from base 10 strings in argv */
! 71: mpz_init_set_str (a, argv[1], 10);
! 72: mpz_init_set_str (b, argv[2], 10);
! 73: /* Initialize p */
! 74: mpz_init (p);
! 75:
! 76: /* Multiply a and b and put the result in p */
! 77: mpz_mul (p, a, b);
! 78:
! 79: /* Print p in base 10 */
! 80: mpz_out_str (stdout, 10, p);
! 81: fputc ('\n', stdout);
! 82:
! 83: /* Since we're about to exit, no need to clear out variables */
! 84: exit (0);
! 85: }
! 86:
! 87: Finally, you have to compile your test program, and link it with the MP
! 88: library. Assuming your working directory is still the gmp source directory,
! 89: type:
! 90:
! 91: gcc -g -I. example.c libgmp.a
! 92:
! 93:
! 94: Now try to run the example:
! 95:
! 96: a.out 98365871231256752134 319378318340103345227
! 97: 31415926535897932384618573336104570964418
! 98:
! 99: The functions used here all operate on the domain of signed integers.
! 100: Functions operating on that domain have names starting with "mpz_". There are
! 101: many more such functions than used in these examples. See the chapter
! 102: "Integer Functions" in the manual, for a complete list.
! 103:
! 104: There are two other main classes of functions in MP. They operate on rational
! 105: numbers and floating-point numbers, respectively. The chapters "Rational
! 106: Number Functions", and "Floating-point Functions" documents these classes.
! 107:
! 108: To run a set of tests, do "make check". This will take a while.
! 109:
! 110: To create the printable documentation from the texinfo source, type "make
! 111: dvi". This requires the "tex" command to be available in your search path.
! 112:
! 113: To install the library, do "make install".
! 114:
! 115: If you decide to use MP, It is a good idea you read at least the chapter "MP
! 116: Basics" in the manual.
! 117:
! 118:
! 119: Known Build Problems
! 120: --------------------
! 121:
! 122: Note that GCC 2.7.2 (as well as 2.6.3) for the RS/6000 and PowerPC can not
! 123: be used to compile GMP, due to a bug in GCC. If you want to use GCC, you
! 124: need to apply the patch at the end of this file, or use a later version of
! 125: the compiler.
! 126:
! 127: If you are on a Sequent Symmetry, use GAS instead of the system's assembler
! 128: due to the latter's serious bugs.
! 129:
! 130: The system compiler on NeXT is a massacred and old gcc, even if the
! 131: compiler calls itself cc. This compiler cannot be used to build GMP. You
! 132: need to get a real gcc, and install that before you compile GMP. (NeXT
! 133: might have fixed this in newer releases of their system.)
! 134:
! 135: Please report other problems to bug-gmp@prep.ai.mit.edu.
! 136:
! 137:
! 138: Patch to apply to GCC 2.6.3 and 2.7.2:
! 139:
! 140: *** config/rs6000/rs6000.md Sun Feb 11 08:22:11 1996
! 141: --- config/rs6000/rs6000.md.new Sun Feb 18 03:33:37 1996
! 142: ***************
! 143: *** 920,926 ****
! 144: (set (match_operand:SI 0 "gpc_reg_operand" "=r")
! 145: (not:SI (match_dup 1)))]
! 146: ""
! 147: ! "nor. %0,%2,%1"
! 148: [(set_attr "type" "compare")])
! 149:
! 150: (define_insn ""
! 151: --- 920,926 ----
! 152: (set (match_operand:SI 0 "gpc_reg_operand" "=r")
! 153: (not:SI (match_dup 1)))]
! 154: ""
! 155: ! "nor. %0,%1,%1"
! 156: [(set_attr "type" "compare")])
! 157:
! 158: (define_insn ""
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>