mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2013-01-13, 18:02   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

4,001 Posts
Default Error with large number on 32-bit machines

How disappointing!

On my 32-bit machines (both antiX and Ubuntu), on which I compiled GMP and ECM, I am receiving the following error:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Running on math03
Input number is 16314315482963226490821946080971549450706222359508882207070502298741881754665051765380282665291356409074285196429704092132126707585162244439000837928127809542351956738323750370087594623357586179416038045807359853 (212 digits)
Using MODMULN [mulredc:4, sqrredc:4]
ecm: symbol lookup error: ecm: undefined symbol: __gmpn_add_nc
They work with a smaller input number:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Running on math02
Input number is 326286309659264529816438921619430989014124447190177644141410045974837635093301035307605653305827 (96 digits)
Using MODMULN [mulredc:0, sqrredc:0]
Using B1=43000000, B2=240490660426, polynomial Dickson(12), sigma=3200203337
dF=65536, k=5, d=690690, d2=17, i0=46
Expected number of curves to find a factor of n digits:
35    40    45    50    55    60    65    70    75    80
55    246    1286    7557    49831    361851    2844041    2.4e+07    2.2e+08    2.2e+09
Step 1 took 542085ms
********** Factor found in step 1: 86635039
Found composite factor of  8 digits: 86635039
Composite cofactor 3766216457284269587694638443221927666173549563360589520152579904475343227966931893544893 has 88 digits
A 32-bit Ubuntu machine using a repository version seems to be OK with the larger number:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.3 [configured with GMP 5.0.2] [ECM]
Running on math01
Input number is 16314315482963226490821946080971549450706222359508882207070502298741881754665051765380282665291356409074285196429704092132126707585162244439000837928127809542351956738323750370087594623357586179416038045807359853 (212 digits)
Using MODMULN
Using B1=43000000, B2=240490660426, polynomial Dickson(12), sigma=3523070894
dF=65536, k=5, d=690690, d2=17, i0=46
Expected number of curves to find a factor of n digits:
35    40    45    50    55    60    65    70    75    80
55    246    1286    7557    49831    361851    2844041    2.4e+07    2.2e+08    2.2e+09
Any thoughts are welcome...
EdH is offline   Reply With Quote
Old 2013-01-13, 18:35   #2
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

2ACA16 Posts
Default

Quote:
Originally Posted by EdH View Post
How disappointing!

On my 32-bit machines (both antiX and Ubuntu), on which I compiled GMP and ECM, I am receiving the following error:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Running on math03
Input number is 16314315482963226490821946080971549450706222359508882207070502298741881754665051765380282665291356409074285196429704092132126707585162244439000837928127809542351956738323750370087594623357586179416038045807359853 (212 digits)
Using MODMULN [mulredc:4, sqrredc:4]
ecm: symbol lookup error: ecm: undefined symbol: __gmpn_add_nc
They work with a smaller input number:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Running on math02
Input number is 326286309659264529816438921619430989014124447190177644141410045974837635093301035307605653305827 (96 digits)
Using MODMULN [mulredc:0, sqrredc:0]
Using B1=43000000, B2=240490660426, polynomial Dickson(12), sigma=3200203337
dF=65536, k=5, d=690690, d2=17, i0=46
Expected number of curves to find a factor of n digits:
35    40    45    50    55    60    65    70    75    80
55    246    1286    7557    49831    361851    2844041    2.4e+07    2.2e+08    2.2e+09
Step 1 took 542085ms
********** Factor found in step 1: 86635039
Found composite factor of  8 digits: 86635039
Composite cofactor 3766216457284269587694638443221927666173549563360589520152579904475343227966931893544893 has 88 digits
A 32-bit Ubuntu machine using a repository version seems to be OK with the larger number:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.3 [configured with GMP 5.0.2] [ECM]
Running on math01
Input number is 16314315482963226490821946080971549450706222359508882207070502298741881754665051765380282665291356409074285196429704092132126707585162244439000837928127809542351956738323750370087594623357586179416038045807359853 (212 digits)
Using MODMULN
Using B1=43000000, B2=240490660426, polynomial Dickson(12), sigma=3523070894
dF=65536, k=5, d=690690, d2=17, i0=46
Expected number of curves to find a factor of n digits:
35    40    45    50    55    60    65    70    75    80
55    246    1286    7557    49831    361851    2844041    2.4e+07    2.2e+08    2.2e+09
Any thoughts are welcome...
When you installed GMP and ECM did you run "make check" as recommended?
xilman is offline   Reply With Quote
Old 2013-01-13, 19:19   #3
WraithX
 
