public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]: Require MPC for building GCC
@ 2009-11-15 10:25 Kaveh R. GHAZI
  2009-11-15 14:37 ` Richard Guenther
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Kaveh R. GHAZI @ 2009-11-15 10:25 UTC (permalink / raw)
  To: gcc-patches

This patch makes the MPC library a hard-requirement for building GCC.

We've had successful build and "make check" reports of MPC for all the
primary and secondary GCC host platforms as well as dozens of "tertiary"
systems.

The MPC sources have been uploaded to the GCC infrastructure dir:
ftp://gcc.gnu.org/pub/gcc/infrastructure/.

This patch relies on a previous one to bump the mpc verison number.
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00297.html

I've verified that, with this patch, the configure script (correctly)
aborts if MPC is not found or if the version is not recent enough.  I
also did three bootstraps on x86_64-unknown-linux-gnu, one with mpc
installed and found via --with-mpc=, one with mpc (only) in-tree, and
one with gmp, mpfr, and mpc all in-tree.  All three configurations
bootstrapped successfully and had no regressions.

I'll wait one week after approval before installing this so that anyone
without the library can get it installed.  (The version bump patch should
go in as soon as it's approved.)

Okay for mainline (along with the previous version bump patch)?

		Thanks,
		--Kaveh


2009-11-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* configure.ac: Require MPC.
	* configure: Regenerate.
gcc:
	* doc/install.texi: Document MPC is required.

diff -rup orig/egcc-SVN20091114/configure.ac egcc-SVN20091114/configure.ac
--- orig/egcc-SVN20091114/configure.ac	2009-11-14 18:53:01.000000000 +0100
+++ egcc-SVN20091114/configure.ac	2009-11-14 19:09:47.000000000 +0100
@@ -1228,12 +1228,9 @@ ENABLE_BUILD_WITH_CXX=$enableval,
 ENABLE_BUILD_WITH_CXX=no)

 # Check for GMP, MPFR and MPC
-gmplibs="-lmpfr -lgmp"
+gmplibs="-lmpc -lmpfr -lgmp"
 gmpinc=
 have_gmp=no
-mpclibs=-lmpc
-mpcinc=
-have_mpc=no

 # Specify a location for mpc
 # check for this first so it ends up on the link line before mpfr.
@@ -1245,23 +1242,23 @@ AC_ARG_WITH(mpc_include, [  --with-mpc-i
 AC_ARG_WITH(mpc_lib, [  --with-mpc-lib=PATH    specify directory for the installed MPC library])

 if test "x$with_mpc" != x; then
-  mpclibs="-L$with_mpc/lib -lmpc"
-  mpcinc="-I$with_mpc/include $mpcinc"
+  gmplibs="-L$with_mpc/lib $gmplibs"
+  gmpinc="-I$with_mpc/include $gmpinc"
 fi
 if test "x$with_mpc_include" != x; then
-  mpcinc="-I$with_mpc_include $mpcinc"
+  gmpinc="-I$with_mpc_include $gmpinc"
 fi
 if test "x$with_mpc_lib" != x; then
-  mpclibs="-L$with_mpc_lib -lmpc"
+  gmplibs="-L$with_mpc_lib $gmplibs"
 fi
 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
-  mpclibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs -lmpc'
-  mpcinc='-I$$s/mpc/src '"$mpcinc"
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs '"$gmplibs"
+  gmpinc='-I$$s/mpc/src '"$gmpinc"
   # Do not test the mpc version.  Assume that it is sufficient, since
   # it is in the source tree, and the library has not been built yet
   # but it would be included on the link line in the version check below
   # hence making the test fail.
-  have_mpc=yes
+  have_gmp=yes
 fi

 # Specify a location for mpfr
@@ -1279,10 +1276,10 @@ AC_ARG_WITH(mpfr_lib, [  --with-mpfr-lib

 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
-  gmpinc="-I$with_mpfr/include"
+  gmpinc="-I$with_mpfr/include $gmpinc"
 fi
 if test "x$with_mpfr_include" != x; then
-  gmpinc="-I$with_mpfr_include"
+  gmpinc="-I$with_mpfr_include $gmpinc"
 fi
 if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
@@ -1363,86 +1360,57 @@ if test -d ${srcdir}/gcc && test "x$have
   fi

   # Check for the MPC header version.
-  if test x"$have_mpc" != xyes ; then
-    CFLAGS="$CFLAGS $mpcinc"
+  if test x"$have_gmp" = xyes ; then
     AC_MSG_CHECKING([for the correct version of mpc.h])
     AC_TRY_COMPILE([#include <mpc.h>],[
     #if MPC_VERSION < MPC_VERSION_NUM (0,8,0)
     choke me
     #endif
-    ], [AC_MSG_RESULT([yes]); have_mpc=maybe],
-       [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
+    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
   fi

   # Now check the MPFR library.
   if test x"$have_gmp" = xyes; then
     saved_LIBS="$LIBS"
     LIBS="$LIBS $gmplibs"
-    AC_MSG_CHECKING([for the correct version of the gmp/mpfr libraries])
-    AC_TRY_LINK([#include <gmp.h>
-    #include <mpfr.h>],[
+    AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
+    AC_TRY_LINK([#include <mpc.h>],[
     mpfr_t n;
     mpfr_t x;
+    mpc_t c;
     int t;
     mpfr_init (n);
     mpfr_init (x);
     mpfr_atan2 (n, n, x, GMP_RNDN);
     mpfr_erfc (n, x, GMP_RNDN);
     mpfr_subnormalize (x, t, GMP_RNDN);
+    mpfr_clear(n);
+    mpfr_clear(x);
+    mpc_init2 (c, 53);
+    mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
+    mpc_cosh (c, c, MPC_RNDNN);
+    mpc_pow (c, c, c, MPC_RNDNN);
+    mpc_acosh (c, c, MPC_RNDNN);
+    mpc_clear (c);
     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
     LIBS="$saved_LIBS"
   fi

-  if test x"$have_mpc" = xmaybe; then
-    saved_LIBS="$LIBS"
-    LIBS="$LIBS $mpclibs $gmplibs"
-    AC_MSG_CHECKING([for the correct version of the mpc library])
-    AC_TRY_LINK([#include <mpc.h>],[
-    mpc_t n;
-    mpc_init2 (n, 53);
-    mpc_set_ui_ui (n, 1, 1, MPC_RNDNN);
-    mpc_sin (n, n, MPC_RNDNN);
-    mpc_cos (n, n, MPC_RNDNN);
-    mpc_tan (n, n, MPC_RNDNN);
-    mpc_sinh (n, n, MPC_RNDNN);
-    mpc_cosh (n, n, MPC_RNDNN);
-    mpc_tanh (n, n, MPC_RNDNN);
-    mpc_exp (n, n, MPC_RNDNN);
-    mpc_log (n, n, MPC_RNDNN);
-    mpc_sqrt (n, n, MPC_RNDNN);
-    mpc_proj (n, n, MPC_RNDNN);
-    mpc_neg (n, n, MPC_RNDNN);
-    mpc_sqr (n, n, MPC_RNDNN);
-    mpc_pow (n, n, n, MPC_RNDNN);
-    mpc_acosh (n, n, MPC_RNDNN);
-    mpc_clear (n);
-    ], [AC_MSG_RESULT([yes]); have_mpc=yes],
-       [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
-    LIBS="$saved_LIBS"
-  fi
-
   CFLAGS="$saved_CFLAGS"

   if test x$have_gmp != xyes; then
-    AC_MSG_ERROR([Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
-Try the --with-gmp and/or --with-mpfr options to specify their locations.
-Copies of these libraries' source code can be found at their respective
-hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
-See also http://gcc.gnu.org/install/prerequisites.html for additional info.
-If you obtained GMP and/or MPFR from a vendor distribution package, make
-sure that you have installed both the libraries and the header files.
-They may be located in separate packages.])
+    AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
+Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
+their locations.  Source code for these libraries can be found at
+their respective hosting sites as well as at
+ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
+http://gcc.gnu.org/install/prerequisites.html for additional info.  If
+you obtained GMP, MPFR and/or MPC from a vendor distribution package,
+make sure that you have installed both the libraries and the header
+files.  They may be located in separate packages.])
   fi
 fi

-if test x$have_mpc != xyes ; then
-  mpcinc=
-  mpclibs=
-fi
-
-gmpinc="$mpcinc $gmpinc"
-gmplibs="$mpclibs $gmplibs"
-
 # Flags needed for both GMP, MPFR and/or MPC.
 AC_SUBST(gmplibs)
 AC_SUBST(gmpinc)
diff -rup orig/egcc-SVN20091114/gcc/doc/install.texi egcc-SVN20091114/gcc/doc/install.texi
--- orig/egcc-SVN20091114/gcc/doc/install.texi	2009-11-14 18:53:01.000000000 +0100
+++ egcc-SVN20091114/gcc/doc/install.texi	2009-11-14 19:23:27.000000000 +0100
@@ -321,6 +321,16 @@ default library search path.  See also @
 distribution is found in a subdirectory of your GCC sources named
 @file{mpfr}, it will be built together with GCC@.

+@item MPC Library version 0.8.0 (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@.
+
 @item Parma Polyhedra Library (PPL) version 0.10

 Necessary to build GCC with the Graphite loop optimizations.
@@ -344,18 +354,6 @@ not installed in your default library se

 Necessary to build libgcj, the GCJ runtime.

-@item MPC Library version 0.8.0 (or later)
-
-Optional when building GCC@.  Having this library will enable
-additional optimizations on complex numbers.  It can be downloaded
-from @uref{http://www.multiprecision.org/mpc/}.  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@.
-
 @item libelf version 0.8.12 (or later)

 Necessary to build link-time optimization (LTO) support.  It can be

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH]: Require MPC for building GCC
  2009-11-15 10:25 [PATCH]: Require MPC for building GCC Kaveh R. GHAZI
@ 2009-11-15 14:37 ` Richard Guenther
  2009-11-15 16:43   ` Kaveh R. Ghazi
  2009-11-22 11:42 ` [PING]: (build machinery) " Kaveh R. GHAZI
  2009-12-06 18:47 ` [PATCH]: " Hans-Peter Nilsson
  2 siblings, 1 reply; 10+ messages in thread
From: Richard Guenther @ 2009-11-15 14:37 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches

On Sat, Nov 14, 2009 at 8:07 PM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> This patch makes the MPC library a hard-requirement for building GCC.
>
> We've had successful build and "make check" reports of MPC for all the
> primary and secondary GCC host platforms as well as dozens of "tertiary"
> systems.
>
> The MPC sources have been uploaded to the GCC infrastructure dir:
> ftp://gcc.gnu.org/pub/gcc/infrastructure/.
>
> This patch relies on a previous one to bump the mpc verison number.
> http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00297.html
>
> I've verified that, with this patch, the configure script (correctly)
> aborts if MPC is not found or if the version is not recent enough.  I
> also did three bootstraps on x86_64-unknown-linux-gnu, one with mpc
> installed and found via --with-mpc=, one with mpc (only) in-tree, and
> one with gmp, mpfr, and mpc all in-tree.  All three configurations
> bootstrapped successfully and had no regressions.
>
> I'll wait one week after approval before installing this so that anyone
> without the library can get it installed.  (The version bump patch should
> go in as soon as it's approved.)
>
> Okay for mainline (along with the previous version bump patch)?

Ok from a release manager perspective, please make sure the 0.8 tarball
is available from the infrastructure directory on our ftp.  You still need
approval from a build system maintainer.

If not already done please add a note about the extra build requirement
to gcc-4.5/changes.html.

Thanks,
Richard.

>                Thanks,
>                --Kaveh
>
>
> 2009-11-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
>
>        * configure.ac: Require MPC.
>        * configure: Regenerate.
> gcc:
>        * doc/install.texi: Document MPC is required.
>
> diff -rup orig/egcc-SVN20091114/configure.ac egcc-SVN20091114/configure.ac
> --- orig/egcc-SVN20091114/configure.ac  2009-11-14 18:53:01.000000000 +0100
> +++ egcc-SVN20091114/configure.ac       2009-11-14 19:09:47.000000000 +0100
> @@ -1228,12 +1228,9 @@ ENABLE_BUILD_WITH_CXX=$enableval,
>  ENABLE_BUILD_WITH_CXX=no)
>
>  # Check for GMP, MPFR and MPC
> -gmplibs="-lmpfr -lgmp"
> +gmplibs="-lmpc -lmpfr -lgmp"
>  gmpinc=
>  have_gmp=no
> -mpclibs=-lmpc
> -mpcinc=
> -have_mpc=no
>
>  # Specify a location for mpc
>  # check for this first so it ends up on the link line before mpfr.
> @@ -1245,23 +1242,23 @@ AC_ARG_WITH(mpc_include, [  --with-mpc-i
>  AC_ARG_WITH(mpc_lib, [  --with-mpc-lib=PATH    specify directory for the installed MPC library])
>
>  if test "x$with_mpc" != x; then
> -  mpclibs="-L$with_mpc/lib -lmpc"
> -  mpcinc="-I$with_mpc/include $mpcinc"
> +  gmplibs="-L$with_mpc/lib $gmplibs"
> +  gmpinc="-I$with_mpc/include $gmpinc"
>  fi
>  if test "x$with_mpc_include" != x; then
> -  mpcinc="-I$with_mpc_include $mpcinc"
> +  gmpinc="-I$with_mpc_include $gmpinc"
>  fi
>  if test "x$with_mpc_lib" != x; then
> -  mpclibs="-L$with_mpc_lib -lmpc"
> +  gmplibs="-L$with_mpc_lib $gmplibs"
>  fi
>  if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
> -  mpclibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs -lmpc'
> -  mpcinc='-I$$s/mpc/src '"$mpcinc"
> +  gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs '"$gmplibs"
> +  gmpinc='-I$$s/mpc/src '"$gmpinc"
>   # Do not test the mpc version.  Assume that it is sufficient, since
>   # it is in the source tree, and the library has not been built yet
>   # but it would be included on the link line in the version check below
>   # hence making the test fail.
> -  have_mpc=yes
> +  have_gmp=yes
>  fi
>
>  # Specify a location for mpfr
> @@ -1279,10 +1276,10 @@ AC_ARG_WITH(mpfr_lib, [  --with-mpfr-lib
>
>  if test "x$with_mpfr" != x; then
>   gmplibs="-L$with_mpfr/lib $gmplibs"
> -  gmpinc="-I$with_mpfr/include"
> +  gmpinc="-I$with_mpfr/include $gmpinc"
>  fi
>  if test "x$with_mpfr_include" != x; then
> -  gmpinc="-I$with_mpfr_include"
> +  gmpinc="-I$with_mpfr_include $gmpinc"
>  fi
>  if test "x$with_mpfr_lib" != x; then
>   gmplibs="-L$with_mpfr_lib $gmplibs"
> @@ -1363,86 +1360,57 @@ if test -d ${srcdir}/gcc && test "x$have
>   fi
>
>   # Check for the MPC header version.
> -  if test x"$have_mpc" != xyes ; then
> -    CFLAGS="$CFLAGS $mpcinc"
> +  if test x"$have_gmp" = xyes ; then
>     AC_MSG_CHECKING([for the correct version of mpc.h])
>     AC_TRY_COMPILE([#include <mpc.h>],[
>     #if MPC_VERSION < MPC_VERSION_NUM (0,8,0)
>     choke me
>     #endif
> -    ], [AC_MSG_RESULT([yes]); have_mpc=maybe],
> -       [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
> +    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
>   fi
>
>   # Now check the MPFR library.
>   if test x"$have_gmp" = xyes; then
>     saved_LIBS="$LIBS"
>     LIBS="$LIBS $gmplibs"
> -    AC_MSG_CHECKING([for the correct version of the gmp/mpfr libraries])
> -    AC_TRY_LINK([#include <gmp.h>
> -    #include <mpfr.h>],[
> +    AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
> +    AC_TRY_LINK([#include <mpc.h>],[
>     mpfr_t n;
>     mpfr_t x;
> +    mpc_t c;
>     int t;
>     mpfr_init (n);
>     mpfr_init (x);
>     mpfr_atan2 (n, n, x, GMP_RNDN);
>     mpfr_erfc (n, x, GMP_RNDN);
>     mpfr_subnormalize (x, t, GMP_RNDN);
> +    mpfr_clear(n);
> +    mpfr_clear(x);
> +    mpc_init2 (c, 53);
> +    mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
> +    mpc_cosh (c, c, MPC_RNDNN);
> +    mpc_pow (c, c, c, MPC_RNDNN);
> +    mpc_acosh (c, c, MPC_RNDNN);
> +    mpc_clear (c);
>     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
>     LIBS="$saved_LIBS"
>   fi
>
> -  if test x"$have_mpc" = xmaybe; then
> -    saved_LIBS="$LIBS"
> -    LIBS="$LIBS $mpclibs $gmplibs"
> -    AC_MSG_CHECKING([for the correct version of the mpc library])
> -    AC_TRY_LINK([#include <mpc.h>],[
> -    mpc_t n;
> -    mpc_init2 (n, 53);
> -    mpc_set_ui_ui (n, 1, 1, MPC_RNDNN);
> -    mpc_sin (n, n, MPC_RNDNN);
> -    mpc_cos (n, n, MPC_RNDNN);
> -    mpc_tan (n, n, MPC_RNDNN);
> -    mpc_sinh (n, n, MPC_RNDNN);
> -    mpc_cosh (n, n, MPC_RNDNN);
> -    mpc_tanh (n, n, MPC_RNDNN);
> -    mpc_exp (n, n, MPC_RNDNN);
> -    mpc_log (n, n, MPC_RNDNN);
> -    mpc_sqrt (n, n, MPC_RNDNN);
> -    mpc_proj (n, n, MPC_RNDNN);
> -    mpc_neg (n, n, MPC_RNDNN);
> -    mpc_sqr (n, n, MPC_RNDNN);
> -    mpc_pow (n, n, n, MPC_RNDNN);
> -    mpc_acosh (n, n, MPC_RNDNN);
> -    mpc_clear (n);
> -    ], [AC_MSG_RESULT([yes]); have_mpc=yes],
> -       [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
> -    LIBS="$saved_LIBS"
> -  fi
> -
>   CFLAGS="$saved_CFLAGS"
>
>   if test x$have_gmp != xyes; then
> -    AC_MSG_ERROR([Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
> -Try the --with-gmp and/or --with-mpfr options to specify their locations.
> -Copies of these libraries' source code can be found at their respective
> -hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
> -See also http://gcc.gnu.org/install/prerequisites.html for additional info.
> -If you obtained GMP and/or MPFR from a vendor distribution package, make
> -sure that you have installed both the libraries and the header files.
> -They may be located in separate packages.])
> +    AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
> +Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
> +their locations.  Source code for these libraries can be found at
> +their respective hosting sites as well as at
> +ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
> +http://gcc.gnu.org/install/prerequisites.html for additional info.  If
> +you obtained GMP, MPFR and/or MPC from a vendor distribution package,
> +make sure that you have installed both the libraries and the header
> +files.  They may be located in separate packages.])
>   fi
>  fi
>
> -if test x$have_mpc != xyes ; then
> -  mpcinc=
> -  mpclibs=
> -fi
> -
> -gmpinc="$mpcinc $gmpinc"
> -gmplibs="$mpclibs $gmplibs"
> -
>  # Flags needed for both GMP, MPFR and/or MPC.
>  AC_SUBST(gmplibs)
>  AC_SUBST(gmpinc)
> diff -rup orig/egcc-SVN20091114/gcc/doc/install.texi egcc-SVN20091114/gcc/doc/install.texi
> --- orig/egcc-SVN20091114/gcc/doc/install.texi  2009-11-14 18:53:01.000000000 +0100
> +++ egcc-SVN20091114/gcc/doc/install.texi       2009-11-14 19:23:27.000000000 +0100
> @@ -321,6 +321,16 @@ default library search path.  See also @
>  distribution is found in a subdirectory of your GCC sources named
>  @file{mpfr}, it will be built together with GCC@.
>
> +@item MPC Library version 0.8.0 (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@.
> +
>  @item Parma Polyhedra Library (PPL) version 0.10
>
>  Necessary to build GCC with the Graphite loop optimizations.
> @@ -344,18 +354,6 @@ not installed in your default library se
>
>  Necessary to build libgcj, the GCJ runtime.
>
> -@item MPC Library version 0.8.0 (or later)
> -
> -Optional when building GCC@.  Having this library will enable
> -additional optimizations on complex numbers.  It can be downloaded
> -from @uref{http://www.multiprecision.org/mpc/}.  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@.
> -
>  @item libelf version 0.8.12 (or later)
>
>  Necessary to build link-time optimization (LTO) support.  It can be
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH]: Require MPC for building GCC
  2009-11-15 14:37 ` Richard Guenther
