primesearch / cofact

Gary Gostin and Catherine Cowie’s cofact utility
GNU General Public License v3.0
2 stars 0 forks source link

Documentation, useful scripts #1

Open xanthe-cat opened 6 months ago

xanthe-cat commented 6 months ago

Scripts and other files included along with previous versions of cofact

Gary’s 0.6 to 0.8 versions distributed as .zip files included:

  1. some sample output files for $F{25},\ F{26}$, and $F_{27}$ (version 0.6);
  2. a shell script to perform, along with the output, tests of $F0$ up to $F{28}$ (versions 0.7 and 0.8).

Cathy’s versions included:

  1. from version 0.7c onward, two scripts for running the particular tests for replicating the historical testing of Fermat numbers for compositeness (“quick” and “slow”) and their output;
  2. from version 0.71c onward, a proof of $F{17}$ was included owing to its small size, to allow easy testing of the -cpr and -upr commands utilising VDF proofs. I now have generated VDF proofs for Fermat numbers as small as $F{14}$, so we could include a $F_{14}$ proof for minimum size and runtime when self-testing.
  3. from version 0.72c onward, a binary of Cathy’s pellucid program (and a shell script with output) for testing Pell–Lucas numbers (not directly relevant to this repository);
  4. also from version 0.72c onward, a version of cofact compiled to use only GMP, without gwnum (principally owing to difficulties cross-compiling cofact to run on both Intel-based Macs and Apple Silicon, seeing as gwnum relies on x86-family and similar processors).

These are “add-ons” to the repository which were useful for packaging cofact up as .zip files for distribution, so their presence here is debatable. We could decide to include useful shell scripts and output for whatever reason is convincing.

Build scripting

One other difficulty with cofact.c and the Makefile is that the gwnum files have to be available locally as they are referenced with #include "gwnum.h" (rather than <gwnum.h>; so in the .zip files that were used for distribution, Gary included a collection of pre-set symbolic links so that gwnum.a, gwnum.h, … would be easily found by unzipping within the gwnum directory.

Also, the 0.75c version in the cxc branch uses proof validation code from George Woltman that requires an additional 3 symlinks to files in the Prime95/mprime source distribution in order to compile, so it seems it would be highly useful to have a bash script to create the required sym links and then run make. If we’re going to do that, then we could do other things that are easily scriptable, such as running cofact on a suite of very quick tests to determine that it has built correctly.

Documentation

I’ll restore the README.md file once we’re happy with the two branches and all of the added files. Should we have two documentation pages for the two branches?

xanthe-cat commented 6 months ago

I’ve uploaded the $F_{14}$ proof and my “quick” shell script and output, after discovering that the script causes a chain of seg faults. I definitely think a script to create needed symlinks, make cofact, and do some quick testing has usefulness.