Go forward to MP Basics.
Go backward to Introduction to MP.
Go up to Top.

Installing MP
*************

   To build MP, you first have to configure it for your CPU and
operating system.  You need a C compiler, preferably GCC, but any
reasonable compiler should work.  And you need a standard Unix `make'
program, plus some other standard Unix utility programs.

   (If you're on an MS-DOS machine, your can build MP using `make.bat'.
It requires that djgpp is installed.  It does not require
configuration, nor is `make' needed; `make.bat' both configures and
builds the library.)

   Here are the steps needed to install the library on Unix systems:

  1. In most cases, `./configure --target=cpu-vendor-os', should work
     both for native and cross-compilation.  If you get error messages,
     your machine might not be supported.

     If you want to compile in a separate object directory, cd to that
     directory, and prefix the configure command with the path to the
     MP source directory.  Not all `make' programs have the necessary
     features to support this.  In particular, SunOS and Slowaris
     `make' have bugs that makes them unable to build from a separate
     object directory.  Use GNU `make' instead.

     In addition to the standard cpu-vendor-os tuples, MP recognizes
     sparc8 and supersparc as valid CPU names.  Specifying these CPU
     names for relevant systems will improve performance significantly.

     In general, if you want a library that runs as fast as possible,
     you should make sure you configure MP for the exact CPU type your
     system uses.

     If you have `gcc' in your `PATH', it will be used by default.  To
     override this, pass `-with-gcc=no' to `configure'.

  2. `make'

     This will compile MP, and create a library archive file `libgmp.a'
     in the working directory.

  3. `make check'

     This will make sure MP was built correctly.  If you get error
     messages, please report this to `bug-gmp@prep.ai.mit.edu'.  (
See Reporting Bugs, for information on what to include in useful bug
     reports.)

  4. `make install'

     This will copy the file `gmp.h' and `libgmp.a', as well as the info
     files, to `/usr/local' (or if you passed the `--prefix' option to
     `configure', to the directory given as argument to `--prefix').

If you wish to build and install the BSD MP compatible functions, use
`make libmp.a' and `make install-bsdmp'.

   There are some other useful make targets:

   * `doc'

     Create a DVI version of the manual, in `gmp.dvi' and a set of info
     files, in `gmp.info', `gmp.info-1', `gmp.info-2', etc.

   * `ps'

     Create a Postscript version of the manual, in `gmp.ps'.

   * `html'

     Create a HTML version of the manual, in `gmp.html'.

   * `clean'

     Delete all object files and archive files, but not the
     configuration files.

   * `distclean'

     Delete all files not included in the distribution.

   * `uninstall'

     Delete all files copied by `make install'.

Known Build Problems
====================

   GCC 2.7.2 (as well as 2.6.3) for the RS/6000 and PowerPC can not be
used to compile MP, due to a bug in GCC.  If you want to use GCC for
these machines, you need to apply the patch below to GCC, or use a
later version of the compiler.

   If you are on a Sequent Symmetry, use the GNU assembler instead of
the system's assembler, since the latter has 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 MP.
You need to get a real gcc, and install that before you compile MP.
(NeXT might have fixed this in newer releases of their system.)

   The system C compiler under SunOS 4 has a bug that makes it
miscompile mpq/get_d.c.  This will make `make check' fail.

   Please report other problems to `bug-gmp@prep.ai.mit.edu'.  
See Reporting Bugs.

   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 ""