@ 2009-11-15 16:43   ` Kaveh R. Ghazi
  0 siblings, 0 replies; 10+ messages in thread
From: Kaveh R. Ghazi @ 2009-11-15 16:43 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

From: "Richard Guenther" <richard.guenther@gmail.com>

>On Sat, Nov 14, 2009 at 8:07 PM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> 
>wrote:
>> This patch makes the MPC library a hard-requirement for building GCC.
>>
>> [...]
>> The MPC sources have been uploaded to the GCC infrastructure dir:
>> ftp://gcc.gnu.org/pub/gcc/infrastructure/.
>
>Ok from a release manager perspective, please make sure the 0.8 tarball
>is available from the infrastructure directory on our ftp.  You still need
>approval from a build system maintainer.

Ok... done. ;-)

>
>If not already done please add a note about the extra build requirement
>to gcc-4.5/changes.html.

Yup, on my list to do.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40302#c2

I'll be submitting several patches shortly to take care of the cleanup and 
docs noted in the PR.

        --Kaveh

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PING]: (build machinery) Require MPC for building GCC
  2009-11-15 10:25 [PATCH]: Require MPC for building GCC Kaveh R. GHAZI
  2009-11-15 14:37 ` Richard Guenther
@ 2009-11-22 11:42 ` Kaveh R. GHAZI
  2009-11-28 14:55   ` [PING x2]: " Kaveh R. GHAZI
  2009-12-06 18:47 ` [PATCH]: " Hans-Peter Nilsson
  2 siblings, 1 reply; 10+ messages in thread
From: Kaveh R. GHAZI @ 2009-11-22 11:42 UTC (permalink / raw)
  To: gcc-patches

On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:

> 2009-11-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
>
> 	* configure.ac: Require MPC.
> 	* configure: Regenerate.
> gcc:
> 	* doc/install.texi: Document MPC is required.
>

Ping: http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00731.html

		Thanks,
		--Kaveh

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PING x2]: (build machinery) Require MPC for building GCC
  2009-11-22 11:42 ` [PING]: (build machinery) " Kaveh R. GHAZI
