[Ecm-dev] New patch

Alexander Kruppa alexander.kruppa at mytum.de
Sam 21 Mai 10:21:34 CEST 2005


Hi George,

sorry, the last patch didn't work at all.

I've since managed to get the GWNUM library to compile. One problem was with

#if (__GNUC_MAJOR__<=2 && __GNUC_MINOR__<=6)

in dbldbl/doubledouble.h. Apparantly __GNUC_MAJOR__ is not predefined by
gpp, for version 3.3 anyways. It is called __GNUC__ instead:

`__GNUC__'
`__GNUC_MINOR__'
`__GNUC_PATCHLEVEL__'
         These macros are defined by all GNU compilers that use the C
         preprocessor: C, C++, and Objective-C.  Their values are the major
         version, minor version, and patch level of the compiler, as integer
         constants.  For example, GCC 3.2.1 will define `__GNUC__' to 3,
         `__GNUC_MINOR__' to 2, and `__GNUC_PATCHLEVEL__' to 1.  They are
         defined only when the entire compiler is in use; if you invoke the
         preprocessor directly, they are not defined.


Maybe versions <=2 used __GNUC_MAJOR__. I replaced the #if by

#if (__GNUC_MAJOR__>0 && __GNUC_MAJOR__<=2 && __GNUC_MINOR__<=6)

which makes the condition fail if __GNUC_MAJOR__ is not defined.

The linker then complained that __gxx_personality_v0 wasn't defined.
Some googling turned up the suggestion to simply define a function
that exits, as it is intended as an exception handler.

After that, I could build and link the library.

Unfortunately, the stage 1 residues don't come out right yet. I.e.

GMP-ECM 6.0.1 [powered by GMP 4.1.4 and GWNUM 24.11] [ECM]
Due to incompatible licenses, this binary file must not be distributed.
Input number is (2^773-1)/9461521/6864241 (219 digits)
Using special division for factor of 2^773-1
Using B1=100, B2=1, polynomial x^1, sigma=123
a=337099428253975967530913550191920196311157977366017163901351962948756236762170170662304121426474257062422908854834681205609101536842248473012144599774150471773231136211879983636795551079233564304088075459149653535958894
starting point:
x=492811129672289330477015244375408366430504513582047785628634359451726193014494406726196983329237416026155375037932303647041971510318875264649494863917420641940570291440772799801114665548997363513001036426082626829947115
Using gwnum_ecmStage1(1.000000, 2, 773, -1, , 100, 1)
Step 1 took 80ms
x=573205349706726173247619169126540247579284073194704534602573160038285875635900538118816307868951452540787630179484040880247394745569724251922038414542083997593562624858908008784754382472967896472423427775292489251219884

but

GMP-ECM 6.0.1 [powered by GMP 4.1.4] [ECM]
Input number is (2^773-1)/9461521/6864241 (219 digits)
Using special division for factor of 2^773-1
Using B1=100, B2=1, polynomial x^1, sigma=123
a=337099428253975967530913550191920196311157977366017163901351962948756236762170170662304121426474257062422908854834681205609101536842248473012144599774150471773231136211879983636795551079233564304088075459149653535958894
starting point:
x=492811129672289330477015244375408366430504513582047785628634359451726193014494406726196983329237416026155375037932303647041971510318875264649494863917420641940570291440772799801114665548997363513001036426082626829947115
Step 1 took 10ms
x=172226571008100811295614676063164455408246523407493927771045964334413764584540460231897733510182163892800928640973423456869044892265706875693159527542523024892265439270169846661652639725286025531280728481508541363790146

If I do stage 1 with mprime and resume with gmp-ec, I get the same
residue as with the GMP-ECM without GWNUM.

I'm attaching the relevant patches.

To compile gmp-ecm 6.0.1 with the GWNUM library, simply use the 
--with-gwnum= option at configure time.

Alex




-------------- section suivante --------------
An embedded and charset-unspecified text was scrubbed...
Name: doubledouble.patch
Url: http://lists.gforge.inria.fr/pipermail/ecm-discuss/attachments/20050521/bb83d44c/attachment.txt 
-------------- section suivante --------------
An embedded and charset-unspecified text was scrubbed...
Name: ecm.patch
Url: http://lists.gforge.inria.fr/pipermail/ecm-discuss/attachments/20050521/bb83d44c/attachment-0001.txt 
-------------- section suivante --------------
An embedded and charset-unspecified text was scrubbed...
Name: gwdbldbl.patch
Url: http://lists.gforge.inria.fr/pipermail/ecm-discuss/attachments/20050521/bb83d44c/attachment-0002.txt 


Plus d'informations sur la liste de diffusion Ecm-discuss