diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-01-17 18:15:33 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-01-17 18:15:33 +0000 |
commit | 0d26c1fc0eccdeb585a74d96cbe7861cf20c7bd2 (patch) | |
tree | 1747de32361cf1485108aae2dcb82ce4a6d75ebf /lib/Numeric/LinearAlgebra/LAPACK | |
parent | c520939e33cc895febed271d5c3218457317bba9 (diff) |
f2c.h hack, trying to support both 32 and 64 bit mahines
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK')
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/f2c.h | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/f2c.h b/lib/Numeric/LinearAlgebra/LAPACK/f2c.h index b94ee7c..6a07e09 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/f2c.h +++ b/lib/Numeric/LinearAlgebra/LAPACK/f2c.h | |||
@@ -7,21 +7,74 @@ | |||
7 | #ifndef F2C_INCLUDE | 7 | #ifndef F2C_INCLUDE |
8 | #define F2C_INCLUDE | 8 | #define F2C_INCLUDE |
9 | 9 | ||
10 | /* | ||
11 | |||
12 | Extracted from http://opengrok.creo.hu/dragonfly/xref/src/contrib/gcc-3.4/libf2c/readme.netlib | ||
13 | |||
14 | NOTE: f2c.h defines several types, e.g., real, integer, doublereal. | ||
15 | 115 The definitions in f2c.h are suitable for most machines, but if | ||
16 | 116 your machine has sizeof(double) > 2*sizeof(long), you may need | ||
17 | 117 to adjust f2c.h appropriately. f2c assumes | ||
18 | 118 sizeof(doublecomplex) = 2*sizeof(doublereal) | ||
19 | 119 sizeof(doublereal) = sizeof(complex) | ||
20 | 120 sizeof(doublereal) = 2*sizeof(real) | ||
21 | 121 sizeof(real) = sizeof(integer) | ||
22 | 122 sizeof(real) = sizeof(logical) | ||
23 | 123 sizeof(real) = 2*sizeof(shortint) | ||
24 | 124 EQUIVALENCEs may not be translated correctly if these | ||
25 | 125 assumptions are violated. | ||
26 | 126 | ||
27 | 127 On machines, such as those using a DEC Alpha processor, on | ||
28 | 128 which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4, | ||
29 | 129 and sizeof(long) == sizeof(double) == 8, it suffices to | ||
30 | 130 modify f2c.h by removing the first occurrence of "long " | ||
31 | 131 on each line containing "long ", e.g., by issuing the | ||
32 | 132 commands | ||
33 | 133 mv f2c.h f2c.h0 | ||
34 | 134 sed 's/long //' f2c.h0 >f2c.h | ||
35 | 135 On such machines, one can enable INTEGER*8 by uncommenting | ||
36 | 136 the typedef of longint in f2c.h, so it reads | ||
37 | 137 typedef long longint; | ||
38 | 138 by compiling libI77 with -DAllow_TYQUAD, and by adjusting | ||
39 | 139 libF77/makefile as described in libF77/README. | ||
40 | 140 | ||
41 | 141 Some machines may have sizeof(int) == 4, sizeof(float) == 8, | ||
42 | 142 and sizeof(long long) == 8. On such machines, adjust f2c.h | ||
43 | 143 by changing "long int " to "long long ", e.g., by saying | ||
44 | 144 mv f2c.h f2c.h0 | ||
45 | 145 sed 's/long int /long long /' f2c.h0 >f2c.h | ||
46 | 146 One can enable INTEGER*8 on such machines as described | ||
47 | 147 above, but with | ||
48 | 148 typedef long long longint; | ||
49 | |||
50 | I thing that the following definitions are correct: | ||
51 | |||
52 | */ | ||
53 | |||
54 | #ifdef _LP64 | ||
55 | typedef int integer; | ||
56 | typedef unsigned int uinteger; | ||
57 | typedef int logical; | ||
58 | typedef long longint; /* system-dependent */ | ||
59 | typedef unsigned long ulongint; /* system-dependent */ | ||
60 | #else | ||
10 | typedef long int integer; | 61 | typedef long int integer; |
11 | typedef unsigned long int uinteger; | 62 | typedef unsigned long int uinteger; |
63 | typedef long int logical; | ||
64 | typedef long long longint; /* system-dependent */ | ||
65 | typedef unsigned long long ulongint; /* system-dependent */ | ||
66 | #endif | ||
67 | |||
12 | typedef char *address; | 68 | typedef char *address; |
13 | typedef short int shortint; | 69 | typedef short int shortint; |
14 | typedef float real; | 70 | typedef float real; |
15 | typedef double doublereal; | 71 | typedef double doublereal; |
16 | typedef struct { real r, i; } complex; | 72 | typedef struct { real r, i; } complex; |
17 | typedef struct { doublereal r, i; } doublecomplex; | 73 | typedef struct { doublereal r, i; } doublecomplex; |
18 | typedef long int logical; | ||
19 | typedef short int shortlogical; | 74 | typedef short int shortlogical; |
20 | typedef char logical1; | 75 | typedef char logical1; |
21 | typedef char integer1; | 76 | typedef char integer1; |
22 | #ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ | 77 | #ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ |
23 | typedef long long longint; /* system-dependent */ | ||
24 | typedef unsigned long long ulongint; /* system-dependent */ | ||
25 | #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) | 78 | #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) |
26 | #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) | 79 | #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) |
27 | #endif | 80 | #endif |
@@ -42,11 +95,19 @@ typedef short flag; | |||
42 | typedef short ftnlen; | 95 | typedef short ftnlen; |
43 | typedef short ftnint; | 96 | typedef short ftnint; |
44 | #else | 97 | #else |
98 | |||
99 | #ifdef _LP64 | ||
100 | typedef int flag; | ||
101 | typedef int ftnlen; | ||
102 | typedef int ftnint; | ||
103 | #else | ||
45 | typedef long int flag; | 104 | typedef long int flag; |
46 | typedef long int ftnlen; | 105 | typedef long int ftnlen; |
47 | typedef long int ftnint; | 106 | typedef long int ftnint; |
48 | #endif | 107 | #endif |
49 | 108 | ||
109 | #endif | ||
110 | |||
50 | /*external read, write*/ | 111 | /*external read, write*/ |
51 | typedef struct | 112 | typedef struct |
52 | { flag cierr; | 113 | { flag cierr; |