WraithX's Avatar
 
Mar 2006

2×35 Posts
Default

Quote:
Originally Posted by EdH View Post
On my 32-bit machines (both antiX and Ubuntu), on which I compiled GMP and ECM, I am receiving the following error:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
<snip>
ecm: symbol lookup error: ecm: undefined symbol: __gmpn_add_nc
Any thoughts are welcome...
Can you give us the output of "ecm -printconfig". I'm curious to see if you have the following line:
HAVE___GMPN_ADD_NC = 1
Also, if you could post a zipped up copy of your config.log, that might help us track this down.

Now, I'm not sure what would cause this problem, but, since you are building these things yourself, could you try the following as a temporary work-around:
1) In your ecm directory run "make clean"
2) Then run your "./configure" again
3) Then, go into the config.h and if you find the following line:
#define HAVE___GMPN_ADD_NC 1
replace it with:
/* #define HAVE___GMPN_ADD_NC 1 */
4) Then run "make" and "make check" to be sure those complete successfully
5) Then try your number again and let us know the results

Hopefully we can figure this out.
WraithX is offline   Reply With Quote
Old 2013-01-13, 20:15   #4
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

3×1,609 Posts
Default

Quote:
Originally Posted by WraithX View Post
Can you give us the output of "ecm -printconfig". I'm curious to see if you have the following line:
HAVE___GMPN_ADD_NC = 1
Also, if you could post a zipped up copy of your config.log, that might help us track this down.

Now, I'm not sure what would cause this problem, but, since you are building these things yourself, could you try the following as a temporary work-around:
1) In your ecm directory run "make clean"
2) Then run your "./configure" again
3) Then, go into the config.h and if you find the following line:
#define HAVE___GMPN_ADD_NC 1
replace it with:
/* #define HAVE___GMPN_ADD_NC 1 */
4) Then run "make" and "make check" to be sure those complete successfully
5) Then try your number again and let us know the results

Hopefully we can figure this out.
Hey, that workatound resolved MY compile problem with
#define HAVE___GMPN_REDC_1 1

Thank you!

Luigi
ET_ is offline   Reply With Quote
Old 2013-01-13, 22:36   #5
WraithX
 
WraithX's Avatar
 
Mar 2006

2×35 Posts
Default

Quote:
Originally Posted by ET_ View Post
Hey, that workatound resolved MY compile problem with
#define HAVE___GMPN_REDC_1 1

Thank you!

Luigi
Hmmm, if so then that means that ./configure might be missing something or messing something up. Can you post a zipped up copy of your config.log so we can see what might be going wrong?
WraithX is offline   Reply With Quote
Old 2013-01-13, 23:22   #6
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

3×1,609 Posts
Default

Quote:
Originally Posted by WraithX View Post
Hmmm, if so then that means that ./configure might be missing something or messing something up. Can you post a zipped up copy of your config.log so we can see what might be going wrong?
Here it is!

I can add that all the tests done with make check were ok after the update.

Luigi
Attached Files
File Type: zip config.log.zip (11.5 KB, 163 views)
ET_ is offline   Reply With Quote
Old 2013-01-14, 03:11   #7
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

