diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-05-27 22:07:18 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-05-27 22:07:18 (GMT) |
commit | 244784ab2cf816b135f27bf03b5a4fb91502aed9 (patch) | |
tree | 1ec533dc1c9d680a53152df36a63cdf604595f28 /fortran/src | |
parent | b15fc6e4a0b7a5f35c68742de8ceb8dabcb7bad0 (diff) | |
download | hdf5-244784ab2cf816b135f27bf03b5a4fb91502aed9.zip hdf5-244784ab2cf816b135f27bf03b5a4fb91502aed9.tar.gz hdf5-244784ab2cf816b135f27bf03b5a4fb91502aed9.tar.bz2 |
[svn-r27115] Moved testing KINDs and SIZEOFs to configure.
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5_f.c | 26 | ||||
-rw-r--r-- | fortran/src/H5_ff.F90 | 12 | ||||
-rw-r--r-- | fortran/src/H5config_f.inc.in | 3 | ||||
-rw-r--r-- | fortran/src/H5f90global.F90 | 12 | ||||
-rw-r--r-- | fortran/src/H5match_types.c | 607 | ||||
-rw-r--r-- | fortran/src/Makefile.am | 16 | ||||
-rw-r--r-- | fortran/src/Makefile.in | 55 |
7 files changed, 332 insertions, 399 deletions
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 8df4b36..993b358 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -56,7 +56,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes hid_t c_type_id; size_t tmp_val; -/* Fortran INTEGER is may not be the same as C in; do all checking to find +/* Fortran INTEGER may not be the same as C; do all checking to find an appropriate size */ if (sizeof(int_f) == sizeof(int)) { @@ -174,44 +174,44 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ /* - * FIND H5T_NATIVE_REAL_4 + * FIND H5T_NATIVE_REAL_C_FLOAT */ - if (sizeof(real_4_f) == sizeof(float)) { + if (sizeof(real_C_FLOAT_f) == sizeof(float)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_4_f) == sizeof(double)) { + else if (sizeof(real_C_FLOAT_f) == sizeof(double)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ #if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_4_f) == sizeof(long double)) { + else if (sizeof(real_C_FLOAT_f) == sizeof(long double)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif /* - * FIND H5T_NATIVE_REAL_8 + * FIND H5T_NATIVE_REAL_C_DOUBLE */ - if (sizeof(real_8_f) == sizeof(float)) { + if (sizeof(real_C_DOUBLE_f) == sizeof(float)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_8_f) == sizeof(double)) { + else if (sizeof(real_C_DOUBLE_f) == sizeof(double)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ #if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_8_f) == sizeof(long double)) { + else if (sizeof(real_C_DOUBLE_f) == sizeof(long double)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif /* - * FIND H5T_NATIVE_REAL_16 + * FIND H5T_NATIVE_REAL_C_LONG_DOUBLE */ - if (sizeof(real_16_f) == sizeof(float)) { + if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(float)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_16_f) == sizeof(double)) { + else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(double)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ #if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_16_f) == sizeof(long double)) { + else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index d807d6e..d7d9efe 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -379,12 +379,12 @@ CONTAINS h5_type = H5T_NATIVE_INTEGER_8 ENDIF ELSE IF(flag.EQ.H5_REAL_KIND)THEN - IF(kind.EQ.Fortran_REAL_4)THEN - h5_type = H5T_NATIVE_REAL_4 - ELSE IF(kind.EQ.Fortran_REAL_8)THEN - h5_type = H5T_NATIVE_REAL_8 - ELSE IF(kind.EQ.Fortran_REAL_16)THEN - h5_type = H5T_NATIVE_REAL_16 + IF(kind.EQ.Fortran_REAL_C_FLOAT)THEN + h5_type = H5T_NATIVE_REAL_C_FLOAT + ELSE IF(kind.EQ.Fortran_REAL_C_DOUBLE)THEN + h5_type = H5T_NATIVE_REAL_C_DOUBLE + ELSE IF(kind.EQ.Fortran_REAL_C_LONG_DOUBLE)THEN + h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE ENDIF ENDIF diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index dde4c11..3786130 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -14,3 +14,6 @@ ! Define if the intrinsic function C_LONG_DOUBLE exists #undef FORTRAN_HAVE_C_LONG_DOUBLE + +! Define the size of C's long double +#define H5_SIZEOF_LONG_DOUBLE diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index ac368d1..5e67220 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -82,9 +82,9 @@ MODULE H5GLOBAL H5T_NATIVE_INTEGER_2, & H5T_NATIVE_INTEGER_4, & H5T_NATIVE_INTEGER_8, & - H5T_NATIVE_REAL_4, & - H5T_NATIVE_REAL_8, & - H5T_NATIVE_REAL_16, & + H5T_NATIVE_REAL_C_FLOAT, & + H5T_NATIVE_REAL_C_DOUBLE, & + H5T_NATIVE_REAL_C_LONG_DOUBLE, & H5T_NATIVE_INTEGER, & H5T_NATIVE_REAL, & H5T_NATIVE_DOUBLE, & @@ -144,9 +144,9 @@ MODULE H5GLOBAL EQUIVALENCE (predef_types(8), H5T_NATIVE_INTEGER_2) EQUIVALENCE (predef_types(9), H5T_NATIVE_INTEGER_4) EQUIVALENCE (predef_types(10), H5T_NATIVE_INTEGER_8) - EQUIVALENCE (predef_types(11), H5T_NATIVE_REAL_4) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_8) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_16) + EQUIVALENCE (predef_types(11), H5T_NATIVE_REAL_C_FLOAT) + EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_DOUBLE) + EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_LONG_DOUBLE) EQUIVALENCE (predef_types(14), H5T_NATIVE_B8 ) EQUIVALENCE (predef_types(15), H5T_NATIVE_B16) EQUIVALENCE (predef_types(16), H5T_NATIVE_B32) diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index ae4ef40..ef0a1f3 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -31,6 +31,7 @@ */ #include <stdio.h> +#include <string.h> #include <assert.h> #include "H5public.h" @@ -48,9 +49,9 @@ FILE * fort_header; #define FFILE "H5fortran_types.F90" /* Prototypes for the write routines */ -void writeTypedef(const char* c_typedef, const char* c_type, unsigned int size); -void writeTypedefDefault(const char* c_typedef, unsigned int size); -void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, unsigned int kind); +void writeTypedef(const char* c_typedef, const char* c_type, int size); +void writeTypedefDefault(const char* c_typedef, int size); +void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, int kind); void writeToFilesChr(const char* c_typedef, const char* fortran_type, const char* c_type, int size, char* kind); static void @@ -121,20 +122,20 @@ endFfile(void) } /* Define a c_int_x type in the C header */ -void writeTypedef(const char* c_typedef, const char* c_type, unsigned int size) +void writeTypedef(const char* c_typedef, const char* c_type, int size) { fprintf(c_header, "#define c_%s_%u %s\n", c_typedef, size, c_type); } /* Call this function if there is no matching C type for sizes > 1 */ -void writeTypedefDefault(const char* c_typedef, unsigned int size) +void writeTypedefDefault(const char* c_typedef, int size) { assert(size %2 == 0); fprintf(c_header, "typedef struct {c_%s_%u a; c_%s_%u b;} c_%s_%u\n", c_typedef, size / 2, c_typedef, size / 2, c_typedef, size); } /* Create matching Fortran and C types by writing to both files */ -void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, unsigned int kind) +void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); fprintf(c_header, "typedef c_%s_%d %s;\n", c_typedef, size, c_type); @@ -144,17 +145,25 @@ void writeToFilesChr(const char* c_typedef, const char* fortran_type, const char fprintf(fort_header, " INTEGER, PARAMETER :: %s = %s\n", fortran_type, kind); fprintf(c_header, "typedef c_%s_%d %s;\n", c_typedef, size, c_type); } - int main(void) { - int FoundIntSize[4]; - unsigned FoundIntSizeKind[4]; - int FoundRealSize[3]; - unsigned FoundRealSizeKind[3]; - int i,j,flag; + int FoundIntSize[10]; + int FoundIntSizeKind[10]; + int FoundRealSize[10]; + int FoundRealSizeKind[10]; + int i, j,flag; char chrA[20],chrB[20]; int H5_C_HAS_REAL_NATIVE_16; + int IntKinds[] = H5_FORTRAN_INTEGER_KINDS; + int IntKinds_SizeOf[] = H5_FORTRAN_INTEGER_KINDS_SIZEOF; + int RealKinds[] = H5_FORTRAN_REAL_KINDS; + int RealKinds_SizeOf[] = H5_FORTRAN_REAL_KINDS_SIZEOF; + char Real_C_TYPES[10][32]; + + int H5_FORTRAN_NUM_INTEGER_KINDS; + int H5_FORTRAN_NUM_REAL_KINDS; + /* Open target files */ c_header = fopen(CFILE, "w"); fort_header = fopen(FFILE, "w"); @@ -166,213 +175,123 @@ int main(void) initCfile(); initFfile(); - /* First, define c_int_x */ - -#if defined H5_FORTRAN_HAS_INTEGER_1_KIND - if(sizeof(long long) == 1) - writeTypedef("int", "long long", 1); - else if(sizeof(long) == 1) - writeTypedef("int", "long", 1); - else if(sizeof(int) == 1) - writeTypedef("int", "int", 1); - else if(sizeof(short) == 1) - writeTypedef("int", "short", 1); - else - writeTypedef("int", "char", 1); - /* Actually, char is not necessarily one byte. - * But if char isn't, then nothing is, so this - * is as close as we can get. */ - if(sizeof(size_t) == 1) - writeTypedef("size_t", "size_t", 1); - if(sizeof(hsize_t) == 1) - writeTypedef("hsize_t", "hsize_t", 1); -#endif /*H5_FORTRAN_HAS_INTEGER_1_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_2_KIND - if(sizeof(long long) == 2) - writeTypedef("int", "long long", 2); - else if(sizeof(long) == 2) - writeTypedef("int", "long", 2); - else if(sizeof(int) == 2) - writeTypedef("int", "int", 2); - else if(sizeof(short) == 2) - writeTypedef("int", "short", 2); - else - writeTypedefDefault("int",2); - - if(sizeof(size_t) == 2) - writeTypedef("size_t", "size_t", 2); - if(sizeof(hsize_t) == 2) - writeTypedef("hsize_t", "hsize_t", 2); -#endif /*H5_FORTRAN_HAS_INTEGER_2_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_4_KIND - if(sizeof(long long) == 4) - writeTypedef("int", "long long", 4); - else if(sizeof(long) == 4) - writeTypedef("int", "long", 4); - else if(sizeof(int) == 4) - writeTypedef("int", "int", 4); - else if(sizeof(short) == 4) - writeTypedef("int", "short", 4); - else - writeTypedefDefault("int",4); - - if(sizeof(size_t) == 4) - writeTypedef("size_t", "size_t", 4); - if(sizeof(hsize_t) == 4) - writeTypedef("hsize_t", "hsize_t", 4); - -#endif /*H5_FORTRAN_HAS_INTEGER_4_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND - if(sizeof(long long) == 8) - writeTypedef("int", "long long", 8); - else if(sizeof(long) == 8) - writeTypedef("int", "long", 8); - else if(sizeof(int) == 8) - writeTypedef("int", "int", 8); - else if(sizeof(short) == 8) - writeTypedef("int", "short", 8); - else - writeTypedefDefault("int",8); - - if(sizeof(size_t) == 8) - writeTypedef("size_t", "size_t", 8); - if(sizeof(hsize_t) == 8) - writeTypedef("hsize_t", "hsize_t", 8); - -#endif /*H5_FORTRAN_HAS_INTEGER_8_KIND*/ - - /* Define c_float_x */ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND || defined H5_FORTRAN_HAS_REAL_4_KIND - if(sizeof(long double) == 4) - writeTypedef("float", "long double", 4); - else if(sizeof(double) == 4) - writeTypedef("float", "double", 4); - else if(sizeof(float) == 4) - writeTypedef("float", "float", 4); - else - { printf("Fortran REAL is 4 bytes, no corresponding C floating type\n"); - printf("Quitting....\n"); - return -1; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_4_KIND*/ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND || defined H5_FORTRAN_HAS_REAL_8_KIND - if(sizeof(long double) == 8) - writeTypedef("float", "long double", 8); - else if(sizeof(double) == 8) - writeTypedef("float", "double", 8); - else if(sizeof(float) == 8) - writeTypedef("float", "float", 8); - else - { printf("Fortran REAL is 16 bytes, no corresponding C floating type\n"); - printf("Quitting....\n"); - return -1; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_8_KIND*/ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND || defined H5_FORTRAN_HAS_REAL_16_KIND - if(sizeof(long double) == 16) - writeTypedef("float", "long double", 16); - else if(sizeof(double) == 16) - writeTypedef("float", "double", 16); - else if(sizeof(float) == 16) - writeTypedef("float", "float", 16); - else /*C has no 16 byte float so disable it in Fortran*/ - { printf("warning: Fortran REAL is 16 bytes, no corresponding C floating type\n"); - printf(" Disabling Fortran 16 byte REALs\n"); - H5_C_HAS_REAL_NATIVE_16 = 0; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_16_KIND*/ + /* (a) define c_int_x */ + + H5_FORTRAN_NUM_INTEGER_KINDS = (int)(sizeof(IntKinds)/sizeof(IntKinds[0])); + H5_FORTRAN_NUM_REAL_KINDS = (int)(sizeof(RealKinds)/sizeof(RealKinds[0])); + + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(sizeof(long long) == IntKinds_SizeOf[i]) + writeTypedef("int", "long long", IntKinds[i]); + else if(sizeof(long) == IntKinds[i]) + writeTypedef("int", "long", IntKinds[i]); + else if(sizeof(int) == IntKinds_SizeOf[i]) + writeTypedef("int", "int", IntKinds[i]); + else if(sizeof(short) == IntKinds_SizeOf[i]) + writeTypedef("int", "short", IntKinds[i]); + else + if(IntKinds_SizeOf[i] == 1) { + writeTypedef("int", "char", IntKinds[i]); + /* Actually, char is not necessarily one byte. + * But if char isn't, then nothing is, so this + * is as close as we can get. */ + } else { + writeTypedefDefault("int",IntKinds[i]); + } + if(sizeof(size_t) == IntKinds_SizeOf[i]) + writeTypedef("size_t", "size_t", IntKinds[i]); + if(sizeof(hsize_t) == IntKinds_SizeOf[i]) + writeTypedef("hsize_t", "hsize_t", IntKinds[i]); + } + + /* (b) Define c_float_x */ + + for(i=0;i< H5_FORTRAN_NUM_REAL_KINDS;i++) { +#ifdef HAVE_FLOAT128 +/* should fail */ + if(sizeof(__float128) == RealKinds_SizeOf[i]) { + writeTypedef("float", "__float128", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT128"); + } else +#endif + if(sizeof(long double) == RealKinds_SizeOf[i]) { + writeTypedef("float", "long double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); + } else if(sizeof(double) == RealKinds_SizeOf[i]) { + writeTypedef("float", "double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_DOUBLE"); + } else if(sizeof(float) == RealKinds_SizeOf[i]) { + writeTypedef("float", "float", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT"); + } else { + printf(" **** HDF5 WARNING ****/n"); + printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]); + printf("Fortran Interfaces for Fortran REALs of %d bytes will not exist\n",RealKinds_SizeOf[i]); + } + } /* Now begin defining fortran types. */ fprintf(c_header, "\n"); + /* haddr_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HADDR_T >= 8 - writeToFiles("int","HADDR_T", "haddr_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HADDR_T >= 4 - writeToFiles("int","HADDR_T", "haddr_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HADDR_T >= 2 - writeToFiles("int","HADDR_T", "haddr_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HADDR_T >= 1 - writeToFiles("int","HADDR_T", "haddr_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for haddr_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HADDR_T) { + writeToFiles("int","HADDR_T", "haddr_t_f", H5_SIZEOF_HADDR_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for haddr_t */ + return -1; + } /* hsize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSIZE_T >= 8 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSIZE_T >= 4 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSIZE_T >= 2 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSIZE_T >= 1 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for hsize_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HSIZE_T) { + writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", H5_SIZEOF_HSIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hsize_t */ + return -1; + } /* hssize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSSIZE_T >= 8 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSSIZE_T >= 4 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSSIZE_T >= 2 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSSIZE_T >= 1 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for hssize_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HSSIZE_T) { + writeToFiles("int","HSSIZE_T", "hssize_t_f", H5_SIZEOF_HSSIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hssize_t */ + return -1; + } /* off_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_OFF_T >= 8 - writeToFiles("int","OFF_T", "off_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_OFF_T >= 4 - writeToFiles("int","OFF_T", "off_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_OFF_T >= 2 - writeToFiles("int","OFF_T", "off_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_OFF_T >= 1 - writeToFiles("int","OFF_T", "off_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for off_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_OFF_T) { + writeToFiles("int","OFF_T", "off_t_f", H5_SIZEOF_OFF_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for off_t */ + return -1; + } /* size_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_SIZE_T >= 8 - writeToFiles("size_t","SIZE_T", "size_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_SIZE_T >= 4 - writeToFiles("size_t","SIZE_T", "size_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_SIZE_T >= 2 - writeToFiles("size_t","SIZE_T", "size_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_SIZE_T >= 1 - writeToFiles("size_t","SIZE_T", "size_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for size_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_SIZE_T) { + writeToFiles("size_t","SIZE_T", "size_t_f", H5_SIZEOF_SIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for size_t */ + return -1; + } /* int */ -#if defined H5_FORTRAN_HAS_NATIVE_8_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 8, H5_FORTRAN_HAS_NATIVE_8_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_4_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 4, H5_FORTRAN_HAS_NATIVE_4_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_2_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 2, H5_FORTRAN_HAS_NATIVE_2_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_1_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 1, H5_FORTRAN_HAS_NATIVE_1_KIND); -#else - /* Error: couldn't find a size for int */ - return -1; -#endif + writeToFiles("int","Fortran_INTEGER", "int_f", H5_FORTRAN_NATIVE_INTEGER_SIZEOF, H5_FORTRAN_NATIVE_INTEGER_KIND); + + /* int_1, int_2, int_4, int_8 */ @@ -381,29 +300,20 @@ int main(void) /* it a value of the next larger one, but if the next */ /* higher one is not available we assigned it the next lowest */ - FoundIntSize[0] = -1; - FoundIntSize[1] = -2; - FoundIntSize[2] = -4; - FoundIntSize[3] = -8; -#if defined H5_FORTRAN_HAS_INTEGER_1_KIND - FoundIntSize[0] = 1; - FoundIntSizeKind[0] = H5_FORTRAN_HAS_INTEGER_1_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_2_KIND - FoundIntSize[1] = 2; - FoundIntSizeKind[1] = H5_FORTRAN_HAS_INTEGER_2_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_4_KIND - FoundIntSize[2] = 4; - FoundIntSizeKind[2] = H5_FORTRAN_HAS_INTEGER_4_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND - FoundIntSize[3] = 8; - FoundIntSizeKind[3] = H5_FORTRAN_HAS_INTEGER_8_KIND ; -#endif + FoundIntSize[0] = -1; + FoundIntSize[1] = -1; + FoundIntSize[2] = -1; + FoundIntSize[3] = -1; + FoundIntSize[4] = -1; + + for(i=0;i<H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + FoundIntSize[i] = (int)IntKinds[i]; + FoundIntSizeKind[i] = (int)IntKinds_SizeOf[i]; +/* writeToFiles("int",chrA, chrB, FoundIntSize[i], FoundIntSizeKind[i]); */ + } - for(i=0;i<4;i++) { + for(i=0;i<H5_FORTRAN_NUM_INTEGER_KINDS;i++) { if( FoundIntSize[i] > 0) /* Found the integer type */ { sprintf(chrA, "Fortran_INTEGER_%d", FoundIntSize[i]); @@ -450,129 +360,144 @@ int main(void) /* it a value of the next larger one, but if the next */ /* higher one is not available we assigned it the next lowest */ - FoundRealSize[0] = -4; - FoundRealSize[1] = -8; - FoundRealSize[2] = -16; - -#if defined H5_FORTRAN_HAS_REAL_4_KIND - FoundRealSize[0] = 4; - FoundRealSizeKind[0] = H5_FORTRAN_HAS_REAL_4_KIND; -#endif -#if defined H5_FORTRAN_HAS_REAL_8_KIND - FoundRealSize[1] = 8; - FoundRealSizeKind[1] = H5_FORTRAN_HAS_REAL_8_KIND; -#endif - -#if defined H5_FORTRAN_HAS_REAL_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { - FoundRealSize[2] = 16; - FoundRealSizeKind[2] = H5_FORTRAN_HAS_REAL_16_KIND; - } -#endif - - for(i=0;i<3;i++) { - if( FoundRealSize[i] > 0) /* Found the real type */ - { - sprintf(chrA, "Fortran_REAL_%d", FoundRealSize[i]); - sprintf(chrB, "real_%d_f", FoundRealSize[i]); - writeToFiles("float",chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); - } - else /* Did not find the real type */ - { - flag = 0; /* flag indicating if found the next highest */ - for(j=i+1;j<3;j++) /* search for next highest */ - { - if( FoundRealSize[j] > 0) /* Found the next highest */ - { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) { - writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - flag = 1; - } - /* else { */ -/* writeToFiles("float", chrA, chrB, FoundRealSize[j]); */ + FoundRealSize[0] = -1; + FoundRealSize[1] = -1; + FoundRealSize[2] = -1; + FoundRealSize[3] = -1; + FoundRealSize[4] = -1; + + for(i=0;i<H5_FORTRAN_NUM_REAL_KINDS;i++) { + FoundRealSize[i] = (int)RealKinds[i]; + FoundRealSizeKind[i] = (int)RealKinds_SizeOf[i]; + sprintf(chrA, "Fortran_REAL_%s", Real_C_TYPES[i]); + /* sprintf(chrB, "real_%d_f", FoundRealSize[i]); */ + sprintf(chrB, "real_%s_f", Real_C_TYPES[i]); + writeToFiles("float",chrA, chrB, RealKinds[i], RealKinds_SizeOf[i]); + } + +/* for(i=0;i<H5_FORTRAN_NUM_REAL_KINDS;i++) { */ +/* if( FoundRealSize[i] > 0) /\* Found the real type *\/ */ +/* { */ +/* sprintf(chrA, "Fortran_REAL_%d", Real_C_TYPES[i]); */ +/* sprintf(chrB, "real_%d_f", FoundRealSize[i]); */ +/* writeToFiles("float",chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); */ +/* } */ +/* else /\* Did not find the real type *\/ */ +/* { */ +/* flag = 0; /\* flag indicating if found the next highest *\/ */ +/* for(j=i+1;j<3;j++) /\* search for next highest *\/ */ +/* { */ +/* if( FoundRealSize[j] > 0) /\* Found the next highest *\/ */ +/* { */ +/* sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); */ +/* sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); */ +/* if(FoundRealSize[j]>4) { */ +/* writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); */ +/* flag = 1; */ /* } */ - flag = 1; - break; - } - } - if(flag == 0) /* No higher one found, so find next lowest */ - { - for(j=1;j>-1;j--) /* Search for next lowest */ - { - if( FoundRealSize[j] > 0) /* Found the next lowest */ - { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) - writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - /* else { */ -/* writeToFiles("float", chrA, chrB, FoundRealSize[j]); */ -/* } */ - flag = 1; - break; - } - } - } - if(flag == 0) /* No higher or lower one found, indicating an error */ - return -1; - } - } +/* /\* else { *\/ */ +/* /\* writeToFiles("float", chrA, chrB, FoundRealSize[j]); *\/ */ +/* /\* } *\/ */ +/* flag = 1; */ +/* break; */ +/* } */ +/* } */ +/* if(flag == 0) /\* No higher one found, so find next lowest *\/ */ +/* { */ +/* for(j=1;j>-1;j--) /\* Search for next lowest *\/ */ +/* { */ +/* if( FoundRealSize[j] > 0) /\* Found the next lowest *\/ */ +/* { */ +/* sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); */ +/* sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); */ +/* if(FoundRealSize[j]>4) */ +/* writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); */ +/* /\* else { *\/ */ +/* /\* writeToFiles("float", chrA, chrB, FoundRealSize[j]); *\/ */ +/* /\* } *\/ */ +/* flag = 1; */ +/* break; */ +/* } */ +/* } */ +/* } */ +/* if(flag == 0) /\* No higher or lower one found, indicating an error *\/ */ +/* return -1; */ +/* } */ +/* } */ /* hid_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 8 - writeToFiles("int","HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HID_T >= 4 - writeToFiles("int","HID_T", "hid_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HID_T >= 2 - writeToFiles("int","HID_T", "hid_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HID_T >= 1 - writeToFiles("int","HID_T", "hid_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 4 - writeToFiles("int","HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#else - /* Error: couldn't find a size for hid_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HID_T) { + writeToFiles("int","HID_T", "hid_t_f", H5_SIZEOF_HID_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hid_t */ + return -1; + } /* real_f */ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { - writeToFilesChr("float","Fortran_REAL", "real_f", 16, "C_LONG_DOUBLE"); - } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND - writeToFilesChr("float", "Fortran_REAL", "real_f", 8, "C_DOUBLE"); -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND - writeToFilesChr("float", "Fortran_REAL", "real_f", 4, "C_FLOAT"); -#else - /* Error: couldn't find a size for real_f */ - return -1; -#endif + if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(long double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(float)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_FLOAT"); + else { + /* No exact match, choose the next highest */ + if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(long double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(float)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_FLOAT"); + else + /* Error: couldn't find a size for real_f */ + return -1; + } /* double_f */ -#if defined H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { /* Check if C has 16 byte floats */ - writeToFilesChr("float", "Fortran_DOUBLE", "double_f", 16, "C_LONG_DOUBLE"); - } else { -#if defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND /* Fall back to 8 byte floats */ - writeToFilesChr("float", "Fortran_DOUBLE", "double_f", 8, "C_DOUBLE"); - } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND /* Fall back to 4 byte floats */ - writeToFilesChr("float", "Fortran_DOUBLE", "double_f", 4, "C_FLOAT"); - } -#else - /* Error: couldn't find a size for double_f when fortran has 16 byte reals */ - return -1; - } -#endif + if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(long double)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(double)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(float)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT"); + else { +/* /\* No exact match, choose the next highest *\/ */ +/* if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF > sizeof(long double)) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_LONG_DOUBLE"); */ +/* else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF > sizeof(double)) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", sizeof(double), "C_DOUBLE"); */ +/* else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF > sizeof(float)) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", sizeof(float), "C_FLOAT"); */ +/* else */ + /* Error: couldn't find a size for double_f */ +/* printf("Error: couldn't find a size for double_f \n"); */ +/* return -1; */ + } + + + +/* /\* double_f *\/ */ +/* if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == C_LONG_DOUBLE_SIZEOF) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_SIZEOF, "C_LONG_DOUBLE"); */ +/* else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == C_DOUBLE_SIZEOF) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_SIZEOF, "C_DOUBLE"); */ +/* else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == C_FLOAT_SIZEOF) */ +/* writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_SIZEOF, "C_FLOAT"); */ +/* else */ +/* /\* Error: couldn't find a size for double_f *\/ */ +/* return -1; */ -#elif defined H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND - writeToFilesChr("float", "Fortran_DOUBLE", "double_f", 8, "C_DOUBLE"); -#else - /* Error: couldn't find a size for real_f */ - return -1; -#endif +/* writeToFiles("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_SIZEOF, H5_FORTRAN_NATIVE_DOUBLE_KIND); */ + +/* #elif defined H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND */ +/* writeToFilesChr("float", "Fortran_DOUBLE", "double_f", 8, "C_DOUBLE"); */ +/* #else */ +/* /\* Error: couldn't find a size for real_f *\/ */ +/* return -1; */ +/* #endif */ /* /\* real_f *\/ */ /* if(sizeof(float) == C_LONG_DOUBLE_SIZEOF) { */ diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 9736bcc..43a5f3f 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -114,7 +114,7 @@ endif # and H5fortran_types.F90, which are included in the Fortran library. # These are the helper programs we need to build. -noinst_PROGRAMS = H5match_types H5fortran_detect H5test_kind +noinst_PROGRAMS = H5match_types H5test_kind # Tell Automake to create H5f90i_gen.h before it builds the library # sources. When it creates H5f90i_gen.h, it will create @@ -129,19 +129,19 @@ H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT) # H5fort_type_defines.h is created by running H5fortran_detect. # Obviously, H5fortran_detect needs to be built first. -H5fort_type_defines.h: H5fortran_detect$(EXEEXT) - $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h +#H5fort_type_defines.h: H5fortran_detect$(EXEEXT) +# $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h -H5match_types.$(OBJEXT): H5fort_type_defines.h +#H5match_types.$(OBJEXT): H5fort_type_defines.h # Automake knows how to build fortran programs if we tell it the source # files. -H5fortran_detect_SOURCES = H5fortran_detect.F90 +#H5fortran_detect_SOURCES = H5fortran_detect.F90 # H5test_kind.F90 generates H5Fortran_detect.F90 depending on if # intrinsic function SIZEOF is available. -H5fortran_detect.F90: H5test_kind$(EXEEXT) +H5_KINDff.F90: H5test_kind$(EXEEXT) $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.F90 # H5test_kind.F90 is included in the distribution, and Automake knows @@ -157,8 +157,8 @@ FORTRAN_API=yes # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo -H5fortran_types.lo: H5fortran_types.F90 -H5fortran_detect.lo: H5fortran_detect.F90 +#H5fortran_types.lo: H5fortran_types.F90 +#H5fortran_detect.lo: H5fortran_detect.F90 H5test_kind.lo: $(srcdir)/H5test_kind.F90 H5_ff.lo: $(srcdir)/H5_ff.F90 H5f90global.lo H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 249ba10..f746ccf 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -101,14 +101,14 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/H5config_f.inc.in \ $(top_srcdir)/bin/mkinstalldirs $(srcdir)/h5fc.in \ - $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver README + $(srcdir)/H5fort_type_defines.h.in $(top_srcdir)/bin/depcomp \ + $(top_srcdir)/bin/test-driver README # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static -noinst_PROGRAMS = H5match_types$(EXEEXT) H5fortran_detect$(EXEEXT) \ - H5test_kind$(EXEEXT) +noinst_PROGRAMS = H5match_types$(EXEEXT) H5test_kind$(EXEEXT) TESTS = subdir = fortran/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -118,7 +118,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h H5config_f.inc -CONFIG_CLEAN_FILES = h5fc +CONFIG_CLEAN_FILES = h5fc H5fort_type_defines.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -166,9 +166,6 @@ libhdf5_fortran_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \ $(AM_FCFLAGS) $(FCFLAGS) $(libhdf5_fortran_la_LDFLAGS) \ $(LDFLAGS) -o $@ PROGRAMS = $(noinst_PROGRAMS) -am_H5fortran_detect_OBJECTS = H5fortran_detect.$(OBJEXT) -H5fortran_detect_OBJECTS = $(am_H5fortran_detect_OBJECTS) -H5fortran_detect_LDADD = $(LDADD) H5match_types_SOURCES = H5match_types.c H5match_types_OBJECTS = H5match_types.$(OBJEXT) H5match_types_LDADD = $(LDADD) @@ -234,10 +231,9 @@ AM_V_FC = $(am__v_FC_@AM_V@) am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) am__v_FC_0 = @echo " FC " $@; am__v_FC_1 = -SOURCES = $(libhdf5_fortran_la_SOURCES) $(H5fortran_detect_SOURCES) \ - H5match_types.c $(H5test_kind_SOURCES) -DIST_SOURCES = $(libhdf5_fortran_la_SOURCES) \ - $(H5fortran_detect_SOURCES) H5match_types.c \ +SOURCES = $(libhdf5_fortran_la_SOURCES) H5match_types.c \ + $(H5test_kind_SOURCES) +DIST_SOURCES = $(libhdf5_fortran_la_SOURCES) H5match_types.c \ $(H5test_kind_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ @@ -518,6 +514,7 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FLOAT128 = @HAVE_FLOAT128@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ @@ -564,6 +561,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -753,10 +760,6 @@ MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h \ # H5fortran_types.F90 as a side effect. BUILT_SOURCES = H5f90i_gen.h -# Automake knows how to build fortran programs if we tell it the source -# files. -H5fortran_detect_SOURCES = H5fortran_detect.F90 - # H5test_kind.F90 is included in the distribution, and Automake knows # how to compile a fortran program given its sources. H5test_kind_SOURCES = H5test_kind.F90 @@ -832,6 +835,8 @@ distclean-hdr: -rm -f H5config_f.inc stamp-h2 h5fc: $(top_builddir)/config.status $(srcdir)/h5fc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +H5fort_type_defines.h: $(top_builddir)/config.status $(srcdir)/H5fort_type_defines.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @@ -880,10 +885,6 @@ clean-noinstPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -H5fortran_detect$(EXEEXT): $(H5fortran_detect_OBJECTS) $(H5fortran_detect_DEPENDENCIES) $(EXTRA_H5fortran_detect_DEPENDENCIES) - @rm -f H5fortran_detect$(EXEEXT) - $(AM_V_FCLD)$(FCLINK) $(H5fortran_detect_OBJECTS) $(H5fortran_detect_LDADD) $(LIBS) - H5match_types$(EXEEXT): $(H5match_types_OBJECTS) $(H5match_types_DEPENDENCIES) $(EXTRA_H5match_types_DEPENDENCIES) @rm -f H5match_types$(EXEEXT) $(AM_V_CCLD)$(LINK) $(H5match_types_OBJECTS) $(H5match_types_LDADD) $(LIBS) @@ -1389,15 +1390,19 @@ H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT) # H5fort_type_defines.h is created by running H5fortran_detect. # Obviously, H5fortran_detect needs to be built first. -H5fort_type_defines.h: H5fortran_detect$(EXEEXT) - $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h +#H5fort_type_defines.h: H5fortran_detect$(EXEEXT) +# $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h + +#H5match_types.$(OBJEXT): H5fort_type_defines.h -H5match_types.$(OBJEXT): H5fort_type_defines.h +# Automake knows how to build fortran programs if we tell it the source +# files. +#H5fortran_detect_SOURCES = H5fortran_detect.F90 # H5test_kind.F90 generates H5Fortran_detect.F90 depending on if # intrinsic function SIZEOF is available. -H5fortran_detect.F90: H5test_kind$(EXEEXT) +H5_KINDff.F90: H5test_kind$(EXEEXT) $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.F90 # Hardcode the dependencies of these files. There isn't a known way of @@ -1405,8 +1410,8 @@ H5fortran_detect.F90: H5test_kind$(EXEEXT) # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo -H5fortran_types.lo: H5fortran_types.F90 -H5fortran_detect.lo: H5fortran_detect.F90 +#H5fortran_types.lo: H5fortran_types.F90 +#H5fortran_detect.lo: H5fortran_detect.F90 H5test_kind.lo: $(srcdir)/H5test_kind.F90 H5_ff.lo: $(srcdir)/H5_ff.F90 H5f90global.lo H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo |