You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
239 lines
10 KiB
HTML
239 lines
10 KiB
HTML
4 years ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
|
<html>
|
||
|
<!-- This manual documents how to install and use the Multiple Precision
|
||
|
Floating-Point Reliable Library, version 3.1.4.
|
||
|
|
||
|
Copyright 1991, 1993-2016 Free Software Foundation, Inc.
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document under
|
||
|
the terms of the GNU Free Documentation License, Version 1.2 or any later
|
||
|
version published by the Free Software Foundation; with no Invariant Sections,
|
||
|
with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the
|
||
|
license is included in GNU Free Documentation License. -->
|
||
|
<!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
|
||
|
<head>
|
||
|
<title>Installing MPFR (GNU MPFR 3.1.4)</title>
|
||
|
|
||
|
<meta name="description" content="How to install and use GNU MPFR, a library for reliable multiple precision
|
||
|
floating-point arithmetic, version 3.1.4.">
|
||
|
<meta name="keywords" content="Installing MPFR (GNU MPFR 3.1.4)">
|
||
|
<meta name="resource-type" content="document">
|
||
|
<meta name="distribution" content="global">
|
||
|
<meta name="Generator" content="makeinfo">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<link href="index.html#Top" rel="start" title="Top">
|
||
|
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
|
||
|
<link href="index.html#Top" rel="up" title="Top">
|
||
|
<link href="Reporting-Bugs.html#Reporting-Bugs" rel="next" title="Reporting Bugs">
|
||
|
<link href="Introduction-to-MPFR.html#Introduction-to-MPFR" rel="prev" title="Introduction to MPFR">
|
||
|
<style type="text/css">
|
||
|
<!--
|
||
|
a.summary-letter {text-decoration: none}
|
||
|
blockquote.indentedblock {margin-right: 0em}
|
||
|
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
|
||
|
blockquote.smallquotation {font-size: smaller}
|
||
|
div.display {margin-left: 3.2em}
|
||
|
div.example {margin-left: 3.2em}
|
||
|
div.lisp {margin-left: 3.2em}
|
||
|
div.smalldisplay {margin-left: 3.2em}
|
||
|
div.smallexample {margin-left: 3.2em}
|
||
|
div.smalllisp {margin-left: 3.2em}
|
||
|
kbd {font-style: oblique}
|
||
|
pre.display {font-family: inherit}
|
||
|
pre.format {font-family: inherit}
|
||
|
pre.menu-comment {font-family: serif}
|
||
|
pre.menu-preformatted {font-family: serif}
|
||
|
pre.smalldisplay {font-family: inherit; font-size: smaller}
|
||
|
pre.smallexample {font-size: smaller}
|
||
|
pre.smallformat {font-family: inherit; font-size: smaller}
|
||
|
pre.smalllisp {font-size: smaller}
|
||
|
span.nolinebreak {white-space: nowrap}
|
||
|
span.roman {font-family: initial; font-weight: normal}
|
||
|
span.sansserif {font-family: sans-serif; font-weight: normal}
|
||
|
ul.no-bullet {list-style: none}
|
||
|
-->
|
||
|
</style>
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body lang="en">
|
||
|
<a name="Installing-MPFR"></a>
|
||
|
<div class="header">
|
||
|
<p>
|
||
|
Next: <a href="Reporting-Bugs.html#Reporting-Bugs" accesskey="n" rel="next">Reporting Bugs</a>, Previous: <a href="Introduction-to-MPFR.html#Introduction-to-MPFR" accesskey="p" rel="prev">Introduction to MPFR</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<a name="Installing-MPFR-1"></a>
|
||
|
<h2 class="chapter">2 Installing MPFR</h2>
|
||
|
<a name="index-Installation"></a>
|
||
|
|
||
|
<p>The MPFR library is already installed on some GNU/Linux distributions,
|
||
|
but the development files necessary to the compilation such as
|
||
|
<samp>mpfr.h</samp> are not always present. To check that MPFR is fully
|
||
|
installed on your computer, you can check the presence of the file
|
||
|
<samp>mpfr.h</samp> in <samp>/usr/include</samp>, or try to compile a small program
|
||
|
having <code>#include <mpfr.h></code> (since <samp>mpfr.h</samp> may be installed
|
||
|
somewhere else). For instance, you can try to compile:
|
||
|
</p>
|
||
|
<div class="example">
|
||
|
<pre class="example">#include <stdio.h>
|
||
|
#include <mpfr.h>
|
||
|
int main (void)
|
||
|
{
|
||
|
printf ("MPFR library: %-12s\nMPFR header: %s (based on %d.%d.%d)\n",
|
||
|
mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR,
|
||
|
MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL);
|
||
|
return 0;
|
||
|
}
|
||
|
</pre></div>
|
||
|
|
||
|
<p>with
|
||
|
</p>
|
||
|
<div class="example">
|
||
|
<pre class="example">cc -o version version.c -lmpfr -lgmp
|
||
|
</pre></div>
|
||
|
|
||
|
<p>and if you get errors whose first line looks like
|
||
|
</p>
|
||
|
<div class="example">
|
||
|
<pre class="example">version.c:2:19: error: mpfr.h: No such file or directory
|
||
|
</pre></div>
|
||
|
|
||
|
<p>then MPFR is probably not installed. Running this program will give you
|
||
|
the MPFR version.
|
||
|
</p>
|
||
|
<p>If MPFR is not installed on your computer, or if you want to install a
|
||
|
different version, please follow the steps below.
|
||
|
</p>
|
||
|
<a name="How-to-Install"></a>
|
||
|
<h3 class="section">2.1 How to Install</h3>
|
||
|
|
||
|
<p>Here are the steps needed to install the library on Unix systems
|
||
|
(more details are provided in the <samp>INSTALL</samp> file):
|
||
|
</p>
|
||
|
<ol>
|
||
|
<li> To build MPFR, you first have to install GNU MP
|
||
|
(version 4.1 or higher) on your computer.
|
||
|
You need a C compiler, preferably GCC, but any reasonable compiler should
|
||
|
work. And you need the standard Unix ‘<samp>make</samp>’ command, plus some other
|
||
|
standard Unix utility commands.
|
||
|
|
||
|
<p>Then, in the MPFR build directory, type the following commands.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>./configure</samp>’
|
||
|
|
||
|
<p>This will prepare the build and setup the options according to your system.
|
||
|
You can give options to specify the install directories (instead of
|
||
|
the default <samp>/usr/local</samp>), threading support, and so on. See
|
||
|
the <samp>INSTALL</samp> file and/or the output of ‘<samp>./configure --help</samp>’
|
||
|
for more information, in particular if you get error messages.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>make</samp>’
|
||
|
|
||
|
<p>This will compile MPFR, and create a library archive file <samp>libmpfr.a</samp>.
|
||
|
On most platforms, a dynamic library will be produced too.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>make check</samp>’
|
||
|
|
||
|
<p>This will make sure that MPFR was built correctly.
|
||
|
If any test fails, information about this failure can be found in the
|
||
|
<samp>tests/test-suite.log</samp> file. If you want the contents of this file to
|
||
|
be automatically output in case of failure, you can set the ‘<samp>VERBOSE</samp>’
|
||
|
environment variable to 1 before running ‘<samp>make check</samp>’, for instance
|
||
|
by typing:
|
||
|
</p>
|
||
|
<p>‘<samp>VERBOSE=1 make check</samp>’
|
||
|
</p>
|
||
|
<p>In case of failure, you may want to check whether the problem is already
|
||
|
known. If not, please report this failure to the MPFR mailing-list
|
||
|
‘<samp>mpfr@inria.fr</samp>’. For details, See <a href="Reporting-Bugs.html#Reporting-Bugs">Reporting Bugs</a>.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>make install</samp>’
|
||
|
|
||
|
<p>This will copy the files <samp>mpfr.h</samp> and <samp>mpf2mpfr.h</samp> to the directory
|
||
|
<samp>/usr/local/include</samp>, the library files (<samp>libmpfr.a</samp> and possibly
|
||
|
others) to the directory <samp>/usr/local/lib</samp>, the file <samp>mpfr.info</samp>
|
||
|
to the directory <samp>/usr/local/share/info</samp>, and some other documentation
|
||
|
files to the directory <samp>/usr/local/share/doc/mpfr</samp> (or if you passed the
|
||
|
‘<samp>--prefix</samp>’ option to <samp>configure</samp>, using the prefix directory given
|
||
|
as argument to ‘<samp>--prefix</samp>’ instead of <samp>/usr/local</samp>).
|
||
|
</p></li></ol>
|
||
|
|
||
|
<a name="Other-_0060make_0027-Targets"></a>
|
||
|
<h3 class="section">2.2 Other ‘make’ Targets</h3>
|
||
|
|
||
|
<p>There are some other useful make targets:
|
||
|
</p>
|
||
|
<ul>
|
||
|
<li> ‘<samp>mpfr.info</samp>’ or ‘<samp>info</samp>’
|
||
|
|
||
|
<p>Create or update an info version of the manual, in <samp>mpfr.info</samp>.
|
||
|
</p>
|
||
|
<p>This file is already provided in the MPFR archives.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>mpfr.pdf</samp>’ or ‘<samp>pdf</samp>’
|
||
|
|
||
|
<p>Create a PDF version of the manual, in <samp>mpfr.pdf</samp>.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>mpfr.dvi</samp>’ or ‘<samp>dvi</samp>’
|
||
|
|
||
|
<p>Create a DVI version of the manual, in <samp>mpfr.dvi</samp>.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>mpfr.ps</samp>’ or ‘<samp>ps</samp>’
|
||
|
|
||
|
<p>Create a Postscript version of the manual, in <samp>mpfr.ps</samp>.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>mpfr.html</samp>’ or ‘<samp>html</samp>’
|
||
|
|
||
|
<p>Create a HTML version of the manual, in several pages in the directory
|
||
|
<samp>doc/mpfr.html</samp>; if you want only one output HTML file, then type
|
||
|
‘<samp>makeinfo --html --no-split mpfr.texi</samp>’ from the ‘<samp>doc</samp>’ directory
|
||
|
instead.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>clean</samp>’
|
||
|
|
||
|
<p>Delete all object files and archive files, but not the configuration files.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>distclean</samp>’
|
||
|
|
||
|
<p>Delete all generated files not included in the distribution.
|
||
|
</p>
|
||
|
</li><li> ‘<samp>uninstall</samp>’
|
||
|
|
||
|
<p>Delete all files copied by ‘<samp>make install</samp>’.
|
||
|
</p>
|
||
|
</li></ul>
|
||
|
|
||
|
|
||
|
<a name="Build-Problems"></a>
|
||
|
<h3 class="section">2.3 Build Problems</h3>
|
||
|
|
||
|
<p>In case of problem, please read the <samp>INSTALL</samp> file carefully
|
||
|
before reporting a bug, in particular section “In case of problem”.
|
||
|
Some problems are due to bad configuration on the user side (not
|
||
|
specific to MPFR). Problems are also mentioned in the FAQ
|
||
|
<a href="http://www.mpfr.org/faq.html">http://www.mpfr.org/faq.html</a>.
|
||
|
</p>
|
||
|
<p>Please report problems to the MPFR mailing-list ‘<samp>mpfr@inria.fr</samp>’.
|
||
|
See <a href="Reporting-Bugs.html#Reporting-Bugs">Reporting Bugs</a>.
|
||
|
Some bug fixes are available on the
|
||
|
MPFR 3.1.4 web page <a href="http://www.mpfr.org/mpfr-3.1.4/">http://www.mpfr.org/mpfr-3.1.4/</a>.
|
||
|
</p>
|
||
|
<a name="Getting-the-Latest-Version-of-MPFR"></a>
|
||
|
<h3 class="section">2.4 Getting the Latest Version of MPFR</h3>
|
||
|
|
||
|
<p>The latest version of MPFR is available from
|
||
|
<a href="ftp://ftp.gnu.org/gnu/mpfr/">ftp://ftp.gnu.org/gnu/mpfr/</a> or <a href="http://www.mpfr.org/">http://www.mpfr.org/</a>.
|
||
|
</p>
|
||
|
<hr>
|
||
|
<div class="header">
|
||
|
<p>
|
||
|
Next: <a href="Reporting-Bugs.html#Reporting-Bugs" accesskey="n" rel="next">Reporting Bugs</a>, Previous: <a href="Introduction-to-MPFR.html#Introduction-to-MPFR" accesskey="p" rel="prev">Introduction to MPFR</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|