mersenneforum.org  

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

Reply
 
Thread Tools
Old 2021-05-03, 16:23   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

126138 Posts
Default How I install YAFU version 2 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.)

YAFU2 was introduced in April 2021 and details can be found here.

This thread will explain the steps I use to install* YAFU2 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 Fedora. The original YAFU is still available and the prior thread How I install YAFU onto my Ubuntu Machines is still valid.

*In this instance "install" is referring to the acquiring and compilation of YAFU2 and associated packages 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 git
Accept the prompt.

YAFU2 is dependent on two "new" packages by the same author, called ytools and ysieve, which must be retrieved and compiled prior to building YAFU2.

Start in a terminal in the Math directory:
Code:
cd $HOME/Math
and clone ytools:
Code:
git clone https://github.com/bbuhrow/ytools
Modify the ytools/Makefile to change:
Code:
CC = gcc-7.3.0
to:
Code:
CC = gcc
if needed. Then move into the ytools directory
Code:
cd ytools
and use:
Code:
make
to build the ytools package.

Move back to the Math directory
Code:
cd ..
and use the same procedure for the ysieve package:
Code:
git clone https://github.com/bbuhrow/ysieve
You should not need to modify ysieve's Makefile. Simply move into its directory
Code:
cd ysieve
and use:
Code:
make
to build the ysieve package.

Now it's time to retrieve and build YAFU2, which I will now only refer to as YAFU. Move into the Math directory
Code:
cd ..
and retrieve YAFU from its new git location:
Code:
git clone https://github.com/bbuhrow/yafu
Change the following lines in yafu/Makefile:
Code:
INC += -I../ysieve -I../ytools
LIBS += -L../ysieve -L../ytools

INC += -I../gmp_install/gmp-6.2.0/include
LIBS += -L../gmp_install/gmp-6.2.0/lib

INC += -I../ecm_install/include/
LIBS += -L../ecm_install/lib/

INC += -I../msieve/zlib 
LIBS += -L../msieve/
to:
Code:
INC += -I../ysieve -I../ytools
LIBS += -L../ysieve -L../ytools

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

#INC += -I../ecm_install/include/
#LIBS += -L../ecm_install/lib/

INC += -I../msieve/zlib 
LIBS += -L../msieve/
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:
which ecm
You should see:
Code:
/usr/local/bin/ecm
Open the yafu.ini file and change the following lines:
Code:
% threads=1
ggnfs_dir=..\..\ggnfs-bin\x64\
ecm_path=..\..\gmp-ecm\bin\mingw\ecm.exe
to:
Code:
threads=<# of CPUs reported above>
ggnfs_dir=../ggnfs/bin/
ecm_path=/usr/local/bin/ecm
Now, move into the yafu directory and use:
Code:
make NFS=1
Note: I have only provided the very basic installation. There are many options that can be used based on the capabilities of your CPU. Some of these options can simply be added to the make command (e.g. USE_SSE41=1), but others will need extra work, either via the make command or through Makefile modification. For further information, please refer to the YAFU2 thread refereced above and the documentation provided with YAFU.

Last fiddled with by EdH on 2023-04-08 at 19:22
EdH is offline   Reply With Quote
Old 2021-09-20, 01:25   #2
Mr. Odd
 
Mar 2010

22×3×5 Posts
Default

Ed - I have an AMD 3950X. I saw your note that you updated all your machines to 2.07. What extra flags did you use when compiling?
Mr. Odd is offline   Reply With Quote
Old 2021-09-20, 02:20   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

5·1,103 Posts
Default

Quote:
Originally Posted by Mr. Odd View Post
Ed - I have an AMD 3950X. I saw your note that you updated all your machines to 2.07. What extra flags did you use when compiling?
Well, my machines don't have any usable flags, so I only used NFS=1. However, I just noticed they are all broken when trying to run snfs and they won't build without NFS=1. For the moment, I'm not sure if the trouble is Msieve or YAFU. I haven't gathered enough data to post, yet. I hope I can do so tomorrow. I also have to update this thread with some changes in the Makefiles.

Edit: My CPUs are AMD Phenom(tm) II X4 B95 Processors and are ancient.

Last fiddled with by EdH on 2021-09-20 at 02:25
EdH is offline   Reply With Quote
Old 2021-09-26, 20:56   #4
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

101778 Posts
Default

