View Single Post
Old 2018-02-25, 14:40   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

32·383 Posts
Default How I Install CADO-NFS 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* CADO-NFS 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. In my case I needed to install python3 from the repository on my Debian based machines. More details about CADO-NFS and my early experiments can be found in the CADO-NFS thread.

*In this instance "install" is referring to the acquiring and compilation of the CADO-NFS package only. The binaries will have to be called using their respective paths.

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.

Ubuntu 18.04 Special Note: I've recently upgraded some 16.04 machines to 18.04 and have found that Python was removed, which caused CADO-NFS to crash. Simply using "sudo apt install python" resolved the issue. Because of this, I have added "python" to the below list of packages to install.

First, follow the procedure in:

How I Install GMP on my Ubuntu Machines

or, install GMP from the repositories.

If you have already installed most of the following packages, you can skip them, however, notice I have added the packages python and git to the list. You will now need git to retrieve the latest version of CADO-NFS using my steps, and if you are using Ubuntu 18.04, you may need to install python.

Open a terminal and enter:
Code:
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, enter:
Code:
sudo apt-get install g++ m4 zlib1g-dev make python git
Accept the prompt.

In your terminal, enter :
Code:
cd Math
git clone https://gitlab.inria.fr/cado-nfs/cado-nfs.git
cd cado-nfs
make
If prompted to download CMAke, choose y.

Note: The step above and the next step are described in the README file within the cado-nfs folder. It is recommended that it and the other READMEs referenced within be read for further details.

After CADO-NFS finishes compiling, its basic operation can be tested (per the README) by entering:
Code:
./cado-nfs.py 90377629292003121684002147101760858109247336549001090677693
You should see lots of activity similar to:
Code:
Info:root: Using default parameter file ./parameters/factor/params.c60
Info:root: No database exists yet
Info:root: Created temporary directory /tmp/cado.1lafrwdi
Info:Database: Opened connection to database /tmp/cado.1lafrwdi/c60.db
Info:root: Set tasks.threads=8 based on detected logical cpus
Info:root: tasks.polyselect.threads = 2
Info:root: tasks.sieve.las.threads = 2
...
Info:Quadratic Characters: Total cpu/real time for characters: 0.16/0.0801561
Info:Square Root: Total cpu/real time for sqrt: 2.07/0.413262
Info:HTTP server: Shutting down HTTP server
Info:Complete Factorization: Total cpu/elapsed time for entire factorization: 47.08/38.8295
Info:root: Cleaning up computation data in /tmp/cado.1lafrwdi
760926063870977 773951836515617 260938498861057 588120598053661

Last fiddled with by EdH on 2020-09-21 at 11:46
EdH is offline   Reply With Quote