mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2010-12-05, 07:21   #1
MattcAnderson
 
MattcAnderson's Avatar
 
"Matthew Anderson"
Dec 2010
Oregon, USA

10011011102 Posts
Default GMP-Fermat for Windows

HI,
I want to search for factors of Fermat numbers on my Windows 7 system. I have been using the files at: http://www.fermatsearch.org/download.html
I want to search faster than Fermat.exe by Duhrman.
I have some GMP libraries compiled for windows. I want to incorporate fast multiplication. I want the two attached files combined into a better executable. I heard from Luigi Morelli that Brian Gladman can do this.

I am unable to attach files larger than 1MB. Email mattcanderson@juno.com if you want the Windows C project that has a working executable. The file is called WinFermat_latest.zip

Cheers,
Matt
Attached Files
File Type: zip gmp-fermat-2.1-src.zip (39.1 KB, 115 views)
MattcAnderson is offline   Reply With Quote
Old 2010-12-05, 13:54   #2
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

10010101001002 Posts
Default

Quote:
Originally Posted by MattcAnderson View Post
HI,
I want to search for factors of Fermat numbers on my Windows 7 system. I have been using the files at: http://www.fermatsearch.org/download.html
I want to search faster than Fermat.exe by Duhrman.
I have some GMP libraries compiled for windows. I want to incorporate fast multiplication. I want the two attached files combined into a better executable. I heard from Luigi Morelli that Brian Gladman can do this.

I am unable to attach files larger than 1MB. Email mattcanderson@juno.com if you want the Windows C project that has a working executable. The file is called WinFermat_latest.zip

Cheers,
Matt
Some more detail about the package...

AFAIK, the fermat-redc.c source code has external definitions for Linux precompiiled object modules.

Those modules were compiled by Geoffrey Reynolds (Geoff), based on Ken_g6 assembly source code.

I was unable to decompile them, or translate into MASM readable format.

Luigi
ET_ is offline   Reply With Quote
Old 2010-12-05, 13:59   #3
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

604310 Posts
Default

You should be able to build with MinGW or CygWin.

Last fiddled with by rogue on 2010-12-05 at 13:59
rogue is offline   Reply With Quote
Old 2010-12-05, 15:51   #4
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

523 Posts
Default

Hi MattcAnderson,

The assembler code you provided is in GCC format. Although it is possible to convert this for Windows by: (a) translating into Intel format, (b) adding function prologues and epilogues in place of register pushes and pops, (c) adding frame pointers for any dynamic stack allocation, (d) changing the register assignments for function parameters, (e) removing any redzone use (not allowed on Windows), and (e) testing and debugging the resulting code, in practice this is VERY time consuming and is not worthwhile unless the resulting code is of very widespread benefit.

As others have already said, your best bet is to use either Mingw or Cygwin to build your code. If you want 64-bit code, the mingw64 project is now in good shape and I have been able to use it to produce 64-bit code that works well on Windows.

If you really do want to translate the code, I have some tools that will help you a bit.

Brian Gladman

PS I have just noticed that the assembler code you provided is based on Pierrick Gaudry's REDC code in GMP-ECM. Since GMP-ECM contains my translation of this code for use on Windows, it might be possible to pull the code you need from GMp-ECM.

Last fiddled with by Brian Gladman on 2010-12-05 at 16:44 Reason: added information
Brian Gladman is offline   Reply With Quote
Old 2010-12-06, 04:49   #5
MattcAnderson
 
MattcAnderson's Avatar
 
"Matthew Anderson"
Dec 2010
Oregon, USA

2·311 Posts
Default

Hi all,
Thansk for your replies. I have a windows executable that works, but slowly. It is hosted at:
http://sites.google.com/site/mattc1anderson/home-1

Should I hire someone to incorporate the faster multiplication include files?

Cheers,
Matt
MattcAnderson is offline   Reply With Quote
Old 2010-12-06, 08:53   #6
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

523 Posts
Default

Hi Matt

There is good news since I have now looked at the assembler code in more detail and I see that the files already have the basic x64 conversions in them. As I have tools to convert from AT&T syntax to Intel syntax, the work that needs to be done to get these files to work with MSVC is a lot lower than I originally thought.

Brian
Brian Gladman is offline   Reply With Quote
Old 2010-12-06, 14:04   #7
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

20B16 Posts
Default

How much are you willing to pay?

Brian
Attached Files
File Type: zip fermat.vc10.zip (39.1 KB, 120 views)
Brian Gladman is offline   Reply With Quote
Old 2010-12-06, 14:11   #8
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

22·1,193 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
How much are you willing to pay?

Brian
If you or Matt can provide me with 32 and 64 bits Windows executables, I will pay, not Matt. (Just PM me your coordinates of payment ).

And FermatSearch will acknowledge your work.

Luigi

Last fiddled with by ET_ on 2010-12-06 at 14:13
ET_ is offline   Reply With Quote
Old 2010-12-06, 14:54   #9
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

10138 Posts
Default

Hi Luigi

I have attached win32 and x64 executables but I have not been able to test them. Let me know if they work. The x64 version has the assembler code installed and I would be interested to know if it provides a significaant speed improvement.

Brian
Attached Files
File Type: zip fermat.exe.zip (239.6 KB, 129 views)

Last fiddled with by Brian Gladman on 2010-12-06 at 15:04 Reason: typo
Brian Gladman is offline   Reply With Quote
Old 2010-12-06, 15:27   #10
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

22×1,193 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
Hi Luigi

I have attached win32 and x64 executables but I have not been able to test them. Let me know if they work. The x64 version has the assembler code installed and I would be interested to know if it provides a significaant speed improvement.

Brian
Thanks Brian.

It seems that X64 version has been compiled with #define GMP-Double-Mersenne version 2.1 while the win32 is correctly #define(d) GMP.Fermat version 2.1
So, Win32 version works correctly (and finds factors), while I couldn't test X64 version.

Another question: fermat.c source code calls a generic C-coded mulmod, while fermat_redc.c source code calls external mulmodXXX (where XXX is the bit-level).

Which source code has been used to create the executables?

Luigi
ET_ is offline   Reply With Quote
Old 2010-12-06, 15:58   #11
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

10138 Posts
Default

A revised x64 executable is attached without the Double Mod stuff. It uses the low level assembler for the mod operations.

Brian
Attached Files
File Type: zip fermat.x64.zip (133.5 KB, 160 views)
Brian Gladman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fermat ECM houding PrimeNet 2 2017-12-13 08:22
GMP-Fermat houding FermatSearch 1 2016-12-02 12:36
Is it worth the trouble to "upgrade" Windows 8 to Windows 7? ixfd64 Lounge 23 2013-04-13 11:12
Windows 7 Windows Update & Prime95 issue!!! Unregistered Information & Answers 14 2010-04-10 21:47
Fermat's Theorem Crook Math 5 2005-05-05 17:18

All times are UTC. The time now is 05:15.

Fri Dec 4 05:15:05 UTC 2020 up 1 day, 1:26, 0 users, load averages: 1.11, 1.47, 1.40

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.