mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Blogorrhea > EdH

Reply
 
Thread Tools
Old 2018-02-24, 01:53   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

D7516 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
Old 2018-02-24, 02:01   #2
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101000011012 Posts
Default

Quote:
Originally Posted by EdH View Post
Run the following in the terminal:
Code:
make NFS=1
or
Code:
make NFS=1 USE_SSE41=1
depending on whether the flag was reported above.
or
Code:
make NFS=1 USE_AVX2=1
depending on whether the flag was reported above.

This helps quite a bit for siqs on supported cpus.
bsquared is offline   Reply With Quote
Old 2018-02-24, 05:14   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

5·13·53 Posts
Default

Excellent! Thank you B2.

Are sse4_1 and avx2 mutually exclusive?
EdH is offline   Reply With Quote
Old 2018-04-14, 21:49   #4
uglyb
 
Apr 2018

1 Posts
Default

What's about ggnfs? Does yafu need it?
uglyb is offline   Reply With Quote
Old 2018-04-21, 09:34   #5
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

3×13×229 Posts
Default

Yes, if you want to factor anything over 110 digits, you will need external ggnfs and path to it in yafu ini
LaurV is offline   Reply With Quote
Old 2018-04-28, 18:12   #6
MisterBitcoin
 
MisterBitcoin's Avatar
 
"Nuri, the dragon :P"
Jul 2016
Good old Germany

2·7·53 Posts
Default

Invalid option "B1pm1" while starting "tune".

Looks like somethink went wrong. After several hours following your posts.
At least GMP, ECM and msieve worked.



Any idea how I can fix that issue, so that yafu will work on my server?
MisterBitcoin is offline   Reply With Quote
Old 2018-04-29, 03:39   #7
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

D7516 Posts
Default

Quote:
Originally Posted by MisterBitcoin View Post
Invalid option "B1pm1" while starting "tune".

Looks like somethink went wrong. After several hours following your posts.
At least GMP, ECM and msieve worked.



Any idea how I can fix that issue, so that yafu will work on my server?
Try the following:
Code:
$ which ecm
and make sure you get the line:
Code:
ecm: /usr/local/bin/ecm
This ensures it was installed to that location.

(If you get a different location, try that in your yafu.ini file in the next step.)

Next, make sure your yafu.ini file has the following line:
Code:
ecm_path=/usr/local/bin/ecm
On Debian I don't have sudo set, so I have to go into root mode via su to use make install with GMP and ECM, whereas in Ubuntu, I use sudo make install:

Debian:
Code:
$ make
$ make check
$ su
Password: **************
# make install
exit
$
Ubuntu:
Code:
$ make
$ make check
$ sudo make install
[sudo] password for user: **************
$
YAFU will do some ECM without the correct path in the ini file, but it

Last fiddled with by EdH on 2019-09-15 at 15:20
EdH is offline   Reply With Quote
Old 2018-04-29, 08:49   #8
MisterBitcoin
 
MisterBitcoin's Avatar
 
"Nuri, the dragon :P"
Jul 2016
Good old Germany

2·7·53 Posts
Default

I´ve restarted the process but still got the same result.
ECM is in the correct path, same as ggnfs.



This what I see when I open yafu.ini.

Code:
B1pm1=100000
B1pp1=20000
B1ecm=11000
rhomax=1000
threads=4
pretest_ratio=0.25
%ggnfs_dir=..\ggnfs-bin\Win32\
ggnfs_dir=/home/user/Math/ggnfs/bin/
%ggnfs_dir=../../ggnfs-bin/
%ecm_path=..\gmp-ecm\build.vc10\x64\Release\ecm.exe
ecm_path=/usr/local/bin/ecm

At least I´m happy that ggnfs went fine without problems.
MisterBitcoin is offline   Reply With Quote
Old 2018-04-29, 15:56   #9
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

13·257 Posts
Default

Quote:
Originally Posted by MisterBitcoin View Post
Invalid option "B1pm1" while starting "tune".

Looks like somethink went wrong. After several hours following your posts.
At least GMP, ECM and msieve worked.



Any idea how I can fix that issue, so that yafu will work on my server?
Is this yafu's tune that it's having problems with? That's something I haven't seen before, but, tune is optional. Just omit that step and see if you can run ecm curves with yafu.

./yafu "ecm(rsa(256),100)" -v -threads 2 -B1ecm 1000000
bsquared is offline   Reply With Quote
Old 2018-04-29, 20:48   #10
MisterBitcoin
 
MisterBitcoin's Avatar
 
"Nuri, the dragon :P"
Jul 2016
Good old Germany

10111001102 Posts
Default

Quote:
Originally Posted by bsquared View Post
Is this yafu's tune that it's having problems with? That's something I haven't seen before, but, tune is optional. Just omit that step and see if you can run ecm curves with yafu.

./yafu "ecm(rsa(256),100)" -v -threads 2 -B1ecm 1000000

Same result.
MisterBitcoin is offline   Reply With Quote
Old 2018-04-30, 03:17   #11
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

D7516 Posts
Default

The next thing I would try is to use the trunk version of YAFU:

First, rename your current yafu directory to yafu-orig:
Code:
mv ~/Math/yafu ~/Math/yafu-orig
Next, checkout the code/trunk versin of YAFU:
Code:
svn co https://svn.code.sf.net/p/yafu/code/trunk $HOME/Math/yafu
Next, move into the Math/yafu directory and edit the Makefile:

Change:
Code:
else
    OBJ_EXT = .o

    INC += -I../gmp/include
    LIBS += -L../gmp/lib/linux/x86_64

    INC += -I../gmp-ecm/include/linux
    LIBS += -L../gmp-ecm/lib/linux/x86_64
To:
Code:
else
    OBJ_EXT = .o

    INC += -I/usr/local/lib/
    LIBS += -L/usr/local/lib/

    #INC += -I../gmp-ecm/include/linux
    #LIBS += -L../gmp-ecm/lib/linux/x86_64
Next, change the msieve reference:
Code:
#    modify the following line for your particular msieve installation
    
    ifeq ($(MIC),1)
        LIBS += -L../msieve/lib/phi
    else
        LIBS += -L../msieve
    endif
    LIBS += -lmsieve
-L../msieve
Now, save and close Makefile and copy your modified yafu.ini from yafu-orig into yafu, replacing the current one:
Code:
cp ~/Math/yafu-orig/yafu.ini ~/Math/yafu/yafu.ini
Check for sse4_1 and avx2:
Code:
cat /proc/cpuinfo
Next, compile yafu:
Code:
make x86_64 NFS=1 USE_SSE41=1 USE_AVX2=1
depending on the available functions.

And, finally test:
Code:
./yafu "tune"

Last fiddled with by EdH on 2019-09-15 at 15:19
EdH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I Install CADO-NFS onto my Ubuntu Machines EdH EdH 3 2019-06-24 03:42
How I Install GMP-ECM onto my Ubuntu Machines EdH EdH 12 2019-04-16 09:28
How I Install msieve onto my Ubuntu Machines EdH EdH 0 2018-02-23 14:43
How I Install ggnfs onto my Ubuntu Machines EdH EdH 0 2018-02-22 03:31
How I Install GMP onto my Ubuntu Machines EdH EdH 0 2018-02-21 23:48

All times are UTC. The time now is 21:32.

Tue Nov 24 21:32:36 UTC 2020 up 75 days, 18:43, 4 users, load averages: 2.89, 3.45, 3.28

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.