Use of the __GMP_CC and __GMP_CFLAGS macros

Gabriel Dos Reis gdr at integrable-solutions.net
Tue Sep 25 04:33:28 CEST 2012


On Mon, Sep 24, 2012 at 9:57 AM, Vincent Lefevre <vincent at vinc17.org> wrote:
> The __GMP_CC and __GMP_CFLAGS macros were introduced in gmp.h so that
> the GMP user (in particular, MPFR) doesn't have to guess which ABI GMP
> chose (and how to use it) when it was built and installed, in case GMP
> didn't select the default ABI. You can read the full discussion here:
>
>   https://sympa.inria.fr/sympa/arc/mpfr/2008-07/msg00010.html
>
> The problem is that distributions (like Debian) could have built GMP
> under a particular environment and provide packages with a gmp.h using
> __GMP_CC and __GMP_CFLAGS values from this environment, which may not
> match what is expected on the end user machine. The differences could
> be, e.g.:
>   * a compiler that isn't necessarily installed or have a unusual name
>     (for instance, Debian uses x86_64-linux-gnu-gcc);
>   * suboptimal compiler options (for instance, Debian uses -O3 without
>     architecture information, which may generate code slower than with
>     -O2, at least this happened in the past).
>
> Unfortunately, the Debian maintainer doesn't want to change that
> (like removing these macros, since Debian always uses the default
> ABI) because he assumes that the user shouldn't use __GMP_CC and
> __GMP_CFLAGS:
>
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687169
>
> Of course, this is not the right solution (unless GMP decides to use
> the default ABI everywhere), otherwise one would get the same problems
> as in the past!

So, we have a distro maintainer who refuses to provide
a sensible GMP build/distribution. Is that correct?

>
> What do GMP developers propose to do concerning the use of these
> macros?
>
> Note: with the autotools, I'm not sure whether it is possible to use
> the default compiler and options by default, and the values in the
> __GMP_* macros as a fallback.


More information about the gmp-discuss mailing list