@ 2009-11-28 14:55   ` Kaveh R. GHAZI
  2009-11-30  5:41     ` Alexandre Oliva
  2009-11-30  7:33     ` Paolo Bonzini
  0 siblings, 2 replies; 10+ messages in thread
From: Kaveh R. GHAZI @ 2009-11-28 14:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: bonzini, dj, neroden, aoliva

On Sun, 22 Nov 2009, Kaveh R. GHAZI wrote:

> On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
>
> > 2009-11-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
> >
> > 	* configure.ac: Require MPC.
> > 	* configure: Regenerate.
> > gcc:
> > 	* doc/install.texi: Document MPC is required.
> >

Hi,

Ping x2: http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00731.html

I still need a build machinery maintainer to review this patch.  It's
already been approved by a release manager, and I want to get it installed
before we branch for gcc-4.5.

		Thanks,
		--Kaveh

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING x2]: (build machinery) Require MPC for building GCC
  2009-11-28 14:55   ` [PING x2]: " Kaveh R. GHAZI
@ 2009-11-30  5:41     ` Alexandre Oliva
  2009-11-30 16:29       ` Kaveh R. Ghazi
  2009-11-30  7:33     ` Paolo Bonzini
  1 sibling, 1 reply; 10+ messages in thread
From: Alexandre Oliva @ 2009-11-30  5:41 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches, bonzini, dj, neroden

On Nov 28, 2009, "Kaveh R. GHAZI" <ghazi@caip.rutgers.edu> wrote:

> On Sun, 22 Nov 2009, Kaveh R. GHAZI wrote:
>> On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
>> 
>> > 2009-11-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
>> >
>> > 	* configure.ac: Require MPC.
>> > 	* configure: Regenerate.
>> > gcc:
>> > 	* doc/install.texi: Document MPC is required.

> Ping x2: http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00731.html

> I still need a build machinery maintainer to review this patch.

Sorry about the delay.  The patch is ok, although it got me to realize
we have a potential problem.

I was a bit puzzled at the apparent use of the same LIBS to build all of
gmp, mpc, mpfr et al, which would most likely fail on systems without a
base library already installed.

Now I see that gmplibs and gmpinc are only used to build GCC itself, and
the flags passed to mpfr's and mpc's configure scripts are set up in
portions of configure.ac that don't appear in the patch.

Those portions are ok, but it seems to me that we'd still fail to
configure or build mpfr in-tree using a pre-compiled gmp: specifying
--with-gmp, --with-gmp-include or --with-gmp-lib has no effect
whatsoever on mpc's and mpfr's configuration, which may be unexpected,
but that's not something newly-introduced in your patch.

Feel free to go ahead and check it in.

Thanks,

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING x2]: (build machinery) Require MPC for building GCC
  2009-11-28 14:55   ` [PING x2]: " Kaveh R. GHAZI
  2009-11-30  5:41     ` Alexandre Oliva
@ 2009-11-30  7:33     ` Paolo Bonzini
  1 sibling, 0 replies; 10+ messages in thread
