mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   How to run GIMPS on SCO OpenServer 5.0.6? (https://www.mersenneforum.org/showthread.php?t=3504)

Prime95 2005-01-17 22:07

Ernst (and Guillermo),

Have you tried the QD double-double package? I've just switched it and the results have been good thusfar.

I had to switch because x86-64 does not support the 80-bit x87 FPU instructions - so I had to reimplement all that assembly language setup code.

ben 2005-01-18 03:47

[QUOTE=ewmayer]Boy, this compiler really dislikes 'long long' - looks like you'll need to change all occurrences of {64-bit const}ull to ...ul - luckily, all such occurrences are in just 2 files, qfloat.h and qfloat.c .[/QUOTE]
I modify:
types.h: line 48, line 49: long long => long
util.c: line 97, line 166: long long => long
qfloat.h, qfloat.c: ...ull => ...ul
then:
$ cc -o Mlucas *.c -lm
$ Mlucas
ERROR 14 in util.c
$

ewmayer 2005-01-18 17:05

[QUOTE=ben]I modify:
types.h: line 48, line 49: long long => long
util.c: line 97, line 166: long long => long
qfloat.h, qfloat.c: ...ull => ...ul
then:
$ cc -o Mlucas *.c -lm
$ Mlucas
ERROR 14 in util.c
$[/QUOTE]

If you look at ERROR 14 in util.c, you see that it implies that you are not getting 64 bits in you int64 types (i.e. sizeof(int64) != 8). So this compiler doesn't like 'long long' for ints, but just using 'long' appears to only give a 32-bit int. Is there a 64-bit compile option? If the SCO compiler simply doesn't support 64-bit ints (which I would find highly surprising), you're going to have to haver to use your gcc build.

[quote=Prime95]Have you tried the QD double-double package? I've just switched it and the results have been good thusfar.[/quote]

Have not tried it, though I've heard of it. The thing is, my hand-rolled qfloat-emulation functions need only one not-100%-guaranteed-by-the-C-language-standard thing - a 64-bit int type, which doesn't even need to be hardware-supported (i.e. it can be emulated), since these routines don't need to be fast. That seems not so much to ask.

ben 2005-01-19 09:02

[QUOTE=ewmayer] Is there a 64-bit compile option? If the SCO compiler simply doesn't support 64-bit ints (which I would find highly surprising), you're going to have to haver to use your gcc build.
[/QUOTE]
Yes, SCO compiler simply doesn't support 64-bit ints. No 64-bit compile option.

$ cat sizeof.c
#include <stdio.h>
#define PR(x) printf("sizeof("#x")\t= %d\n", sizeof(x))
main()
{
PR(void *);
PR(char);
PR(short);
PR(int);
PR(long);
PR(long long);
PR(float);
PR(double);
PR(long double);
}
$ gcc -o sizeof-gcc sizeof.c
$ sizeof-gcc
sizeof(void *) = 4
sizeof(char) = 1
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 4
sizeof(long long) = 8
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 12
$ cc -o sizeof-cc sizeof.c /* delete PR(long long); line */
$ sizeof-cc
sizeof(void *) = 4
sizeof(char) = 1
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 4
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 12
$
thus, in cc compiler long is 4 bytes.


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

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