UPDATED TO: https://www.mersenneforum.org/showpo...&postcount=310
-- Instructions for CM Speed Ups --
===========================
0) Follow EdH's instructions to install the latest CM (on Debian based systems):
https://mersenneforum.org/showpost.p...44&postcount=1
1.1) Download at least
p95v3010b2source.zip and unzip it in a directory.
1.2)
Note: you will have to change all "clone_lock" to "clone2_lock" in gwnum.c before compilation of gwnum.a.
1.3) Make gwnum.a (make -f make64 for 64 bit Linux) in the gwnum directory.
1.4) Copy gwnum.a to /usr/local/lib/libgwnum.a.
2) Copy gwnum.h gwcommon.h gwthread.h giants.h to CM's lib directory.
3) Download and place gw_utility.c and gw_utility.h.txt into CM's lib directory, removing the ".txt" extension from the header file.
4) Add this to CM's configure.ac near the end, before the last line:
Code:
LIBS="$LIBS -lgwnum -lpthread -ldl -lstdc++"
5) Add this to CM's lib/Makefile.am after the fist line:
Code:
include_HEADERS += gwnum.h gwcommon.h gwthread.h giants.h gw_utility.h
6) And append to the list of C programs in lib/Makefile.am: gw_utility.c
7) Add to the files lib/curve.c and lib/nt.c:
Code:
#include "gw_utility.h"
8) In lib/curve.c and lib/nt.c change all mpz_powm to gw_powm
9) In lib/nt.c overwrite:
Code:
int cm_nt_is_prime (mpz_srcptr n) {
return ( gw_prp ( n ) );
}
10) Run the following commands:
Code:
autoreconf -vfi
make distclean
./configure --enable-mpi --enable-shared=no
make clean
make
sudo make install