From: Paolo Bonzini @ 2009-11-30  7:33 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches, dj, neroden, aoliva

On 11/28/2009 03:34 PM, Kaveh R. GHAZI wrote:
> On Sun, 22 Nov 2009, Kaveh R. GHAZI wrote:
>
>> On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
>>
>>> 2009-11-14  Kaveh R. Ghazi<ghazi@caip.rutgers.edu>
>>>
>>> 	* configure.ac: Require MPC.
>>> 	* configure: Regenerate.
>>> gcc:
>>> 	* doc/install.texi: Document MPC is required.
>>>
>
> Hi,
>
> Ping x2: http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00731.html
>
> I still need a build machinery maintainer to review this patch.  It's
> already been approved by a release manager, and I want to get it installed
> before we branch for gcc-4.5.

Ok.

Paolo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING x2]: (build machinery) Require MPC for building GCC
  2009-11-30  5:41     ` Alexandre Oliva
@ 2009-11-30 16:29       ` Kaveh R. Ghazi
  0 siblings, 0 replies; 10+ messages in thread
From: Kaveh R. Ghazi @ 2009-11-30 16:29 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-patches, bonzini, dj, neroden

From: "Alexandre Oliva" <aoliva@redhat.com>

> Those portions are ok, but it seems to me that we'd still fail to
> configure or build mpfr in-tree using a pre-compiled gmp: specifying
> --with-gmp, --with-gmp-include or --with-gmp-lib has no effect
> whatsoever on mpc's and mpfr's configuration, which may be unexpected,
> but that's not something newly-introduced in your patch.