4,001 Posts
Default

Thanks, everyone!

@xilman: Yes!
Code:
...
NOTE: NEXT TEST WILL FAIL ON 32BIT MACHINES, THIS IS EXPECTED.
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [P+1]
Input number is 8589934621 (10 digits)
Using B1=4294967310-4294967311, B2=1, polynomial x^1
Step 1 took 48ms
********** Factor found in step 1: 8589934621
Found input number N
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [P+1]
Input number is 6054018161*10^400+417727253109 (410 digits)
Using B1=2000, B2=2352760, polynomial x^1, x0=4
./ecm: symbol lookup error: ./ecm: undefined symbol: __gmpn_add_nc
############### ERROR ###############
Expected return code 14 but got 127
make: *** [check] Error 1
I took the NOTE above to mean the error I received.

@WraithX:
Code:
$ ecm -printconfig
Compilation options:
Included GMP header files version 5.0.5
GWNUM_VERSION undefined
HAVE_SSE2 = 1
$HAVE___GMPN_ADD_NC = 1
HAVE___GMPN_MOD_34LSUB1 = 1
HAVE___GMPN_REDC_1 = 1
MEMORY_DEBUG undefined
USE_ASM_REDC undefined
WANT_ASSERT undefined
WANT_SHELLCMD undefined
_OPENMP undefined
MPZMOD_THRESHOLD = 84
REDC_THRESHOLD = 119
MUL_NTT_THRESHOLD = 4096
NTT_GFP_TWIDDLE_DIF_BREAKOVER = 17
NTT_GFP_TWIDDLE_DIT_BREAKOVER = 17
PREREVERTDIVISION_NTT_THRESHOLD = 64
POLYINVERT_NTT_THRESHOLD = 1024
POLYEVALT_NTT_THRESHOLD = 512
MPZSPV_NORMALISE_STRIDE = 2048
That line has a preceding "$" instead of just the line. The config.log is zipped below.

Here is the result of commenting out the "#define HAVE___GMPN_ADD_NC 1" line:
Code:
...
NOTE: NEXT 3 TESTS WILL FAIL ON SOME 32BIT MACHINES, THIS IS EXPECTED.
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Input number is 10000000000000000000000000000000000000121 (41 digits)
Using B1=2950307, B2=4281751120, polynomial Dickson(6), sigma=61
Step 1 took 20229ms
********** Factor found in step 1: 10000000000000000000000000000000000000121
Found input number N
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Input number is 10000000000000000000000000000000000000121 (41 digits)
Using B1=9405629, B2=23422152400, polynomial Dickson(12), sigma=266
Step 1 took 65384ms
********** Factor found in step 1: 10000000000000000000000000000000000000121
Found input number N
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Input number is 10000000000000000000000000000000000000121 (41 digits)
Using B1=4372759, B2=8561918830, polynomial Dickson(6), sigma=291
Step 1 took 30265ms
********** Factor found in step 1: 10000000000000000000000000000000000000121
Found input number N
All ECM tests are ok.
And, trying the 212 digit number again:
Code:
$ ecm -c 10 -v 43000000 < ecmIn
GMP-ECM 6.4.3 [configured with GMP 5.0.5] [ECM]
Running on math02
Input number is 16314315482963226490821946080971549450706222359508882207070502298741881754665051765380282665291356409074285196429704092132126707585162244439000837928127809542351956738323750370087594623357586179416038045807359853 (212 digits)
Using MODMULN [mulredc:4, sqrredc:4]
Using B1=43000000, B2=240490660426, polynomial Dickson(12), sigma=2155976667
dF=65536, k=5, d=690690, d2=17, i0=46
Expected number of curves to find a factor of n digits:
35    40    45    50    55    60    65    70    75    80
55    246    1286    7557    49831    361851    2844041    2.4e+07    2.2e+08    2.2e+09
It appears to be working, but I suppose I'll have to wait quite some time for a result to show up.
Attached Files
File Type: zip config.log.zip (9.4 KB, 163 views)