Thanks for this guide.

First small thing I ran into, under ytools: changing CC = gcc-7.3.0 to CC = gcc- didn't work for me, I tried CC = gcc and that seemed to work (I think?)


But after make NFS=1 it runs for a bit and then I get stuck?
silly me, forgot to put msieve where it should be

I do get some warnings when I use USE_AVX2=1 but I'll just skip that for now (just using NFS=1 USE_SSE41 and that seems ok).

Last fiddled with by James Heinrich on 2021-09-26 at 21:33
James Heinrich is offline   Reply With Quote
Old 2021-09-26, 22:39   #5
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

5×1,103 Posts
Default

Quote:
Originally Posted by James Heinrich View Post
Thanks for this guide.

First small thing I ran into, under ytools: changing CC = gcc-7.3.0 to CC = gcc- didn't work for me, I tried CC = gcc and that seemed to work (I think?)
Thanks! Fixed!
Quote:
Originally Posted by James Heinrich View Post
. . .

I do get some warnings when I use USE_AVX2=1 but I'll just skip that for now (just using NFS=1 USE_SSE41 and that seems ok).
I don't have any of the important options in my CPUs, so I can't really test anything. Because of that, I'm kind of limited to only providing the bare minimum.

Glad it was helpful. Thanks for the feedback.
EdH is offline   Reply With Quote
Old 2023-03-13, 19:12   #6
Mr. Odd
 
Mar 2010

22×3×5 Posts
Default

Ed - any updates to this procedure? I just tried it and get errors:
/usr/bin/ld: top/cmdParser/calc.o: in function `feval':
.../Math/yafu/top/cmdParser/calc.c:3000: undefined reference to `fftmul'
/usr/bin/ld: ./libysiqs.a(SIQS.o): in function `siqs_static_init':
.../Math/yafu/factor/qs/SIQS.c:2448: undefined reference to `nextRoots_32k_avx2_intrin'

Suggestions?
Mr. Odd is offline   Reply With Quote
Old 2023-03-13, 19:30   #7
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

EB416 Posts
Default

Quote:
Originally Posted by Mr. Odd View Post
Ed - any updates to this procedure? I just tried it and get errors:
/usr/bin/ld: top/cmdParser/calc.o: in function `feval':
.../Math/yafu/top/cmdParser/calc.c:3000: undefined reference to `fftmul'
/usr/bin/ld: ./libysiqs.a(SIQS.o): in function `siqs_static_init':
.../Math/yafu/factor/qs/SIQS.c:2448: undefined reference to `nextRoots_32k_avx2_intrin'

Suggestions?
Not EdH's fault, at least for the error related to fftmul. I must not have checked in all required files in some recent work. The file is there but there is no compile line for it in the makefile. If you can add the line involving fftmul.c to this section of your makefile that would work around this problem.

Code:
COMMON_SRCS = \
	top/aprcl/mpz_aprcl.c \
	factor/factor_common.c \
	factor/rho.c \
	factor/squfof.c \
	factor/trialdiv.c \
	arith/arith.c \
	arith/fftmul.c \
	arith/monty.c \
	factor/gmp-ecm/tinyecm.c \
	factor/gmp-ecm/micropm1.c \
    factor/gmp-ecm/microecm.c
The error involving nextRoots_32k_avx2_intrin is a little strange. It seems to imply that you built SIQS.c with BMI2 and AVX2 enabled but not the rest of yafu. Maybe try a make clean USE_AVX2=1 USE_BMI2=1 (and any other flags you use) then rebuild?

Last fiddled with by bsquared on 2023-03-13 at 19:40
bsquared is offline   Reply With Quote
Old 2023-03-14, 15:06   #8
Mr. Odd
 
Mar 2010

22×3×5 Posts
Default

Thanks, that correction and a change of flags did the trick. Love the speed increase from v1!

Last fiddled with by Mr. Odd on 2023-03-14 at 15:06
Mr. Odd 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 8 2023-04-18 17:40
How I Install ggnfs onto my Ubuntu Machines EdH EdH 6 2022-10-15 13:41
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 GMP onto my Ubuntu Machines EdH EdH 0 2018-02-21 23:48

All times are UTC. The time now is 04:06.


Sun May 28 04:06:24 UTC 2023 up 283 days, 1:34, 0 users, load averages: 1.45, 1.22, 1.04

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

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