View Single Post
Old 2022-12-09, 12:23   #224
paulunderwood's Avatar
Sep 2002
Database er0rr

17×283 Posts
Arrow Fresh Instructions


-- Instructions for CM Speed Ups --

0) Follow EdH's instructions to install the latest CM (on Debian based systems):

1.1) Download at least 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 near the end, before the last line:
    LIBS="$LIBS -lgwnum -lpthread -ldl -lstdc++"
5) Add this to CM's lib/ after the fist line:
    include_HEADERS += gwnum.h gwcommon.h gwthread.h giants.h gw_utility.h
6) And append to the list of C programs in lib/ gw_utility.c

7) Add to the files lib/curve.c and lib/nt.c:
    #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:
    int cm_nt_is_prime (mpz_srcptr n) {

        return ( gw_prp ( n ) );

10) Run the following commands:
    autoreconf -vfi  
    make distclean
    ./configure --enable-mpi --enable-shared=no
    make clean
    sudo make install
Attached Files
File Type: c gw_utility.c (11.0 KB, 52 views)
File Type: txt gw_utility.h.txt (551 Bytes, 65 views)

Last fiddled with by paulunderwood on 2023-09-27 at 09:08 Reason: UPDATE
paulunderwood is online now   Reply With Quote