-   EdH (
-   -   How I Install GMP-ECM onto my Ubuntu Machines (

EdH 2018-02-22 03:09

How I Install GMP-ECM onto my Ubuntu Machines
(Note: I expect to keep the first post of each of these "How I Install..." threads up-to-date with the latest version. Please read the rest of each thread to see what may have led to the current set of instructions.)

This thread will explain the steps I use to install GMP-ECM onto a computer which is already running Ubuntu. This procedure should work for other linux distributions as well but the only other one I've currently tested is Debain.

Ubuntu does contain GMP-ECM in its repositories and it can be installed from the Software Installer provided. I will be describing here, how to acquire, compile and install the latest version of the package.

I will expect the user of these steps to be able to use the sudo command.

I will use a directory called Math for these installations. You may elect to replace "Math" with your own choice.

These instructions can be used as a reference only, if you want, but I will provide specifics that work for me. If you follow these steps as I provide them, you should end up with a working installation.

First, follow the procedure in:

[URL=""]How I Install GMP onto my Ubuntu Machines[/URL]

or, install GMP from the repository.

Open a terminal and Enter:
sudo apt-get update
[/code]You should be prompted for your password. This prompt should only appear once for your terminal session, unless you leave it idle for a long time.

After the update completes and the user prompt reappears, type the following. (If you have already installed any of these, you may omit them here, but if you don't omit them, all will still be fine):
sudo apt-get install g++ m4 zlib1g-dev make p7zip subversion libtool autoconf
[/code]Accept the prompt.

Use subversion to acquire the latest GMP-ECM and place it in ~/Math/ecm:
svn co svn:// $HOME/Math/ecm
[/code]Move into the ecm folder:
cd Math/ecm
[/code]Type the following:
autoreconf -i
./configure --with-gmp=/usr/local/
[/code]When the configuration script ends, type:
[/code]When make ends, type:
make check
[/code]If all checked out, type:
sudo make install
[/code]Return to your home directory:
cd ~
[/code]You can check your installation by running a test factor instance:
echo 115367564564210182766242534110944507919869313713243756429 | ecm 1000000
[/code]You should see something like:
GMP-ECM 7.0.5-dev [configured with GMP 6.1.1, --enable-asm-redc, --enable-assert] [ECM]
Input number is 115367564564210182766242534110944507919869313713243756429 (57 digits)
Using B1=1000000, B2=1045563762, polynomial Dickson(6), sigma=1:280903524
Step 1 took 744ms
********** Factor found in step 1: 3387679
Found prime factor of 7 digits: 3387679
Prime cofactor 34055046113935288073705488067477617542827792631251 has 50 digits

ATH 2018-02-22 09:58

Open your browser and go to the following link:

[URL=""]Project Filelist for GMP-ECM (Elliptic Curve Method)[/URL]

Download the latest archive and place it in the Math folder.

Using your files program, extract the ecm-x.x.x files into the Math folder. Rename the ecm-x.x.x folder to ecm.

Another option is to get the latest svn, and then you need 2 other commands before ./configure and you will probably need to get the packages: subversion, libtool and m4:

cd Math
svn checkout svn://
rename trunk to ecm
cd ecm
autoreconf -i

then continue with ./configure

EdH 2018-02-22 15:40


m4 is already listed in my apt-get install and subversion would have been listed in the msieve and yafu installs. I've not yet used libtool for anything.

If this gets the very latest GMP-ECM, then it's what I'm really striving for and I will change over to your suggestion and rewrite my procedure. I need to play with it just a bit, first.

I think I'll opt for sending it directly to an ecm folder:
svn co svn:// $HOME/Math/ecm
[/code]That way a simple cut and paste can be used by anyone wanting to do this on their own.

I appreciate the help.

EdH 2018-02-22 16:09

I also needed to install autoconf.

Xyzzy 2018-02-22 22:56

[QUOTE=EdH;480641]I also needed to install autoconf.[/QUOTE][c]apt-get install build-essential[/c]

EdH 2018-02-23 03:45

[QUOTE=Xyzzy;480672][c]apt-get install build-essential[/c][/QUOTE]
I'm not sure I understand the need?

Xyzzy 2018-02-23 14:58

Rather than install individual packages this meta-package installs (via dependencies) everything you need to build programs.

EdH 2018-02-23 22:58

[QUOTE=Xyzzy;480711]Rather than install individual packages this meta-package installs (via dependencies) everything you need to build programs.[/QUOTE]
But, the list of packages for build-essential that I've seen only has g++, gcc and make of the things I use. gcc is handled by g++ in my install line (or, it's installed in the basic Ubuntu OS), so build-essential, according to its list would only replace g++ and make. I still need autoconf, libtools and m4. Are they included in build-essential? (I do intend to test later.) Is there a more complete list?

Thanks for any and all help in my education...

VictordeHolland 2018-05-13 23:10

I just want to thank you for taking the time to write these excellent guides, quality stuff! :bow:

EdH 2018-05-14 03:04

You're welcome! Thanks for the feedback.

VictordeHolland 2018-07-18 22:01

You might want to run
[code]make ecm-params[/code]after you've done 'make' to tune the ecm parameters for your specific CPU.
Be sure to stop any other processes using CPU time (it takes a couple of minutes)

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

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