mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2007-11-01, 23:29   #1
leizhoucn
 
Oct 2007

210 Posts
Default GWNUM library and llr

Hello,

I tried to compile the Jean Penne's LLR on linux (downloaded from
http://perso.orange.fr/jean.penne/index2.html) however it end up
with error:

$ make
[ ! -e ../security.h ] && touch ../security.h || true
[ ! -e ../security.c ] && touch ../security.c || true
gcc -Wl -o sllr factor32p.o lprime.o lmenu.o ../gwnum.orig/gwnum.ld ../gwnum.orig/gwnum.a -lm -lstdc++ -static
../gwnum.orig/gwnum.a(giants.o)(.text+0x5be5): In function `ctog':
: undefined reference to `__ctype_b'
../gwnum.orig/gwnum.a(giants.o)(.text+0x5c10): In function `ctog':
: undefined reference to `__ctype_b'
collect2: ld returned 1 exit status
make: *** [sllr] Error 1

My OS is RHEL4.

I then downloaded the gwnum from http://www.mersenne.org/gimps/
in place of the gwnum directory coming with LLR. It successfully built
and linked llr and sllr.

However, when I test it with some known small k*n^2-1 primes (k and n
< 100,000), it always results that they are not prime. What could this be?
Any known cure I can apply?

Many thanks in advance.

Lei
leizhoucn is offline   Reply With Quote
Old 2007-11-02, 16:41   #2
leizhoucn
 
Oct 2007

28 Posts
Default Additional info

I managed through the __ctype_b issue and have the llr/sllr built
up on the GWNUM library coming with the llr37b source code. However,
when I try it it returns nothing but "Segmentation fault".

For the llr compiled upon the GWNUM from mersenne.org, for example,

for an input

43877687885950:M:1:2:2
87 21701
97 21701
117 21701
139 21701
175 21701
90579 21701
96285 21701

The correct result should be:

87*2^21701-1 is not prime. LLR Res64: F1F1CAB10998A666 Time : 1.416 sec.
97*2^21701-1 is not prime. LLR Res64: 0625B2239D6162A0 Time : 1.447 sec.
117*2^21701-1 is not prime. LLR Res64: 695C7BB6FBA6EC77 Time : 1.468 sec.
139*2^21701-1 is not prime. LLR Res64: 853E046E1933E387 Time : 1.474 sec.
175*2^21701-1 is not prime. LLR Res64: 8A0F1CD9BE66C42F Time : 1.473 sec.
90579*2^21701-1 is prime! Time : 2.366 sec.
96285*2^21701-1 is prime! Time : 2.378 sec.


However, the newly compiled llr gives:
87*2^21701-1 is not prime. LLR Res64: 41B59F4E8F5057EA Time : 1.460 sec.
97*2^21701-1 is not prime. LLR Res64: 25FE42384E5C5C0C Time : 1.464 sec.
117*2^21701-1 is not prime. LLR Res64: D0AA98367869DD97 Time : 1.489 sec.
139*2^21701-1 is not prime. LLR Res64: B1E4CA0931CF8DF6 Time : 1.491 sec.
175*2^21701-1 is not prime. LLR Res64: AA4E1F483E27EF14 Time : 1.488 sec.
90579*2^21701-1 is not prime. LLR Res64: 9282E6C9B027C08E Time : 2.421 sec.
96285*2^21701-1 is not prime. LLR Res64: 91C8126F273B2B1E Time : 2.424 sec.

It is done at the same speed, but totally different LLR Res64.

What could the problem be?

More information:
The mersenne.org version of GWNUM is dated June 8 2005;
the llr version of GWNUM is dated May 6 2007, with the header files of Jul 24 2005.

Rebuilt GWNUM lib locally results exactly the same with the mersenne.org
downloaded lib.


Any idea of diagnosis/debug?

Many thanks!
leizhoucn is offline   Reply With Quote
Old 2007-11-05, 09:34   #3
Jean Penné
 
Jean Penné's Avatar
 
May 2004
FRANCE

22·5·29 Posts
Default Unresolved reference?

Quote:
Originally Posted by leizhoucn View Post
Hello,

I tried to compile the Jean Penne's LLR on linux (downloaded from
http://perso.orange.fr/jean.penne/index2.html) however it end up
with error:

$ make
[ ! -e ../security.h ] && touch ../security.h || true
[ ! -e ../security.c ] && touch ../security.c || true
gcc -Wl -o sllr factor32p.o lprime.o lmenu.o ../gwnum.orig/gwnum.ld ../gwnum.orig/gwnum.a -lm -lstdc++ -static
../gwnum.orig/gwnum.a(giants.o)(.text+0x5be5): In function `ctog':
: undefined reference to `__ctype_b'
../gwnum.orig/gwnum.a(giants.o)(.text+0x5c10): In function `ctog':
: undefined reference to `__ctype_b'
collect2: ld returned 1 exit status
make: *** [sllr] Error 1

My OS is RHEL4.

I then downloaded the gwnum from http://www.mersenne.org/gimps/
in place of the gwnum directory coming with LLR. It successfully built
and linked llr and sllr.

However, when I test it with some known small k*n^2-1 primes (k and n
< 100,000), it always results that they are not prime. What could this be?
Any known cure I can apply?

Many thanks in advance.

Lei

Please, would you tell me how you resolved the "undefined reference to `__ctype_b'" problem while linking with my "gwnum.a" ?

I have not this problem on my Linux system, but I know other persons who do have this problem...
Thank you by advance, and best regards,
Jean
Jean Penné is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime numbers library Martin Lounge 12 2017-12-02 17:18
Using YAFU as a C-library LangerJan YAFU 2 2013-02-17 06:18
factoring with MIRACL library prss Factoring 22 2011-06-15 20:25
Quickest fft library nuggetprime Software 3 2011-01-09 01:24
GWNUM library bearnol Software 6 2006-02-24 11:19

All times are UTC. The time now is 21:59.


Thu Oct 28 21:59:29 UTC 2021 up 97 days, 16:28, 0 users, load averages: 1.32, 1.37, 1.35

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.