mersenneforum.org GMP with GWNUM support?
 Register FAQ Search Today's Posts Mark Forums Read

 2021-09-15, 08:26 #1 moytrage   Jul 2021 3×11 Posts 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.
 2021-09-15, 10:53 #2 paulunderwood     Sep 2002 Database er0rr 3,863 Posts 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 ) { ... } Last fiddled with by paulunderwood on 2021-09-15 at 10:57
 2021-09-15, 14:50 #3 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 578310 Posts 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. Last fiddled with by kriesel on 2021-09-15 at 14:51
2021-09-15, 17:16   #4
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

24·32·53 Posts

Quote:
 Originally Posted by moytrage I heard there was an effort to implement some functions of GMP using GWNUM. Is it true?
No. You can compile GMP-ECM with gwnum support for certain inputs.

 2021-09-21, 11:07 #5 Happy5214     "Alexander" Nov 2008 The Alamo City 13668 Posts 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.
2021-09-21, 12:14   #6
axn

Jun 2003

120358 Posts

Quote:
 Originally Posted by Happy5214 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.
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.

2021-09-22, 04:09   #7
Happy5214

"Alexander"
Nov 2008
The Alamo City

2·379 Posts

Quote:
 Originally Posted by axn 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.
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

Last fiddled with by Happy5214 on 2021-09-22 at 04:09

 2021-09-22, 08:47 #8 axn     Jun 2003 19×271 Posts So... the restriction comes from gwnum license?
2021-09-22, 09:34   #9
Happy5214

"Alexander"
Nov 2008
The Alamo City

2·379 Posts

Quote:
 Originally Posted by axn So... the restriction comes from gwnum license?
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.

Last fiddled with by Happy5214 on 2021-09-22 at 09:38 Reason: Expand

 2021-09-22, 09:41 #10 axn     Jun 2003 514910 Posts 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.
2021-09-22, 09:55   #11
Happy5214

"Alexander"
Nov 2008
The Alamo City

2×379 Posts

Quote:
 Originally Posted by axn 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.
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.

 Similar Threads Thread Thread Starter Forum Replies Last Post lavalamp Software 6 2020-12-11 07:53 enzocreti enzocreti 22 2019-03-14 18:35 Jean Penné Software 25 2010-11-01 15:18 Unregistered Information & Answers 3 2010-09-12 19:52 Cyclamen Persicum Software 1 2007-01-02 20:53

All times are UTC. The time now is 16:34.

Wed Oct 20 16:34:08 UTC 2021 up 89 days, 11:03, 0 users, load averages: 1.18, 1.25, 1.35