mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2017-03-02, 04:21   #1
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

185510 Posts
Default Building sr1sieve for RPi

I'm trying to build sr1sieve on the RPi Model 3B running Raspbian Jessie 4.4 (32-bit), and encountering the following error:
Code:
gcc -O2 -ffast-math -march=armv8-a -mtune=cortex-a53  -Wall -DNDEBUG  -c -o sr1sieve.o sr1sieve.c
In file included from sr1sieve.c:23:0:
arithmetic.h: In function ‘PRE2_MULMOD64_INIT’:
arithmetic.h:97:3: error: ‘b_over_p’ undeclared (first use in this function)
   b_over_p = (double)((int64_t)b) * one_over_p;
The relevant line from arithmetic.h is:
Code:
extern double _b_over_p;
GCC is version 4.9.2.

This obviously isn't an emergency, but I'd like to learn more about the Pi and what it can do. Thanks for any help.
wombatman is offline   Reply With Quote
Old 2017-03-02, 09:43   #2
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

485910 Posts
Default

Quote:
Originally Posted by wombatman View Post
I'm trying to build sr1sieve on the RPi Model 3B running Raspbian Jessie 4.4 (32-bit), and encountering the following error:
Code:
gcc -O2 -ffast-math -march=armv8-a -mtune=cortex-a53  -Wall -DNDEBUG  -c -o sr1sieve.o sr1sieve.c
In file included from sr1sieve.c:23:0:
arithmetic.h: In function ‘PRE2_MULMOD64_INIT’:
arithmetic.h:97:3: error: ‘b_over_p’ undeclared (first use in this function)
   b_over_p = (double)((int64_t)b) * one_over_p;
The relevant line from arithmetic.h is:
Code:
extern double _b_over_p;
GCC is version 4.9.2.

This obviously isn't an emergency, but I'd like to learn more about the Pi and what it can do. Thanks for any help.
I *suppose* it's an issue related to the 32-bit OS not having 64-bit instructions. I had a similar error on my RPI 3 when I tried to compile my own sieve (but here I also had an asm instruction I had to recode in C, so I could be proved wrong).
ET_ is offline   Reply With Quote
Old 2017-03-02, 14:45   #3
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

5×7×53 Posts
Default

It could be, but I can't even get the 32-bit versions to build. I had no problems getting the GGNFS sievers to build a 32-bit version, but this one has stumped me so far.
wombatman is offline   Reply With Quote
Old 2017-03-02, 20:36   #4
Thomas11
 
Thomas11's Avatar
 
Feb 2003

192010 Posts
Default

You can easily change this line:
Code:
extern double _b_over_p;
into
Code:
extern double b_over_p;
Then it should compile without any problems.

I tried this on a Pi2 using the source code version 1.4.5 of sr1sieve and got a stable binary.
The single core performance is about 1/20th of a single i3770 core.
Thomas11 is offline   Reply With Quote
Old 2017-03-02, 20:41   #5
Thomas11
 
Thomas11's Avatar
 
Feb 2003

27·3·5 Posts
Default

I forgot to mention that in the Makefile you need to disable the x86 assembly code:
Code:
ASSEMBLER=no
And also unselect any predefined architecture, e.g.:
Code:
#ARCH=x86_64
Thomas11 is offline   Reply With Quote
Old 2017-03-02, 20:48   #6
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

5·7·53 Posts
Default

Fantastic! I'll try this at home tonight.
wombatman is offline   Reply With Quote
Old 2017-03-03, 00:07   #7
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

185510 Posts
Default

Just writing to confirm that your steps worked, and that the performance of the binary is atrocious. 4-threads on an i7-4930K gives about 125-130 million p/sec. 4-threads on the Model 3B gives about 5 million p/sec. Still, now have something to mess with, and I can try some other compilation with it. Thanks again!
wombatman is offline   Reply With Quote
Old 2017-03-03, 16:30   #8
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

43·113 Posts
Default

Quote:
Originally Posted by wombatman View Post
Just writing to confirm that your steps worked, and that the performance of the binary is atrocious. 4-threads on an i7-4930K gives about 125-130 million p/sec. 4-threads on the Model 3B gives about 5 million p/sec. Still, now have something to mess with, and I can try some other compilation with it. Thanks again!
Just to be sure... did you compare the results of the sieve between Inter and Arm versions? Do they sieve the same results and find the same factors?
ET_ is offline   Reply With Quote
Old 2017-03-03, 16:46   #9
Thomas11
 
Thomas11's Avatar
 
Feb 2003

27·3·5 Posts
Default

Quote:
Originally Posted by ET_ View Post
Just to be sure... did you compare the results of the sieve between Inter and Arm versions? Do they sieve the same results and find the same factors?
I did it at my end on the Pi2B, and the results and factors are matching.

Last fiddled with by Thomas11 on 2017-03-03 at 16:47
Thomas11 is offline   Reply With Quote
Old 2017-03-03, 17:05   #10
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

34778 Posts
Default

Quote:
Originally Posted by ET_ View Post
Just to be sure... did you compare the results of the sieve between Inter and Arm versions? Do they sieve the same results and find the same factors?
I did not, but I won't be able to for now. I'm currently working on getting the Gentoo 64-bit image loaded and working properly. I'm having some overheating issues at the moment.
wombatman is offline   Reply With Quote
Old 2017-03-03, 17:52   #11
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

485910 Posts
Default

Quote:
Originally Posted by wombatman View Post
I did not, but I won't be able to for now. I'm currently working on getting the Gentoo 64-bit image loaded and working properly. I'm having some overheating issues at the moment.
Keep me informed about it :-) I suppose you could get a 2.5x speedup from using the Arm8 code, the FPUs and the 64bits.

Last fiddled with by ET_ on 2017-03-03 at 17:53
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
sr1sieve with work files? masser Conjectures 'R Us 1 2017-12-28 17:43
32-bit of sr1sieve and sr2sieve for Win pepi37 Software 5 2013-08-09 22:31
Building gcc 4.4.0 CRGreathouse Software 1 2009-07-07 22:25
sr1sieve and big P barcode Software 5 2007-12-27 04:05
sr1sieve 1.2.0 arminius Riesel Prime Search 14 2007-12-02 22:53

All times are UTC. The time now is 17:19.


Tue Mar 28 17:19:39 UTC 2023 up 222 days, 14:48, 0 users, load averages: 0.68, 0.72, 0.78

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

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