mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2021-09-15, 08:26   #1
moytrage
 
Jul 2021

3·11 Posts
Default 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.
moytrage is offline   Reply With Quote
Old 2021-09-15, 10:53   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2·7·281 Posts
Default

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
paulunderwood is offline   Reply With Quote
Old 2021-09-15, 14:50   #3
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

5,923 Posts
Default

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
kriesel is online now   Reply With Quote
Old 2021-09-15, 17:16   #4
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

3·13·197 Posts
Default

Quote:
Originally Posted by moytrage View Post
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.
Prime95 is online now   Reply With Quote
Old 2021-09-21, 11:07   #5
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

52·31 Posts
Default

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.
Happy5214 is offline   Reply With Quote
Old 2021-09-21, 12:14   #6
axn
 
axn's Avatar
 
Jun 2003

518710 Posts
Default

Quote:
Originally Posted by Happy5214 View Post
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.
axn is offline   Reply With Quote
Old 2021-09-22, 04:09   #7
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

14078 Posts
Default

Quote:
Originally Posted by axn View Post
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
Happy5214 is offline   Reply With Quote
Old 2021-09-22, 08:47   #8
axn
 
axn's Avatar
 
Jun 2003

144316 Posts
Default

So... the restriction comes from gwnum license?
axn is offline   Reply With Quote
Old 2021-09-22, 09:34   #9
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

52·31 Posts
Default

Quote:
Originally Posted by axn View Post
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
Happy5214 is offline   Reply With Quote
Old 2021-09-22, 09:41   #10
axn
 
axn's Avatar
 
Jun 2003

3×7×13×19 Posts
Default

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.
axn is offline   Reply With Quote
Old 2021-09-22, 09:55   #11
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

52×31 Posts
Default

Quote:
Originally Posted by axn View Post
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.
Happy5214 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
GPL GWNUM lavalamp Software 6 2020-12-11 07:53
GWNUM enzocreti enzocreti 22 2019-03-14 18:35
LLR V3.8.2 using gwnum 26.2 is available! Jean Penné Software 25 2010-11-01 15:18
GWNUM? Unregistered Information & Answers 3 2010-09-12 19:52
GWNUM as DLL? Cyclamen Persicum Software 1 2007-01-02 20:53

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


Fri Dec 3 08:02:53 UTC 2021 up 133 days, 2:31, 0 users, load averages: 1.62, 1.55, 1.38

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.