[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merging bignum to master

From: Paul Eggert
Subject: Re: Merging bignum to master
Date: Thu, 16 Aug 2018 12:31:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Richard Stallman wrote:

Why would we need both?  Given --enable-bignums, which seems
fundametally to fit the purpose, is there really a reason for
--with-gmp?  Do we support bignums other than using gmp?

Yes and no. If by "using gmp" you mean linking to libgmp, some GNU packages do support bignums other than by linking to libgmp. However, every GNU package that I know of supports bignums either by linking to libgmp or by compiling code copied from some subset of the GMP sources.

Here are some 'configure' options that GNU packages use to control this. As far as I can see, only Emacs master 'configure' follows the GNU coding standards. This suggests that in this area the standards are either too ambitious or are not clear enough; in either case they could use examples to cover some of the issues mentioned below.

* Emacs (master branch) always supports bignums, and by default it uses libgmp if available and otherwise substitutes its own portable and slower implementation copied from the GMP source code. The default can be overridden with --with-libgmp / --without-libgmp. This follows the GNU coding standards, and it wouldn't make sense to for Emacs 'configure' to have an --enable-bignum option since bignums are always supported.

* MPFR and Nettle always use bignums and by default always uses libgmp. Their 'configure' scripts have an --enable-mini-gmp option to cause their builds to use the portable and slower substitute. This doesn't follow the GNU coding standards, since --enable-mini-gmp doesn't affect user-visible features.

* Coreutils supports bignums only as a build-time option that affects user-visible behavior. The Coreutils implementation always uses libgmp to support bignums if bignums are requested. Its 'configure' has a --with-gmp / --without-gmp option that works much like Emacs's --with-libgmp / --without-libgmp option, and that enables the bignum feature. It sounds like you're saying that Coreutils should rename its --with-gmp / --without-gmp option to --enable-bignums / --disable-bignums or something like that, since the option enables user-visible behavior. (Better yet, I suppose Coreutils should do what Emacs does and substitute its own portable implementation and use a --with-libgmp / --without-libgmp 'configure' option, though that'd be more work.)

* GNU Common Lisp always supports bignums and requires libgmp, and has an --enable-oldgmp option that links to an older version of libgmp rather than a newer one. This usage doesn't follow the GNU coding standards, which say this should be a --with option.

* GCC always uses bignums and requires libgmp, and if the platform lacks libgmp the GCC build process documents a procedure for you to download the GMP sources, build a libgmp of your own, and link to that. GCC's 'configure' program has a --with-gmp=DIR option that lets you tell the build procedure where libgmp is installed if it is neither supplied by your system nor built from sources in the way that GCC recommends. This --with-gmp=DIR option doesn't follow the GNU coding standards, which say "Do not use a @samp{--with} option to specify the file name to use to find certain files."

I doubt whether this is an exhaustive survey, but it should give you a feel for some of the confusion in this area.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]