My understanding is that mpfr and mpc honor the --with-gmp* flags which get 
passed down by the top-level configure to the in-tree packages.

The systems I have access to already have gmp in /usr as well as /opt/cfarm. 
I tried a GCC bootstrap with an in-tree mpfr 
using --with-gmp=/opt/cfarm/gmp-4.2.4 and looked at the output to see what 
happened to mpfr.  It seemed to get the appropriate -I flag to pick up the 
right headers.  But because there's also a /usr copy I can't be sure it 
would have worked without it.  At what step exactly did you expect it to 
fail?


>
> Feel free to go ahead and check it in.

Thanks for reviewing.  I installed the mpc verison bump, and I'll checkin 
the hard-requirement after one week so everyone can get mpc on their 
systems.

        Thanks,
        --Kaveh

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH]: Require MPC for building GCC
  2009-11-15 10:25 [PATCH]: Require MPC for building GCC Kaveh R. GHAZI
  2009-11-15 14:37 ` Richard Guenther
  2009-11-22 11:42 ` [PING]: (build machinery) " Kaveh R. GHAZI
@ 2009-12-06 18:47 ` Hans-Peter Nilsson
  2009-12-06 20:26   ` Kaveh R. Ghazi
  2 siblings, 1 reply; 10+ messages in thread