Last fiddled with by EdH on 2013-01-14 at 03:11
EdH is offline   Reply With Quote
Old 2013-01-15, 03:11   #8
WraithX
 
WraithX's Avatar
 
Mar 2006

2·35 Posts
Default

Quote:
Originally Posted by EdH View Post
That line has a preceding "$" instead of just the line. The config.log is zipped below.

It appears to be working, but I suppose I'll have to wait quite some time for a result to show up.
@EdH
Did you put the "$" in front of it? I don't see anything in the code that would print out a "$" in front of that line.

I'm wondering if there might be multiple gmp.h or libgmp.a or libgmp.so* files on your computer? We can try to find out by seeing what all paths are defined in your environment with the following command:
env | grep -i path
(At this point I'm not sure how to search a PATH [or LD_LIBRARY_PATH] variable for a certain file, any linux gurus know???)

Then, we need to find out what library your binary is linking to. Can you run ldd on your ecm binary? Like so:
ldd ecm
We're interested in the line with libgmp.so, it could look like:
libgmp.so.10 => /usr/local/lib/libgmp.so.10
Once you have that, can you try running nm on the lib from above? Like:
nm /usr/local/lib/libgmp.so.10 | grep -i add_nc

Theoretically, that might come up empty. My guess at that point will be that you have another libgmp (.a, .so), perhaps in /usr/lib/. If so, could you try the nm+grep command on that libgmp too? I think one will have the add_nc, and the other won't. Let's see where this gets us.


@ET_
What problem were you running into, specifically? If you're using a recent GMP (5.0+) that you've compiled yourself, it should have mpn_redc_1. Was GMP-ECM not compiling for you? Or were you getting errors while running? What version of GMP are you using? Is it pre-compiled or did you build it yourself? I'd like to fix any problems rather than spread the above "work-around" to too many people.
WraithX is offline   Reply With Quote
Old 2013-01-15, 03:52   #9
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

722110 Posts
Default

A better command might be `locate libgmp.a libgmp.so`, and then comparing that to what ldd says.
Dubslow is offline   Reply With Quote
Old 2013-01-15, 06:07   #10
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

4,001 Posts
Default

Quote:
Originally Posted by WraithX View Post
@EdH
Did you put the "$" in front of it? I don't see anything in the code that would print out a "$" in front of that line.
Nope! That's how it appeared when I opened it.

Quote:
Originally Posted by WraithX View Post
I'm wondering if there might be multiple gmp.h or libgmp.a or libgmp.so* files on your computer? We can try to find out by seeing what all paths are defined in your environment with the following command:
env | grep -i path
(At this point I'm not sure how to search a PATH [or LD_LIBRARY_PATH] variable for a certain file, any linux gurus know???)
Code:
$ env | grep -i path
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Quote:
Originally Posted by WraithX View Post
Then, we need to find out what library your binary is linking to. Can you run ldd on your ecm binary? Like so:
ldd ecm
Code:
$ ldd ecm
ldd: ./ecm: No such file or directory

Code:
$ whereis libecm
libecm: /usr/local/lib/libecm.a /usr/local/lib/libecm.la
Code:
$ whereis libgmp
libgmp: /usr/local/lib/libgmp.so /usr/local/lib/libgmp.la /usr/local/lib/libgmp.a
Quote:
Originally Posted by WraithX View Post
We're interested in the line with libgmp.so, it could look like:
libgmp.so.10 => /usr/local/lib/libgmp.so.10
Once you have that, can you try running nm on the lib from above? Like:
nm /usr/local/lib/libgmp.so.10 | grep -i add_nc
Code:
$ nm /usr/local/lib/libgmp.so | grep -i add_nc
00021340 T __gmpn_add_nc
Code:
$ nm /usr/local/lib/libgmp.la | grep -i add_nc
nm: /usr/local/lib/libgmp.la: File format not recognized
Code:
$ nm /usr/local/lib/libgmp.a | grep -i add_nc
00000000 T __gmpn_add_nc
         U __gmpn_add_nc
         U __gmpn_add_nc
         U __gmpn_add_nc
         U __gmpn_add_nc
Quote:
Originally Posted by WraithX View Post
Theoretically, that might come up empty. My guess at that point will be that you have another libgmp (.a, .so), perhaps in /usr/lib/. If so, could you try the nm+grep command on that libgmp too? I think one will have the add_nc, and the other won't. Let's see where this gets us.
Here's the locate command, but ldd didn't work (above), so there's nothing to compare:
Code:
$ locate libgmp
/home/math02/Math/ggnfs/src/lasieve4/libgmp-aux.a
/home/math02/Math/gmp/libgmp.la
/home/math02/Math/gmp/.libs/libgmp.a
/home/math02/Math/gmp/.libs/libgmp.la
/home/math02/Math/gmp/.libs/libgmp.lai
/home/math02/Math/gmp/.libs/libgmp.so
/home/math02/Math/gmp/.libs/libgmp.so.10
/home/math02/Math/gmp/.libs/libgmp.so.10.0.5
/usr/lib/i386-linux-gnu/libgmp.so.10
/usr/lib/i386-linux-gnu/libgmp.so.10.0.5
/usr/lib/i386-linux-gnu/openssl-1.0.0/engines/libgmp.so
/usr/local/lib/libgmp.a
/usr/local/lib/libgmp.la
/usr/local/lib/libgmp.so
/usr/local/lib/libgmp.so.10
/usr/local/lib/libgmp.so.10.0.5
/usr/share/doc/libgmp10
/usr/share/doc/libgmp10/README.Debian
/usr/share/doc/libgmp10/TODO.Debian
/usr/share/doc/libgmp10/changelog.Debian.gz
/usr/share/doc/libgmp10/copyright
/var/lib/dpkg/info/libgmp10:i386.list
/var/lib/dpkg/info/libgmp10:i386.md5sums
/var/lib/dpkg/info/libgmp10:i386.postinst
/var/lib/dpkg/info/libgmp10:i386.postrm
/var/lib/dpkg/info/libgmp10:i386.shlibs
Thanks for all the help...
EdH is offline   Reply With Quote
Old 2013-01-15, 07:55   #11
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

482710 Posts
Default

Quote:
Originally Posted by WraithX View Post

@ET_
What problem were you running into, specifically? If you're using a recent GMP (5.0+) that you've compiled yourself, it should have mpn_redc_1. Was GMP-ECM not compiling for you? Or were you getting errors while running? What version of GMP are you using? Is it pre-compiled or did you build it yourself? I'd like to fix any problems rather than spread the above "work-around" to too many people.
IIRC, there had been a "duplicate definition" issue between ecm-gmp.h and gmp.h while making the source, after [auto]configurations ran ok.

I was using MPIR 2.5.1 compiled to use GMP 5.0.2 configuration files. Yes I configured and compiled it [by] myself.

I already uploaded the config.log file to the forum, on another subthread of this section.

Luigi
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Prone Machines PageFault Data 17 2012-04-10 01:40
Scalability of Glucas on large machines: A future //ed prime 95 ? T.Rex Software 29 2006-12-13 21:40
Start and Stop Prime 95 on Large Groups of Windows XP Machines MarcGetty Software 3 2006-03-07 07:54
Putting prime 95 on a large number of machines moo Software 10 2004-12-15 13:25
Team_Prime_Rib error-prone machines GP2 Data 10 2003-10-05 18:34

All times are UTC. The time now is 15:28.


Wed Oct 20 15:28:00 UTC 2021 up 89 days, 9:56, 0 users, load averages: 3.14, 2.71, 2.24

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.