mersenneforum.org sieving on Playstation Portable
 Register FAQ Search Today's Posts Mark Forums Read

 2007-03-04, 01:46 #1 jasong     "Jason Goatcher" Mar 2005 3·7·167 Posts sieving on Playstation Portable This may sound nutty, but I´ve been led to believe that´s it´s possible to do sieving on the Playstation Portable. Is this possible? And if so, could someone help me compile a binary?
2007-03-06, 21:35   #2
geoff

Mar 2003
New Zealand

13×89 Posts

Quote:
 Originally Posted by jasong This may sound nutty, but I´ve been led to believe that´s it´s possible to do sieving on the Playstation Portable. Is this possible? And if so, could someone help me compile a binary?
Compiling srsieve for the Playstation should not be much different from compiling any other C program for the Playstation, but I don't know how to do that either.

If you can install Linux on the machine itself then just run make' on the source, that should produce a working binary, though without hand-coded assembler it will run at about half its potential speed.

2007-03-11, 01:33   #3
jasong

"Jason Goatcher"
Mar 2005

3·7·167 Posts

Quote:
 Originally Posted by geoff Compiling srsieve for the Playstation should not be much different from compiling any other C program for the Playstation, but I don't know how to do that either. If you can install Linux on the machine itself then just run make' on the source, that should produce a working binary, though without hand-coded assembler it will run at about half its potential speed.
Anything I should do or know before I get to the make command? In other words, if I wanted to tweak the code, or actually tell the code to tweak itself(since I'm not a programmer) what should I be finding out about?

 2007-03-11, 01:37 #4 thommy     Dec 2006 3310 Posts why don't you try it first? do you even have and linux psp, or do you just wanna know? cheers
 2007-03-11, 06:58 #5 jasong     "Jason Goatcher" Mar 2005 3×7×167 Posts This is what I get when I type make: Code: $make gcc -O2 -DNDEBUG -c -o srsieve.o srsieve.c gcc -O2 -DNDEBUG -c -o arithmetic32.o arithmetic32.c gcc -O2 -DNDEBUG -c -o arithmetic64.o arithmetic64.c gcc -O2 -DNDEBUG -c -o bitmap.o bitmap.c gcc -O2 -DNDEBUG -c -o bsgs.o bsgs.c gcc -O2 -DNDEBUG -c -o clock.o clock.c gcc -O2 -DNDEBUG -c -o events.o events.c gcc -O2 -DNDEBUG -c -o factors.o factors.c gcc -O2 -DNDEBUG -c -o files.o files.c gcc -O2 -DNDEBUG -c -o global.o global.c gcc -O2 -DNDEBUG -c -o hashtable.o hashtable.c gcc -O2 -DNDEBUG -c -o primes.o primes.c gcc -O2 -DNDEBUG -c -o sequences.o sequences.c gcc -O2 -DNDEBUG -c -o subseq.o subseq.c gcc -O2 -DNDEBUG -c -o util.o util.c gcc -s srsieve.o arithmetic32.o arithmetic64.o bitmap.o bsgs.o clock.o events.o factors.o files.o global.o hashtable.o primes.o sequences.o subseq.o util.o -l m -o srsieve arithmetic64.o:arithmetic64.c:(.text+0xccd): undefined reference to _sqrtl' arithmetic64.o:arithmetic64.c:(.text+0xcdc): undefined reference to _sqrtl' bsgs.o:bsgs.c:(.text+0x296): undefined reference to _sqrtl' collect2: ld returned 1 exit status make: *** [srsieve] Error 1 JasonG@Jason-comp /temp$
2007-03-11, 11:51   #6
jasong

"Jason Goatcher"
Mar 2005

66638 Posts

Quote:
 Originally Posted by thommy why don't you try it first? do you even have and linux psp, or do you just wanna know? cheers
It might NOT be a Linux psp. Preparing the computer to compile files took about 3 hours, though most of that time was taken up by running a script made specifically for compiling programs for the PSP.

2007-03-12, 03:37   #7
geoff

Mar 2003
New Zealand

115710 Posts

Quote:
 Originally Posted by jasong This is what I get when I type make: Code: \$ arithmetic64.o:arithmetic64.c:(.text+0xccd): undefined reference to _sqrtl'
sqrtl() is a standard C99 library function, it should be included by -lm.

You could try running make CFLAGS=-ffast-math' to try to get GCC to use the built-in version of sqrtl() instead of the library version.

Otherwise it is probably safe to replace each occurance of sqrtl' with sqrt' in bsgs.c and arithmetic64.c provided none of your sequences k*b^n+c have k or |c| greater than 2^52.

edit: BTW it would be a good idea to add -Wall to the CFLAGS too. Run make CFLAGS=-Wall' or make CFLAGS="-Wall -ffast-math"' to do this.

Last fiddled with by geoff on 2007-03-12 at 03:42

 2007-03-12, 23:33 #8 jasong     "Jason Goatcher" Mar 2005 3·7·167 Posts also, could someone show me how to make it work for a specific base? I've been able to build srsieve, but not sr5sieve.
2007-03-13, 00:31   #9
geoff

Mar 2003
New Zealand

22058 Posts

Quote:
 Originally Posted by jasong also, could someone show me how to make it work for a specific base? I've been able to build srsieve, but not sr5sieve.
The sr5sieve source is in a seperate archive from the srsieve source, but the compilation instructions are similar. Running make' will compile a binary that should work on the host machine. If you have the GMP libraries installed, run make check' too.

By default the base is 5. To compile for base 2, edit sr5sieve.h and change the line #define BASE 5' to `#define BASE 2'. The executable will be called sr5sieve whatever base was set, so best to rename it immediately to avoid confusion :-)

sr5sieve doesn't use the sqrtl() function, so hopefully no need for further editing.

 Similar Threads Thread Thread Starter Forum Replies Last Post 0PolarBearsHere Hardware 2 2015-12-15 17:29 jasong Software 4 2007-03-12 07:15 jasong Factoring 2 2007-01-02 00:38 jasong Hardware 1 2006-09-09 13:48 Chris Software 5 2005-04-17 18:25

All times are UTC. The time now is 23:01.

Thu Apr 15 23:01:25 UTC 2021 up 7 days, 17:42, 1 user, load averages: 1.56, 1.79, 2.00