mersenneforum.org > EdH How I install YAFU version 2 onto my Ubuntu Machines
 Register FAQ Search Today's Posts Mark Forums Read

 2021-05-03, 16:23 #1 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 3×112×13 Posts 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/ . . . # make sure we get the correct libgmp linked by using an absolute path LIBS += -lecm /users/buhrow/src/c/gmp_install/gmp-6.2.0/lib/libgmp.a -lytools -lysieve #LIBS += -lecm -lgmp -lytools -lysieve 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/ . . . # make sure we get the correct libgmp linked by using an absolute path LIBS += -lecm /usr/local/lib/libgmp.a -lytools -lysieve #LIBS += -lecm -lgmp -lytools -lysieve 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 2021-09-29 at 12:57
 2021-09-20, 01:25 #2 Mr. Odd   Mar 2010 2·29 Posts 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?
2021-09-20, 02:20   #3
EdH

"Ed Hall"
Dec 2009

3×112×13 Posts

Quote:
 Originally Posted by Mr. Odd 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

 2021-09-26, 20:56 #4 James Heinrich     "James Heinrich" May 2004 ex-Northern Ontario 22×13×73 Posts 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
2021-09-26, 22:39   #5
EdH

"Ed Hall"
Dec 2009

3·112·13 Posts

Quote:
 Originally Posted by James Heinrich 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 . . . 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.

 Similar Threads Thread Thread Starter Forum Replies Last Post EdH EdH 2 2022-08-11 02:16 EdH EdH 3 2019-06-24 03:42 EdH EdH 12 2019-04-16 09:28 EdH EdH 0 2018-02-23 14:43 EdH EdH 0 2018-02-21 23:48

All times are UTC. The time now is 05:17.

Tue Aug 16 05:17:41 UTC 2022 up 40 days, 5 mins, 1 user, load averages: 1.21, 1.39, 1.35