mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2013-04-01, 10:19   #1
Dan Ee
 
Mar 2013

7 Posts
Default Experimental lasieve4_64, compiled with MinGW-w64!

I just happen to gain some interest in NFS and tried to compile "experimental lasieve4_64" for Windows, and I think I did it successfully.

The lasieve4 source code that I use as starting point is http://ggnfs.svn.sourceforge.net/vie...l/lasieve4_64/

Some notes for reproducing:
1) mingw-w64-bin-x86_64-20130104.7z from http://www.drangon.org/mingw/
2) MSYS-20111123.zip from http://sourceforge.net/projects/ming...0%2832-bit%29/
3) http://www.mpir.org/mpir-2.6.0.tar.bz2
4) My modified lasieve4_64 attached.
5) The build instruction is just like as in INSTALL file, except that I have renamed "athlon64" directory to "asm" so you do not need to create a link from asm to athlon64.

Summary of my changes:
1) In asm files, replace ".type foo,@function" with ".def foo; .scl 2; .type 32; .endef"
2) Insert __attribute__((sysv_abi)) at function prototypes of assembly routines. This may be the trick that a lot of people do not know.
3) Search for "long" in all C files, replace with "long long" if 64 bits are needed, else replace with "int"
4) For all fopen() calls, insert "b" (for binary) into the flags field. Some nasty crlf translation is happening without the binary flag, causing factor base save file corruption. My opinion is that file I/O API should not deal with crlf as special case, hence all fopen gets the binary flag.
5) Fixes in if.c, aligned malloc handling.
6) gmp.h -> mpir.h (optional, you may rename mpir.h to gmp.h instead)
7) There are parts that I have detected possible problems if compiled (for example, long is 32bit in Windows), but that part of the code is not compiled due to #ifdef. I have put in #error at those places just to make sure.

My compiled versions:
1) core2 (up to SSSE3)
2) westmere (up to SSE4.2)
3) ivybridge (up to AVX)

Ops, just found out that there is size restriction on attachments, so I put the Windows binaries here temporarily: http://storenow.net/my/?f=090e5e09e1...1a5d2a17528e8f
SHA1 (of lasieve4_win.zip): E6A40FE889C93016ED3496642AD2DFA29F102FC8
Attached Files
File Type: zip lasieve4_64 for win.zip (143.5 KB, 409 views)
Dan Ee is offline   Reply With Quote
Old 2013-04-01, 15:26   #2
prgamma10
 
prgamma10's Avatar
 
Jan 2013

109 Posts
Default

Does this version have ASM routines for 64-bit Windows?
prgamma10 is offline   Reply With Quote
Old 2013-04-01, 20:46   #3
Dan Ee
 
Mar 2013

716 Posts
Default

Yes, the assembly routines are included without changes.
__attribute__((sysv_abi)) makes gcc generate code that calls assembly routine using the Linux calling convention.
Dan Ee is offline   Reply With Quote
Old 2013-04-02, 00:48   #4
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,163 Posts
Default

If you can express your changes in patch form, please coordinate with frmky (Greg) to massively increase the throughput of NFS@Home :)
jasonp is offline   Reply With Quote
Old 2013-04-02, 08:36   #5
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

17×281 Posts
Default

Quote:
Originally Posted by jasonp View Post
If you can express your changes in patch form, please coordinate with frmky (Greg) to massively increase the throughput of NFS@Home :)
I already warned Greg about this thread, I think it was yesterday.
pinhodecarlos is offline   Reply With Quote
Old 2013-04-02, 13:06   #6
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

575110 Posts
Default

I have just tested these and the speed is comparable to the binaries I compiled in http://mersenneforum.org/showthread.php?t=17963
Well done for getting this working. Several have tried and failed. I can now use windows pretty much exclusively which is very helpful.
henryzz is offline   Reply With Quote
Old 2013-04-02, 13:50   #7
PhilF
 
PhilF's Avatar
 
Feb 2005
Colorado

32·61 Posts
Default

On my i7 Nehalem system, these binaries are much faster than the ones Henry mentioned (almost twice as fast). It appears the Core 2 and the Westmere versions both run at about the same speed on it.
PhilF is offline   Reply With Quote
Old 2013-04-02, 15:24   #8
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

34·71 Posts
Default

I have discovered a problem with these binaries.
If you provide them with a command line like:
gnfs-lasieve4I11e.exe -v -a nfs.job -f 605000 -c 2500 -o rels2.dat -n 2
then you get output like
Code:
Ignoring 8 trailing command line args
Warning:  lowering FB_bound to 4294967295.
FBsize 0+0 (deg 4), 92937+0 (deg 1)
If you move the -a nfs.job to the end like:
gnfs-lasieve4I11e.exe -v -f 605000 -c 2500 -o rels2.dat -n 2 -a nfs.job
then it runs properly.
It seems to be breaking from the while loop early. I can't see in the source why.
Myself I can just use this correctly. yafu unfortunately uses the problem form.
henryzz is offline   Reply With Quote
Old 2013-04-02, 15:39   #9
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3×5×223 Posts
Default

Quote:
Originally Posted by henryzz View Post
Myself I can just use this correctly. yafu unfortunately uses the problem form.
Can you compile YAFU?

If so, change the sprintf on line 576 of nfs_sieving.c from

Code:
sprintf(syscmd,"%s%s -%c %s -f %u -c %u -o %s -n %d",
			thread_data->job.sievername, VFLAG>0?" -v":"", *side,
			fobj->nfs_obj.job_infile, thread_data->job.startq, 
			thread_data->job.qrange, thread_data->outfilename, thread_data->tindex);
to
Code:
sprintf(syscmd,"%s%s -f %u -c %u -o %s -n %d -%c %s ",
			thread_data->job.sievername, VFLAG>0?" -v":"", thread_data->job.startq, 
			thread_data->job.qrange, thread_data->outfilename, thread_data->tindex,
			*side, fobj->nfs_obj.job_infile);
bsquared is offline   Reply With Quote
Old 2013-04-02, 15:51   #10
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

10110011101112 Posts
Default

Theoretically I probably could. I have had huge problems in the past compiling things in windows. I can't be bothered fiddling to compile all the necessary components(ecm msieve mpir etc).
Currently I am using factmsieve.pl which is just about sufficient for my needs.
It is worth sorting this anyway. I will just use the old script until then.
henryzz is offline   Reply With Quote
Old 2013-04-02, 17:04   #11
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

11100000111012 Posts
Default

Quote:
Originally Posted by henryzz View Post
I can now use windows pretty much exclusively which is very helpful.
Nooooooooooooo.



(As soon as Dota 2 is ported, I will be able to use GNU-Linux exclusively )
Dubslow is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unofficial experimental beta build wombatman YAFU 22 2016-02-19 18:59
About self-compiled Prime95 tyeken8 Software 14 2009-05-27 11:02
new experimental banners for GIMPS ixfd64 Lounge 14 2007-12-17 01:22
How I get a compiled version of GMP-ECM? MatWur-S530113 GMP-ECM 12 2007-10-22 20:33
compiled msieve on PS3 bigmic Msieve 2 2007-03-29 20:06

All times are UTC. The time now is 12:14.

Tue Dec 1 12:14:46 UTC 2020 up 82 days, 9:25, 1 user, load averages: 2.69, 2.38, 2.22

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.