mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Sierpinski/Riesel Base 5 (https://www.mersenneforum.org/forumdisplay.php?f=54)
-   -   sieving on Playstation Portable (https://www.mersenneforum.org/showthread.php?t=7261)

jasong 2007-03-04 01:46

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?

geoff 2007-03-06 21:35

[QUOTE=jasong;99852]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?[/QUOTE]

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.

jasong 2007-03-11 01:33

[QUOTE=geoff;100089]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.[/QUOTE]
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?

thommy 2007-03-11 01:37

why don't you try it first? do you even have and linux psp, or do you just wanna know?

cheers :grin:

jasong 2007-03-11 06:58

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
$[/code]

jasong 2007-03-11 11:51

[QUOTE=thommy;100504]why don't you try it first? do you even have and linux psp, or do you just wanna know?

cheers :grin:[/QUOTE]
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.

geoff 2007-03-12 03:37

[QUOTE=jasong;100512]This is what I get when I type make:
[code]$
arithmetic64.o:arithmetic64.c:(.text+0xccd): undefined reference to `_sqrtl'
[/code][/QUOTE]

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.

jasong 2007-03-12 23:33

also, could someone show me how to make it work for a specific base? I've been able to build srsieve, but not sr5sieve.

geoff 2007-03-13 00:31

[QUOTE=jasong;100640]also, could someone show me how to make it work for a specific base? I've been able to build srsieve, but not sr5sieve.[/QUOTE]

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.


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.