summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-01-17 18:15:33 +0000
committerAlberto Ruiz <aruiz@um.es>2008-01-17 18:15:33 +0000
commit0d26c1fc0eccdeb585a74d96cbe7861cf20c7bd2 (patch)
tree1747de32361cf1485108aae2dcb82ce4a6d75ebf /lib
parentc520939e33cc895febed271d5c3218457317bba9 (diff)
f2c.h hack, trying to support both 32 and 64 bit mahines
Diffstat (limited to 'lib')
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/f2c.h67
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
12Extracted from http://opengrok.creo.hu/dragonfly/xref/src/contrib/gcc-3.4/libf2c/readme.netlib
13
14NOTE: 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
50I thing that the following definitions are correct:
51
52*/
53
54#ifdef _LP64
55typedef int integer;
56typedef unsigned int uinteger;
57typedef int logical;
58typedef long longint; /* system-dependent */
59typedef unsigned long ulongint; /* system-dependent */
60#else
10typedef long int integer; 61typedef long int integer;
11typedef unsigned long int uinteger; 62typedef unsigned long int uinteger;
63typedef long int logical;
64typedef long long longint; /* system-dependent */
65typedef unsigned long long ulongint; /* system-dependent */
66#endif
67
12typedef char *address; 68typedef char *address;
13typedef short int shortint; 69typedef short int shortint;
14typedef float real; 70typedef float real;
15typedef double doublereal; 71typedef double doublereal;
16typedef struct { real r, i; } complex; 72typedef struct { real r, i; } complex;
17typedef struct { doublereal r, i; } doublecomplex; 73typedef struct { doublereal r, i; } doublecomplex;
18typedef long int logical;
19typedef short int shortlogical; 74typedef short int shortlogical;
20typedef char logical1; 75typedef char logical1;
21typedef char integer1; 76typedef char integer1;
22#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ 77#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */
23typedef long long longint; /* system-dependent */
24typedef 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;
42typedef short ftnlen; 95typedef short ftnlen;
43typedef short ftnint; 96typedef short ftnint;
44#else 97#else
98
99#ifdef _LP64
100typedef int flag;
101typedef int ftnlen;
102typedef int ftnint;
103#else
45typedef long int flag; 104typedef long int flag;
46typedef long int ftnlen; 105typedef long int ftnlen;
47typedef long int ftnint; 106typedef long int ftnint;
48#endif 107#endif
49 108
109#endif
110
50/*external read, write*/ 111/*external read, write*/
51typedef struct 112typedef struct
52{ flag cierr; 113{ flag cierr;