mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2009-02-06, 10:36   #1
M0CZY
 
M0CZY's Avatar
 
May 2005
Brutal Police State, UK

3×41 Posts
Default Help needed compiling GMP-ECM

I have a fresh, new installation of Ubuntu 8.10, and I have copies of gmp-4.2.4.tar.gz and ecm-6.2.1.tar.gz.
I don't know what, if any, other software I will need.
I need detailed instructions for compiling GMP-ECM, if anyone will help please?
M0CZY is offline   Reply With Quote
Old 2009-02-06, 14:54   #2
Jeff Gilchrist
 
Jeff Gilchrist's Avatar
 
Jun 2003
Ottawa, Canada

22·293 Posts
Default

With Ubuntu you probably already have GMP installed. Just follow the detailed instructions that come with the ECM tar ball in the "INSTALL" file. It is pretty straight forward 5 step process.
Jeff Gilchrist is offline   Reply With Quote
Old 2009-02-06, 15:12   #3
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

13×491 Posts
Default

sudo apt-get install gmp-ecm gets you 6.1.2 without any effort.
fivemack is offline   Reply With Quote
Old 2009-02-06, 16:01   #4
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

46438 Posts
Default

M0CZY,

which cpu does you computer have? There is no optimized assembly for x86_64 cpus in the official GMP 4.2.4, but patches exist that add at least some assembly for the most common functions for AMD64 and Core 2. If you want the fastest possible GMP-ECM, you'll need to hunt down bits and pieces of code and put together an optimized GMP on your own... it's a bit messy.

Alex
akruppa is offline   Reply With Quote
Old 2009-02-06, 17:17   #5
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

5,857 Posts
Default

Quote:
Originally Posted by akruppa View Post
M0CZY,

which cpu does you computer have? There is no optimized assembly for x86_64 cpus in the official GMP 4.2.4, but patches exist that add at least some assembly for the most common functions for AMD64 and Core 2. If you want the fastest possible GMP-ECM, you'll need to hunt down bits and pieces of code and put together an optimized GMP on your own... it's a bit messy.

Alex
i didnt know that
i still managed to get 2x speed by running in 64-bit though

i had to install GMP to get GMP-ECM to compile on the 64-bit version of Ubuntu
after i installed GMP 4.2.4 the first time the ./configure for GMP-ECM said i had mismatching versions of gmp.h which it said was 4.2.2 and the other part which it said was 4.2.4
it took quite a bit of fiddling to get it to work

i installed:
sudo apt-get install libc6-dev g++ gcc
sudo apt-get install build-essentials
sudo apt-get install m4
henryzz is offline   Reply With Quote
Old 2009-02-06, 17:45   #6
Jeff Gilchrist
 
Jeff Gilchrist's Avatar
 
Jun 2003
Ottawa, Canada

22·293 Posts
Default

Quote:
Originally Posted by henryzz View Post
i didnt know that
i still managed to get 2x speed by running in 64-bit though
I was just going to say the same thing. In Windows when I compile I get a 2x speedup with the 64bit version.

With the official GMP 4.2.4 in the Windows projects there are specific builds for Core2 64bit and Opteron 64bit. Would those have the right bits in them then? Do you have any idea of the 4.3 release will include these optimizations by default?

Last fiddled with by Jeff Gilchrist on 2009-02-06 at 17:45
Jeff Gilchrist is offline   Reply With Quote
Old 2009-02-06, 17:59   #7
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

5,857 Posts
Default

before i compiled GMP-ECM on 64-bit linux for myself i had heard of a possible 3x speed benefit
i suspect that might have been with the extra bits
running 64-bit GMP-ECM in a virtual machine with a 32-bit host means ~1.5 times 32-bit speed
henryzz is offline   Reply With Quote
Old 2009-02-06, 18:28   #8
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

22×23×37 Posts
Default

Quote:
Originally Posted by Jeff Gilchrist View Post
I was just going to say the same thing. In Windows when I compile I get a 2x speedup with the 64bit version.

With the official GMP 4.2.4 in the Windows projects there are specific builds for Core2 64bit and Opteron 64bit. Would those have the right bits in them then? Do you have any idea of the 4.3 release will include these optimizations by default?
This post links to the core2 patch for GMP. http://www.mersenneforum.org/showpos...4&postcount=82

Geoff also has posts with the resulting core2 (and opteron) optimized gmp-ecm binary in the thread, which I've found to be the fastest on my core2 systems.
bsquared is offline   Reply With Quote
Old 2009-02-06, 19:37   #9
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

If you configure on a 64 bit system with --enable-asm-redc, then for numbers of up to 20 words (385 digits), at least stage 1 uses GMP-ECM's own assembly code, so except for addition etc which still uses GMP functions, there's not much speed to gain (other than by writing better mulredc code of course).

Stage 2 uses GMP functions for computing the roots of the polynomials, and if you run with -no-ntt, for the polynomial multiplication, too (otherwise it uses NTT code which relies on GMP only little).

So getting a well optimized GMP matters most if you want to factor somewhat larger numbers, where stage 1 and/or stage 2 do all the work via GMP.

Pierrick Gaudry has a patch for AMD64 assembly (http://www.loria.fr/~gaudry/mpn_AMD64/), Jason Worth Martin has a patch for Core 2 (http://www.math.jmu.edu/~martin/). I found that in some cases, the AMD64 code is faster even on Core 2, but haven't looked into the issue much.

GMP 4.3 will (finally!) have asm code for x86_64 architectures. It's supposed to be out last week or so... but Torbjörn has always valued "when it's ready" over "when I said I would."

Alex

Last fiddled with by akruppa on 2009-02-06 at 19:41
akruppa is offline   Reply With Quote
Old 2009-02-07, 10:48   #10
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

16E116 Posts
Default

Quote:
Originally Posted by akruppa View Post
GMP 4.3 will (finally!) have asm code for x86_64 architectures. It's supposed to be out last week or so... but Torbjörn has always valued "when it's ready" over "when I said I would."
if that's the case then it probably isn't worth fiddling around with the patches but waiting for GMP 4.3

Last fiddled with by henryzz on 2009-02-07 at 10:48
henryzz is offline   Reply With Quote
Old 2009-02-07, 11:02   #11
Jeff Gilchrist
 
Jeff Gilchrist's Avatar
 
Jun 2003
Ottawa, Canada

22×293 Posts
Default

Quote:
Originally Posted by akruppa View Post
GMP 4.3 will (finally!) have asm code for x86_64 architectures. It's supposed to be out last week or so... but Torbjörn has always valued "when it's ready" over "when I said I would."
Is that why the 4.3 preliminary benchmarks are showing such a nice speedup or is that from something else?
Jeff Gilchrist is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling GMP-ECM ATH GMP-ECM 69 2017-01-04 12:03
Help needed compiling GMP-ECM on 64bit Mac yoyo GMP-ECM 16 2009-03-18 22:46
Compiling 24.14 CBoland Software 6 2007-08-01 00:11
Compiling new version of GMP-ECM M0CZY GMP-ECM 3 2006-05-27 09:54
Compiling ECM 5.0.3 for windows BotXXX Factoring 25 2005-09-13 12:24

All times are UTC. The time now is 04:03.

Sun Apr 18 04:03:00 UTC 2021 up 9 days, 22:43, 0 users, load averages: 2.26, 2.32, 2.14

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.