From: Hans-Peter Nilsson @ 2009-12-06 18:47 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches

On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
> I've verified that, with this patch, the configure script (correctly)
> aborts if MPC is not found or if the version is not recent enough.  I
> also did three bootstraps on x86_64-unknown-linux-gnu, one with mpc
> installed and found via --with-mpc=, one with mpc (only) in-tree, and
> one with gmp, mpfr, and mpc all in-tree.

But I presume not one with *just* gmp and mpfr in-tree and no
mpc, as is IMHO a reasonable situation before the mpc requirement.

>  All three configurations
> bootstrapped successfully and had no regressions.

Despite the good efforts, I didn't see the nice error message,
just the less graceful:

...
gcc -c  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing\
-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-styl\
e-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I/tmp/hpautotest-gcc1/gcc/gcc -I/tmp/hpautotest-gcc1/gc\
c/gcc/. -I/tmp/hpautotest-gcc1/gcc/gcc/../include -I/tmp/hpautotest-gcc1/gcc/gcc/../libcpp/include -I/tmp/hpautotest-gc\
c1/cris-elf/gccobj/./gmp -I/tmp/hpautotest-gcc1/gcc/gmp -I/tmp/hpautotest-gcc1/cris-elf/gccobj/./mpfr -I/tmp/hpautotest\
-gcc1/gcc/mpfr  -I/tmp/hpautotest-gcc1/gcc/gcc/../libdecnumber -I/tmp/hpautotest-gcc1/gcc/gcc/../libdecnumber/dpd -I../\
libdecnumber     /tmp/hpautotest-gcc1/gcc/gcc/attribs.c -o attribs.o
In file included from /tmp/hpautotest-gcc1/gcc/gcc/flags.h:27,
                 from /tmp/hpautotest-gcc1/gcc/gcc/attribs.c:26:
