View Single Post
Old 2018-02-24, 01:53   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

337510 Posts
Default How I install YAFU 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* YAFU 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 this instance "install" is referring to the acquiring and compilation of the YAFU package only. The binary will have to be called using its respective path.

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 procedures in:

How I Install GMP onto my Ubuntu Machines
,
How I Install GMP-ECM onto my Ubuntu Machines
,
How I Install msieve onto my Ubuntu Machines
and
How I Install ggnfs onto my Ubuntu Machines (This is optional to compiling YAFU, but sievers are necessary to run NFS routines.)


If you have already installed the following packages, you can skip the next two steps, although performing them wouldn't hurt anything.

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, type:
Code:
sudo apt-get install g++ m4 zlib1g-dev make p7zip subversion
Accept the prompt.

Special Note on the following procedure(s): There are two branches available for YAFU. The "wip" branch and the "trunk" branch. The wip branch is the development branch and has all the latest work. This is the branch you should use if you want to stay at the leading edge of YAFU. However, if you have troubles with the installation, or just want a stable running package, you should use the trunk branch. I will note any differences in the installation steps with wip/trunk designations.

To download the "wip" YAFU package:
Code:
svn co https://svn.code.sf.net/p/yafu/code/branches/wip $HOME/Math/yafu
To download the "trunk" YAFU package:
Code:
svn co https://svn.code.sf.net/p/yafu/code/trunk $HOME/Math/yafu
Move into the yafu folder:
Code:
 cd Math/yafu
Using a text editor, open the Makefile file and make the following edits:
Code:
. . .
#CC = gcc-7.3.0  (This edit is only needed in the "wip" Makefile.)
. . .

#    modify the following line for your particular msieve installation
    . . .
    else
        LIBS += -L../msieve
    endif
    . . .
Save and close Makefile.

Run the following in your terminal:
Code:
lscpu
See how many CPU(s) are reported and then look for sse4_1 and avx2 in the Flags listing.

Run the following in your terminal:
Code:
echo $HOME
Run the following in your terminal:
Code:
which ecm
You should see:
Code:
/usr/local/bin/ecm
Open the yafu.ini file and modify the following lines:
Code:
threads=<# of CPUs reported above>
ggnfs_dir=<$HOME string returned>/Math/ggnfs/bin/
ecm_path=/usr/local/bin/ecm
Save and close yafu.ini

For the "wip" version, run the following in the terminal:
Code:
make NFS=1
or
Code:
make NFS=1 USE_SSE41=1
or
Code:
make NFS=1 USE_AVX2=1
or
Code:
make NFS=1 USE_SSE41=1 USE_AVX2=1
depending on the flags reported above.

For the "trunk" version, run the following in the terminal:
Code:
make x86_64 NFS=1
or
Code:
make x86_64 NFS=1 USE_SSE41=1
or
Code:
make x86_64 NFS=1 USE_AVX2=1
or
Code:
make x86_64 NFS=1 USE_SSE41=1 USE_AVX2=1
depending on the flags reported above.

Test your installation and calculate tune data with the following command:
Code:
./yafu "tune"
Return to your home directory:
Code:
cd ~/

Last fiddled with by EdH on 2020-09-28 at 18:09
EdH is offline   Reply With Quote