View Single Post
Old 2018-02-22, 03:09   #1
EdH's Avatar
"Ed Hall"
Dec 2009
Adirondack Mtns

3·372 Posts
Default 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:

How I Install GMP onto my Ubuntu Machines

or, install GMP from the repository.

Open a terminal and Enter:
sudo apt-get update
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
Accept the prompt.

Use subversion to acquire the latest GMP-ECM and place it in ~/Math/ecm:
svn co svn:// $HOME/Math/ecm
Move into the ecm folder:
cd Math/ecm
Type the following:
autoreconf -i
./configure --with-gmp=/usr/local/
When the configuration script ends, type:
When make ends, type:
make check
If all checked out, type:
sudo make install
Return to your home directory:
cd ~
You can check your installation by running a test factor instance:
echo 115367564564210182766242534110944507919869313713243756429 | ecm 1000000
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

Last fiddled with by EdH on 2019-09-12 at 00:50 Reason: Keep procedure up to latest steps
EdH is offline   Reply With Quote