/tmp/hpautotest-gcc1/gcc/gcc/real.h:28:17: error: mpc.h: No such file or directory
In file included from /tmp/hpautotest-gcc1/gcc/gcc/flags.h:27,
                 from /tmp/hpautotest-gcc1/gcc/gcc/attribs.c:26:
/tmp/hpautotest-gcc1/gcc/gcc/real.h:30: error: expected declaration specifiers or '...' before 'mpc_ptr'
(etc. elided)
make[2]: *** [attribs.o] Error 1
make[2]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/gcc'

This with gmp and mpfc in-tree, no mpc anywhere, r155023,
--target=cris-elf.

(Yeah, I know, I'm just reporting on the lack of graceful error
message.)  I can send you the log if you like.  No match for
"mpc" in there, looks like the mpc test didn't happen.

...oh, I see, I think you need to change the
   if test x$have_gmp != xyes; then
into
   if test x$have_gmp != xyes || test x$have_mpc != xyes || test x$have_mpfr != xyes; then
or something to that effect, right before the AC_MSG_ERROR.

brgds, H-P

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH]: Require MPC for building GCC
  2009-12-06 18:47 ` [PATCH]: " Hans-Peter Nilsson
@ 2009-12-06 20:26   ` Kaveh R. Ghazi
  0 siblings, 0 replies; 10+ messages in thread
