mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   GMP with GWNUM support? (https://www.mersenneforum.org/showthread.php?t=27138)

moytrage 2021-09-15 08:26

GMP with GWNUM support?
 
I heard there was an effort to implement some functions of GMP using GWNUM. Is it true?

How can I re-compile GMP with such support enabled? Would be already great if at least Multiplication of very long integers will be implemented through gwnum.

Does anyone have example of steps needed to re-compile GMP with gwnum? Windows and Linux versions are needed.

paulunderwood 2021-09-15 10:53

I don't know about efforts to put GWNUM in GMP, but you could write your own functions like

[CODE]gw_mul( mpz_t r, mpz_t a, mpz_t b ) {
...
}[/CODE]

:smile:

kriesel 2021-09-15 14:50

IIRC, GMP and its fork MPIR are entirely integer instruction based code for the multiword operations. From a philosophical stance that no imprecision was to be allowed in.

Gwnum, prime95, etc is rooted in the stance that while floating point is faster than integer on modern CPUs, managing round-off error is worth the effort to gain speed.

Prime95 2021-09-15 17:16

[QUOTE=moytrage;587901]I heard there was an effort to implement some functions of GMP using GWNUM. Is it true?
[/QUOTE]

No. You can compile GMP-ECM with gwnum support for certain inputs.

Happy5214 2021-09-21 11:07

There's also the issue of licensing. gwnum's license is incompatible with the GPL (per the FSF's definition, it isn't even free, but that's irrelevant here). People have been known to link gwnum into GMP-ECM, and while compiling and linking for personal use is OK under the GPL, redistributing those binaries is not. I'm not sure if the same restrictions would apply to GMP itself, which is dual-licensed under the GPL and LGPL, if you ever consider going that route.

axn 2021-09-21 12:14

[QUOTE=Happy5214;588315]gwnum's license is incompatible with the GPL (per the FSF's definition, it isn't even free, but that's irrelevant here). People have been known to link gwnum into GMP-ECM, and while compiling and linking for personal use is OK under the GPL, redistributing those binaries is not.[/QUOTE]
Why? IIUC, a closed source s/w using a GPL library needs to open up the closed source, but reverse (an open source s/w incorporating a closed source library) imposes no such restriction. So I don't understand why the binaries could not be redistributed.

Happy5214 2021-09-22 04:09

[QUOTE=axn;588322]Why? IIUC, a closed source s/w using a GPL library needs to open up the closed source, but reverse (an open source s/w incorporating a closed source library) imposes no such restriction. So I don't understand why the binaries could not be redistributed.[/QUOTE]
In order to distribute a GMP-ECM + gwnum binary, the whole thing would need to be licensable under the GPL. The Mersenne prime prize distribution rules in the gwnum license (even though completely irrelevant for factoring) add an extra restriction on use that isn't permitted under the GPL, thus preventing the gwnum part of the code from being distributed under that license.

And if you don't believe me, here are lines 897-903 from my (unmodified) SVN copy of main.c from GMP-ECM:
[code]
#ifdef HAVE_GWNUM
#ifdef gwnum_is_gpl
if (! gwnum_is_gpl ())
#endif
printf ("Due to incompatible licenses, this binary file must not "
"be distributed.\n");
#endif
[/code]

axn 2021-09-22 08:47

So... the restriction comes from gwnum license?

Happy5214 2021-09-22 09:34

[QUOTE=axn;588381]So... the restriction comes from gwnum license?[/QUOTE]

Yes. The gwnum license requires any 100M-digit Mersenne primes found with gwnum to be credited to GIMPS and fall under their prize rules, even if the library is linked into a program other than Prime95/mprime, such as LLR (bad example, but you get the point). This is considered a "further restriction" on the recipient's freedom to use the software under section 10 of the GPL (it would necessarily apply to the combined package, even though GMP-ECM cannot perform record-breaking primality tests), thus preventing the code from being combined and distributed under the GPL only, as required under section 6.

Edit: Even if George were to grant a special license for GMP-ECM, the remainder of the existing license is murky enough to make its GPL compatibility status without the prize rule problematic.

axn 2021-09-22 09:41

Is that a gwnum license restriction or P95/mprime software restriction?

Can you (or someone) point to the gwnum license? I am looking at the source, and couldn't find anything obvious.

Happy5214 2021-09-22 09:55

[QUOTE=axn;588386]Is that a gwnum license restriction or P95/mprime software restriction?

Can you (or someone) point to the gwnum license? I am looking at the source, and couldn't find anything obvious.[/QUOTE]
AFAIK gwnum and Prime95/mprime have the same license. I don't see a license file in the gwnum source folder, but both LLR and OpenPFGW (which both link gwnum) reference similar terms.


All times are UTC. The time now is 08:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.