mersenneforum.org  

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

Reply
 
Thread Tools
Old 2019-10-28, 00:42   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

24·11·19 Posts
Default How I Compile YAFU in a Colaboratory Session

(Note: I expect to keep the first post of each of these "How I..." 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.)

I will take the liberty of expecting readers to already be somewhat familiar with Google's Colaboratory sessions. There are several threads already on Colab and these should be reviewed by interested readers:

Google Colaboratory Notebook?
GPU72 Notebook Integration...
Notebook Instance Reverse SSH and HTTP Tunnels.
Colab question

I do not, as of yet, have a github account, so I have not created an upload of this to github. Others may feel free to do so, if desired.

The following is a manner to compile and install a working package of YAFU, complete with GMP, GMP-ECM, msieve and gnfs sievers from B2. When compiled YAFU will be capable of any of its standard factoring procedures, but the length of time to run larger factorizations via NFS in a Colab session is questionable.

To use Colab, you need a Gmail account and will be required to log into that account to run a session.

On to the specifics:

Open a Google Colaboratory session.
Sign in with your Google/Gmail account info.
Choose New Python3 notebook:
Code:
Menu->File->New Python3 notebook (or within popup)
Click Connect to start a session.
Edit title from Untitled... to whatever you like.
Paste the following into the Codeblock:
Code:
!chmod 777 /tmp
!apt update
!apt install g++ m4 make subversion libtool p7zip autoconf
!mkdir Math
%cd Math
!wget "https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2"
!tar -xf gmp-6.1.2.tar.bz2
!mv gmp-6.1.2 gmp
%cd gmp
!./configure
!make
############################################
# These 4 lines are recommended, but can be commented out or removed! #
############################################
!make check
!echo "Check results, then click in the"
!echo "TextBox below and press Enter to continue. . ."
!read continue in
############################################
!make install
%cd ..
!svn co svn://scm.gforge.inria.fr/svn/ecm/trunk ecm
%cd ecm
!libtoolize
!autoreconf -i
!./configure --with-gmp=/usr/local/
!make
############################################
# These 4 lines are recommended, but can be commented out or removed! #
############################################
!make check
!echo "Check results, then click in the"
!echo "TextBox below and press Enter to continue. . ."
!read continue in
############################################
!make install
%cd ..
!svn co https://svn.code.sf.net/p/msieve/code/trunk ./msieve/lib/linux/x86_64
%cd msieve/lib/linux/x86_64
!make all ECM=1 NO_ZLIB=1
%cd ../../../..
!wget "https://sites.google.com/site/bbuhrow/lasieve4_64.7z"
!7z e lasieve4_64.7z
!mkdir b2sievers
!chmod 777 gnfs-lasieve*
!mv gnfs-lasieve* b2sievers/.
!svn co https://svn.code.sf.net/p/yafu/code/trunk ./yafu
%cd yafu
!mv yafu.ini yafu.ini.orig
!echo "B1pm1=100000" >yafu.ini
!echo "B1pp1=20000" >>yafu.ini
!echo "B1ecm=11000" >>yafu.ini
!echo "rhomax=200" >>yafu.ini
!echo "threads=2" >>yafu.ini
!echo "pretest_ratio=0.25" >>yafu.ini
!echo "ggnfs_dir=../b2sievers/" >>yafu.ini
!echo "ecm_path=/usr/local/bin/ecm" >>yafu.ini
!echo "xover=93" >>yafu.ini
!echo "no_clk_test=1" >>yafu.ini
!make x86_64 NFS=1 USE_SSE41=1
Note: There are some checks and pauses written into the code that are recommended, but not strictly necessary. Feel free to comment out or remove those lines in the above code.

Click on the Run cell icon or use CTRL-Enter.
Either watch all the scrolling text or take a break. This will run for a few minutes. If you chose to leave the checks and pauses you can review the results of the GMP and ECM check runs before continuing. To continue at these breaks, you have to click in the text entry box below the message and hit Enter as instructed.

When everything is finished, if all went well, you should have a working copy of YAFU. Unfortunately, the only actual indication that all is finished is the circling of the Run cell icon stops. and the last compile line is displayed. If something failed, there may be error messages, but if all succeeded, there won't.

If you'd like to fully test YAFU, I suggest using the tune option. To perform YAFU operations, first clear the current cell or start a new one and enter your command line starting with:
Code:
!./yafu
To run tune:
Code:
!./yafu "tune"
To factor a number:
Code:
!./yafu "factor(654707893555107852929579873717948947305795737637458349294603940433680534555603)"
"tune" will take several minutes and so will the "factor" example, although the latter is somewhat quicker to return.

Last fiddled with by EdH on 2019-11-09 at 15:17
EdH is offline   Reply With Quote
Old 2019-10-28, 02:37   #2
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

29 Posts
Default

I managed to install yafu successfully with your script. Running ./yafu "tune" yielded the following tune_info line:


Code:
tune_info=           Intel(R) Xeon(R) CPU @ 2.20GHz,LINUX64,8.46183e-06,0.208774,0.386484,0.100675,99.2542,42
Dylan14 is online now   Reply With Quote
Old 2019-10-28, 03:10   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

24×11×19 Posts
Default

Quote:
Originally Posted by Dylan14 View Post
I managed to install yafu successfully with your script. Running ./yafu "tune" yielded the following tune_info line:


Code:
tune_info=           Intel(R) Xeon(R) CPU @ 2.20GHz,LINUX64,8.46183e-06,0.208774,0.386484,0.100675,99.2542,42
Excellent! Thanks for the report. My run gave a crossover of 93 digits, which I thought a bit low.
EdH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Co-Educational Notebook? Corbeau Cloud Computing 1022 2020-09-18 15:44
How I Compile the GPU branch of GMP-ECM in a Colaboratory Session EdH EdH 13 2020-06-02 11:05
Google Colaboratory reference thread kriesel kriesel 15 2020-02-09 17:40
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Your browsing session ended unexpectly davieddy Soap Box 1 2010-12-31 20:03

All times are UTC. The time now is 20:16.

Fri Sep 18 20:16:50 UTC 2020 up 8 days, 17:27, 1 user, load averages: 2.20, 2.31, 2.12

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.