From: Kaveh R. Ghazi @ 2009-12-06 20:26 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches

From: "Hans-Peter Nilsson" <hp@bitrange.com>

> On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
>> I've verified that, with this patch, the configure script (correctly)
>> aborts if MPC is not found or if the version is not recent enough.  I
>> also did three bootstraps on x86_64-unknown-linux-gnu, one with mpc
>> installed and found via --with-mpc=, one with mpc (only) in-tree, and
>> one with gmp, mpfr, and mpc all in-tree.
>
> But I presume not one with *just* gmp and mpfr in-tree and no
> mpc, as is IMHO a reasonable situation before the mpc requirement.
>
>>  All three configurations
>> bootstrapped successfully and had no regressions.
>
> Despite the good efforts, I didn't see the nice error message,
> just the less graceful:
> [...]

Yes, the pre-existing mechanism for finding GMP/MPFR (and now MPC) need the
packages to be installed somewhere in order to do existence and version
checks.  If any one of these packages are in-tree, the checks are bypassed
and the user is expected to know what to do.  I agree this is not desirable,
but it is not something new and I don't see a good way to fix it.  Note I
just tried compiling gcc-4-4.2 with GMP in-tree but with no MPFR.  I ran
into the same problem, so it's not limited to MPC.

cc -c  -g -DIN_GCC    -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.4.2/gcc -I../../gcc-4.4.2/gcc/.
 -I../../gcc-4.4.2/gcc/../include -I../../gcc-4.4.2/gcc/../libcpp/include -I/tmp/kg/build/./gmp
 -I/tmp/kg/gcc-4.4.2/gmp  -I../../gcc-4.4.2/gcc/../libdecnumber -I../../gcc-4.4.2/gcc/../libdecnumber/dpd
 -I../libdecnumber    ../../gcc-4.4.2/gcc/attribs.c -o attribs.o
"../../gcc-4.4.2/gcc/real.h", line 26: cannot find include file: <mpfr.h>
"../../gcc-4.4.2/gcc/real.h", line 474: syntax error before or at: 
mpfr_srcptr
[etc]


I believe the original rationale for this started with the fact that the
configure tests are based on a compile check which includes gmp.h.  Note for
the GMP package, gmp.h is *generated* during the build process.  So if GMP
is in-tree, you cannot include gmp.h during a top-level configure because it
hasn't been created yet.  Since mpfr.h requires gmp.h, and mpc.h requires
mpfr.h, you cannot do tests for these packages either if GMP is in-tree.
Were this issue to be bypassed, we also perform link tests to ensure that
the library version matches the header.  These again cannot be done if any
package is in-tree.

        --Kaveh

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-12-06 20:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-15 10:25 [PATCH]: Require MPC for building GCC Kaveh R. GHAZI
2009-11-15 14:37 ` Richard Guenther
2009-11-15 16:43   ` Kaveh R. Ghazi
2009-11-22 11:42 ` [PING]: (build machinery) " Kaveh R. GHAZI
2009-11-28 14:55   ` [PING x2]: " Kaveh R. GHAZI
2009-11-30  5:41     ` Alexandre Oliva
2009-11-30 16:29       ` Kaveh R. Ghazi
2009-11-30  7:33     ` Paolo Bonzini
2009-12-06 18:47 ` [PATCH]: " Hans-Peter Nilsson
2009-12-06 20:26   ` Kaveh R. Ghazi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).