Patchwork adjust installation docs to discourage installing GMP, MPFR and MPC separately

login
register
mail settings
Submitter Jonathan Wakely
Date Dec. 22, 2011, 12:23 a.m.
Message ID <CAH6eHdRs+7KEORPREf6kcR0bMn-EPq-g6v68k3=+x+Qjq-qKTg@mail.gmail.com>
Download mbox | patch
Permalink /patch/132762/
State New
Headers show

Comments

Jonathan Wakely - Dec. 22, 2011, 12:23 a.m.
The most frequently asked question on gcc-help, and a frequently
reported "bug" in bugzilla, is
http://gcc.gnu.org/wiki/FAQ#configure_suffix

It is almost always caused by installing libgmp.so etc. in a
non-standard location and not using ldconfig, DT_RUNPATH,
$LD_LIBRARY_PATH or some other method to tell the dynamic linker how
to find them.  The current installation docs mention --with-gmp right
away, which probably gives the impression that it's the recommended
method, whereas it actually causes problems for the majority of users
who don't understand dynamic linker search paths.  I think rewording
the installation docs to suggest building the support libs as part of
GCC first, and only using --with-gmp second, might steer people in the
right direction.

Separately, I also plan to write an "Installing GCC" page on the GCC
wiki which (among other things) discourages installing the support
libraries by hand, recommending installing prebuilt packages in
standard system dirs instead, or if that's not an option then using
contrib/download_prerequisites to get the sources and build them
in-tree.


        * doc/install.text (Prerequisites): Suggest building GMP, MPFR and
        MPC as part of GCC before describing configuring with --with-gmp etc.

Tested by running "make doc" and viewing the resulting .info pages, OK
for trunk?
Joseph S. Myers - Dec. 22, 2011, 12:36 a.m.
On Thu, 22 Dec 2011, Jonathan Wakely wrote:

> It is almost always caused by installing libgmp.so etc. in a
> non-standard location and not using ldconfig, DT_RUNPATH,
> $LD_LIBRARY_PATH or some other method to tell the dynamic linker how
> to find them.  The current installation docs mention --with-gmp right

And for the normal case where $build and $host are the same (i.e. not a 
Canadian cross) it should be possible to build and try running a program 
using those libraries, maybe even one that checks the version is the same 
as in the library headers, at an early point in configure, so giving a 
meaningful error if someone is using previously installed libraries 
without proper dynamic linker configuration.

(That's not an argument against your patch; we should improve the 
documentation as well as adding better detection of this common problem.)
Jonathan Wakely - Dec. 22, 2011, 12:40 a.m.
On 22 December 2011 00:36, Joseph S. Myers wrote:
> On Thu, 22 Dec 2011, Jonathan Wakely wrote:
>
>> It is almost always caused by installing libgmp.so etc. in a
>> non-standard location and not using ldconfig, DT_RUNPATH,
>> $LD_LIBRARY_PATH or some other method to tell the dynamic linker how
>> to find them.  The current installation docs mention --with-gmp right
>
> And for the normal case where $build and $host are the same (i.e. not a
> Canadian cross) it should be possible to build and try running a program
> using those libraries, maybe even one that checks the version is the same
> as in the library headers, at an early point in configure, so giving a
> meaningful error if someone is using previously installed libraries
> without proper dynamic linker configuration.
>
> (That's not an argument against your patch; we should improve the
> documentation as well as adding better detection of this common problem.)

Yes, better detection of the problem and a more meaningful error
message would help significantly, but doing that is beyond my autoconf
skills.
Jonathan Wakely - Dec. 22, 2011, 4:21 p.m.
Here's the new wiki page I've started:
http://gcc.gnu.org/wiki/InstallingGCC

Patch

Index: doc/install.texi
===================================================================
--- doc/install.texi	(revision 182452)
+++ doc/install.texi	(working copy)
@@ -333,32 +333,35 @@  newer versions, though.
 @table @asis
 @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
 
-Necessary to build GCC@.  If you do not have it installed in your
+Necessary to build GCC@.  If a GMP source distribution is found in a
+subdirectory of your GCC sources named @file{gmp}, it will be built
+together with GCC, this avoids the need to build GMP separately.
+Alternatively, if GMP is already installed but it is not in your
 library search path, you will have to configure with the
 @option{--with-gmp} configure option.  See also @option{--with-gmp-lib}
-and @option{--with-gmp-include}.  Alternatively, if a GMP source
-distribution is found in a subdirectory of your GCC sources named
-@file{gmp}, it will be built together with GCC@.
+and @option{--with-gmp-include}.
 
 @item MPFR Library version 2.4.2 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
-@uref{http://www.mpfr.org/}.  The @option{--with-mpfr} configure
-option should be used if your MPFR Library is not installed in your
-default library search path.  See also @option{--with-mpfr-lib} and
-@option{--with-mpfr-include}.  Alternatively, if a MPFR source
-distribution is found in a subdirectory of your GCC sources named
-@file{mpfr}, it will be built together with GCC@.
+@uref{http://www.mpfr.org/}.  If an MPFR source distribution is found
+in a subdirectory of your GCC sources named @file{mpfr}, it will be
+built together with GCC, this avoids the need to build MPFR separately.
+Alternatively, if MPFR is already installed but it is not in your
+default library search path, the @option{--with-mpfr} configure
+option should be used.  See also @option{--with-mpfr-lib} and
+@option{--with-mpfr-include}.
 
 @item MPC Library version 0.8.1 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
-@uref{http://www.multiprecision.org/}.  The @option{--with-mpc}
-configure option should be used if your MPC Library is not installed
-in your default library search path.  See also @option{--with-mpc-lib}
-and @option{--with-mpc-include}.  Alternatively, if an MPC source
-distribution is found in a subdirectory of your GCC sources named
-@file{mpc}, it will be built together with GCC@.
+@uref{http://www.multiprecision.org/}.  If an MPC source distribution
+is found in a subdirectory of your GCC sources named @file{mpc}, it
+will be built together with GCC, this avoids the need to build MPC
+separately.  Alternatively, if MPC is already installed but it is
+not in your default library search path, the @option{--with-mpc}
+configure option should be used.  See also @option{--with-mpc-lib}
+and @option{--with-mpc-include}.
 
 @item Parma Polyhedra Library (PPL) version 0.11