diff options
author | James Laird <jlaird@hdfgroup.org> | 2005-04-04 21:17:51 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2005-04-04 21:17:51 (GMT) |
commit | b296a419c4ed2cc43cab53b78a40cbf1346f2362 (patch) | |
tree | 7a652352898be1a2e963c9e700228c00a878657d /hl/fortran/src | |
parent | 7f5e1dfe31696bddb3967865af52801a2b38bb7e (diff) | |
download | hdf5-b296a419c4ed2cc43cab53b78a40cbf1346f2362.zip hdf5-b296a419c4ed2cc43cab53b78a40cbf1346f2362.tar.gz hdf5-b296a419c4ed2cc43cab53b78a40cbf1346f2362.tar.bz2 |
[svn-r10534] Purpose:
Configuration feature
Description:
Different Fortran compilers mangle function names in different ways
(upper case, lower case, adding underscores). To link between
Fortran and C functions, we need to know what a given function's
name is under a given compiler.
Solution:
Use autoconf's FC_WRAPPERS check to determine the Fortran
naming scheme and define the FC_FUNC_ macro to name our
functions (in H5f90proto.h). Removed references to
our old FNAME macro, as well as flags that indicated whether
function names were upper or lower case.
Platforms tested:
mir, pommier, modi4, copper, more
Diffstat (limited to 'hl/fortran/src')
-rwxr-xr-x | hl/fortran/src/H5LTf90proto.h | 153 | ||||
-rwxr-xr-x | hl/fortran/src/H5f90i.h | 45 | ||||
-rw-r--r-- | hl/fortran/src/Makefile.in | 1 |
3 files changed, 42 insertions, 157 deletions
diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 29d99eb..a18f599 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -16,6 +16,7 @@ #ifndef _H5LTf90proto_H #define _H5LTf90proto_H +#include "H5config.h" #include "H5f90i.h" H5_DLL char* HD5f2cstring (_fcd fdesc, int len); @@ -25,134 +26,58 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); /* * Functions from H5LTfc.c */ -#ifndef H5Ff90_FNAMES -# define H5Ff90_FNAMES -#ifdef DF_CAPFNAMES -# define nh5ltmake_dataset_c FNAME(H5LTMAKE_DATASET_C) -# define nh5ltread_dataset_c FNAME(H5LTREAD_DATASET_C) -# define nh5ltmake_dataset_string_c FNAME(H5LTMAKE_DATASET_STRING_C) -# define nh5ltread_dataset_string_c FNAME(H5LTREAD_DATASET_STRING_C) +# define nh5ltmake_dataset_c FC_FUNC_(h5ltmake_dataset_c, H5LTMAKE_DATASET_C) +# define nh5ltread_dataset_c FC_FUNC_(h5ltread_dataset_c, H5LTREAD_DATASET_C) +# define nh5ltmake_dataset_string_c FC_FUNC_(h5ltmake_dataset_string_c, H5LTMAKE_DATASET_STRING_C) +# define nh5ltread_dataset_string_c FC_FUNC_(h5ltread_dataset_string_c, H5LTREAD_DATASET_STRING_C) +# define nh5ltset_attribute_int_c FC_FUNC_(h5ltset_attribute_int_c, H5LTSET_ATTRIBUTE_INT_C) +# define nh5ltset_attribute_float_c FC_FUNC_(h5ltset_attribute_float_c, H5LTSET_ATTRIBUTE_FLOAT_C) +# define nh5ltset_attribute_double_c FC_FUNC_(h5ltset_attribute_double_c, H5LTSET_ATTRIBUTE_DOUBLE_C) +# define nh5ltset_attribute_string_c FC_FUNC_(h5ltset_attribute_string_c, H5LTSET_ATTRIBUTE_STRING_C) -# define nh5ltset_attribute_int_c FNAME(H5LTSET_ATTRIBUTE_INT_C) -# define nh5ltset_attribute_float_c FNAME(H5LTSET_ATTRIBUTE_FLOAT_C) -# define nh5ltset_attribute_double_c FNAME(H5LTSET_ATTRIBUTE_DOUBLE_C) -# define nh5ltset_attribute_string_c FNAME(H5LTSET_ATTRIBUTE_STRING_C) +# define nh5ltget_attribute_int_c FC_FUNC_(h5ltget_attribute_int_c, H5LTGET_ATTRIBUTE_INT_C) +# define nh5ltget_attribute_float_c FC_FUNC_(h5ltget_attribute_float_c, H5LTGET_ATTRIBUTE_FLOAT_C) +# define nh5ltget_attribute_double_c FC_FUNC_(h5ltget_attribute_double_c, H5LTGET_ATTRIBUTE_DOUBLE_C) +# define nh5ltget_attribute_string_c FC_FUNC_(h5ltget_attribute_string_c, H5LTGET_ATTRIBUTE_STRING_C) -# define nh5ltget_attribute_int_c FNAME(H5LTGET_ATTRIBUTE_INT_C) -# define nh5ltget_attribute_float_c FNAME(H5LTGET_ATTRIBUTE_FLOAT_C) -# define nh5ltget_attribute_double_c FNAME(H5LTGET_ATTRIBUTE_DOUBLE_C) -# define nh5ltget_attribute_string_c FNAME(H5LTGET_ATTRIBUTE_STRING_C) +# define nh5ltget_dataset_ndims_c FC_FUNC_(h5ltget_dataset_ndims_c, H5LTGET_DATASET_NDIMS_C) +# define nh5ltfind_dataset_c FC_FUNC_(h5ltfind_dataset_c, H5LTFIND_DATASET_C) +# define nh5ltget_dataset_info_c FC_FUNC_(h5ltget_dataset_info_c, H5LTGET_DATASET_INFO_C) -# define nh5ltget_dataset_ndims_c FNAME(H5LTGET_DATASET_NDIMS_C) -# define nh5ltfind_dataset_c FNAME(H5LTFIND_DATASET_C) -# define nh5ltget_dataset_info_c FNAME(H5LTGET_DATASET_INFO_C) - -# define nh5ltget_attribute_ndims_c FNAME(H5LTGET_ATTRIBUTE_NDIMS_C) -# define nh5ltget_attribute_info_c FNAME(H5LTGET_ATTRIBUTE_INFO_C) - -/*------------------------------------------------------------------------- - * Image - *------------------------------------------------------------------------- - */ -# define nh5immake_image_8bit_c FNAME(H5IMMAKE_IMAGE_8BIT_C) -# define nh5immake_image_24bit_c FNAME(H5IMMAKE_IMAGE_24BIT_C) -# define nh5imread_image_c FNAME(H5IMREAD_IMAGE_C) -# define nh5imget_image_info_c FNAME(H5IMGET_IMAGE_INFO_C) -# define nh5imis_image_c FNAME(H5IMIS_IMAGE_C) -# define nh5immake_palette_c FNAME(H5IMMAKE_PALETTE_C) -# define nh5imlink_palette_c FNAME(H5IMLINK_PALETTE_C) -# define nh5imunlink_palette_c FNAME(H5IMUNLINK_PALETTE_C) -# define nh5imget_npalettes_c FNAME(H5IMGET_NPALETTES_C) -# define nh5imget_palette_info_c FNAME(H5IMGET_PALETTE_INFO_C) -# define nh5imget_palette_c FNAME(H5IMGET_PALETTE_C) -# define nh5imis_palette_c FNAME(H5IMIS_PALETTE_C) - - /*------------------------------------------------------------------------- - * Table - *------------------------------------------------------------------------- - */ -# define nh5tbmake_table_c FNAME(H5TBMAKE_TABLE_C) -# define nh5tbwrite_field_name_c FNAME(H5TBWRITE_FIELD_NAME_C) -# define nh5tbread_field_name_c FNAME(H5TBREAD_FIELD_NAME_C) -# define nh5tbwrite_field_index_c FNAME(H5TBWRITE_FIELD_INDEX_C) -# define nh5tbread_field_index_c FNAME(H5TBREAD_FIELD_INDEX_C) -# define nh5tbinsert_field_c FNAME(H5TBINSERT_FIELD_C) -# define nh5tbdelete_field_c FNAME(H5TBDELETE_FIELD_C) -# define nh5tbget_table_info_c FNAME(H5TBGET_TABLE_INFO_C) -# define nh5tbget_field_info_c FNAME(H5TBGET_FIELD_INFO_C) - - - - - -#else /* !DF_CAPFNAMES */ - -# define nh5ltmake_dataset_c FNAME(h5ltmake_dataset_c) -# define nh5ltread_dataset_c FNAME(h5ltread_dataset_c) -# define nh5ltmake_dataset_string_c FNAME(h5ltmake_dataset_string_c) -# define nh5ltread_dataset_string_c FNAME(h5ltread_dataset_string_c) - -# define nh5ltset_attribute_int_c FNAME(h5ltset_attribute_int_c) -# define nh5ltset_attribute_float_c FNAME(h5ltset_attribute_float_c) -# define nh5ltset_attribute_double_c FNAME(h5ltset_attribute_double_c) -# define nh5ltset_attribute_string_c FNAME(h5ltset_attribute_string_c) - -# define nh5ltget_attribute_int_c FNAME(h5ltget_attribute_int_c) -# define nh5ltget_attribute_float_c FNAME(h5ltget_attribute_float_c) -# define nh5ltget_attribute_double_c FNAME(h5ltget_attribute_double_c) -# define nh5ltget_attribute_string_c FNAME(h5ltget_attribute_string_c) - -# define nh5ltget_dataset_ndims_c FNAME(h5ltget_dataset_ndims_c) -# define nh5ltfind_dataset_c FNAME(h5ltfind_dataset_c) -# define nh5ltget_dataset_info_c FNAME(h5ltget_dataset_info_c) - -# define nh5ltget_attribute_ndims_c FNAME(h5ltget_attribute_ndims_c) -# define nh5ltget_attribute_info_c FNAME(h5ltget_attribute_info_c) +# define nh5ltget_attribute_ndims_c FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) +# define nh5ltget_attribute_info_c FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) /*------------------------------------------------------------------------- * Image *------------------------------------------------------------------------- */ -# define nh5immake_image_8bit_c FNAME(h5immake_image_8bit_c) -# define nh5immake_image_24bit_c FNAME(h5immake_image_24bit_c) -# define nh5imread_image_c FNAME(h5imread_image_c) -# define nh5imget_image_info_c FNAME(h5imget_image_info_c) -# define nh5imis_image_c FNAME(h5imis_image_c) -# define nh5immake_palette_c FNAME(h5immake_palette_c) -# define nh5imlink_palette_c FNAME(h5imlink_palette_c) -# define nh5imunlink_palette_c FNAME(h5imunlink_palette_c) -# define nh5imget_npalettes_c FNAME(h5imget_npalettes_c) -# define nh5imget_palette_info_c FNAME(h5imget_palette_info_c) -# define nh5imget_palette_c FNAME(h5imget_palette_c) -# define nh5imis_palette_c FNAME(h5imis_palette_c) +# define nh5immake_image_8bit_c FC_FUNC_(h5immake_image_8bit_c, H5IMMAKE_IMAGE_8BIT_C) +# define nh5immake_image_24bit_c FC_FUNC_(h5immake_image_24bit_c, H5IMMAKE_IMAGE_24BIT_C) +# define nh5imread_image_c FC_FUNC_(h5imread_image_c, H5IMREAD_IMAGE_C) +# define nh5imget_image_info_c FC_FUNC_(h5imget_image_info_c, H5IMGET_IMAGE_INFO_C) +# define nh5imis_image_c FC_FUNC_(h5imis_image_c, H5IMIS_IMAGE_C) +# define nh5immake_palette_c FC_FUNC_(h5immake_palette_c, H5IMMAKE_PALETTE_C) +# define nh5imlink_palette_c FC_FUNC_(h5imlink_palette_c, H5IMLINK_PALETTE_C) +# define nh5imunlink_palette_c FC_FUNC_(h5imunlink_palette_c, H5IMUNLINK_PALETTE_C) +# define nh5imget_npalettes_c FC_FUNC_(h5imget_npalettes_c, H5IMGET_NPALETTES_C) +# define nh5imget_palette_info_c FC_FUNC_(h5imget_palette_info_c, H5IMGET_PALETTE_INFO_C) +# define nh5imget_palette_c FC_FUNC_(h5imget_palette_c, H5IMGET_PALETTE_C) +# define nh5imis_palette_c FC_FUNC_(h5imis_palette_c, H5IMIS_PALETTE_C) /*------------------------------------------------------------------------- * Table *------------------------------------------------------------------------- */ -# define nh5tbmake_table_c FNAME(h5tbmake_table_c) -# define nh5tbwrite_field_name_c FNAME(h5tbwrite_field_name_c) -# define nh5tbread_field_name_c FNAME(h5tbread_field_name_c) -# define nh5tbwrite_field_index_c FNAME(h5tbwrite_field_index_c) -# define nh5tbread_field_index_c FNAME(h5tbread_field_index_c) -# define nh5tbinsert_field_c FNAME(h5tbinsert_field_c) -# define nh5tbdelete_field_c FNAME(h5tbdelete_field_c) -# define nh5tbget_table_info_c FNAME(h5tbget_table_info_c) -# define nh5tbget_field_info_c FNAME(h5tbget_field_info_c) - - - - - - - - - - - -#endif /* DF_CAPFNAMES */ -#endif /* H5Ff90_FNAMES */ +# define nh5tbmake_table_c FC_FUNC_(h5tbmake_table_c, H5TBMAKE_TABLE_C) +# define nh5tbwrite_field_name_c FC_FUNC_(h5tbwrite_field_name_c, H5TBWRITE_FIELD_NAME_C) +# define nh5tbread_field_name_c FC_FUNC_(h5tbread_field_name_c, H5TBREAD_FIELD_NAME_C) +# define nh5tbwrite_field_index_c FC_FUNC_(h5tbwrite_field_index_c, H5TBWRITE_FIELD_INDEX_C) +# define nh5tbread_field_index_c FC_FUNC_(h5tbread_field_index_c, H5TBREAD_FIELD_INDEX_C) +# define nh5tbinsert_field_c FC_FUNC_(h5tbinsert_field_c, H5TBINSERT_FIELD_C) +# define nh5tbdelete_field_c FC_FUNC_(h5tbdelete_field_c, H5TBDELETE_FIELD_C) +# define nh5tbget_table_info_c FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) +# define nh5tbget_field_info_c FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) H5_DLL int_f diff --git a/hl/fortran/src/H5f90i.h b/hl/fortran/src/H5f90i.h index e39e3f8..c1a390c 100755 --- a/hl/fortran/src/H5f90i.h +++ b/hl/fortran/src/H5f90i.h @@ -20,6 +20,8 @@ * Standard header files needed all the time */ +#include "H5private.h" + #if (defined (UNICOS) || (defined (_UNICOS))) #include <fortran.h> @@ -32,8 +34,6 @@ typedef long size_t_f; typedef long int_f; typedef long hid_t_f; typedef double real_f; -#define DF_CAPFNAMES -/*#define _fcdtocp(desc) (desc)*/ #endif /* UNICOS */ @@ -60,10 +60,6 @@ typedef int size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME(x) x -#if defined H5_ABSOFT -#define DF_CAPFNAMES -#endif /*H5_ABSOFT*/ #define _fcdtocp(desc) (desc) #endif /*APPLE*/ @@ -85,11 +81,6 @@ typedef long long haddr_t_f; typedef long long hsize_t_f; typedef long long hssize_t_f; typedef int size_t_f; -#if defined H5_ABSOFT -#define DF_CAPFNAMES -#else -#define FNAME_POST_UNDERSCORE -#endif /*H5_ABSOFT*/ /* AMD64 specific definitions */ #elif defined __x86_64__ @@ -98,7 +89,6 @@ typedef long long haddr_t_f; typedef long long hsize_t_f; typedef long long hssize_t_f; typedef int size_t_f; -#define FNAME_POST_UNDERSCORE /* IA64 specific definitions */ #elif defined __ia64 @@ -107,7 +97,6 @@ typedef long haddr_t_f; typedef long hsize_t_f; typedef long hssize_t_f; typedef long size_t_f; -#define FNAME_POST_UNDERSCORE #endif /* IA64 */ #endif /* LINUX*/ @@ -122,7 +111,6 @@ typedef long size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME_POST_UNDERSCORE #define _fcdtocp(desc) (desc) #endif /* IRIX */ @@ -136,7 +124,6 @@ typedef int size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME_POST_UNDERSCORE #define _fcdtocp(desc) (desc) #endif /*SUN*/ @@ -151,7 +138,6 @@ typedef long size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME_POST_UNDERSCORE #define _fcdtocp(desc) (desc) #endif /* DEC_ALPHA */ @@ -166,7 +152,6 @@ typedef long long size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME_POST2_UNDERSCORE #define _fcdtocp(desc) (desc) #endif /* DEC_ALPHA_LINUX */ @@ -197,7 +182,6 @@ typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define DF_CAPFNAMES #define _fcdtocp(desc) (desc) #endif /*WINDOWS */ @@ -232,32 +216,7 @@ typedef long hssize_t_f; typedef long size_t_f; #endif /* IA64 */ -#define FNAME_POST_UNDERSCORE #endif /* FreeBSD */ -/*---------------------------------------------------------------- -** MACRO FNAME for any fortran callable routine name. -** -** This macro prepends, appends, or does not modify a name -** passed as a macro parameter to it based on the FNAME_PRE_UNDERSCORE, -** FNAME_POST_UNDERSCORE macros set for a specific system. -** -**---------------------------------------------------------------*/ -#if defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE) -# define FNAME(x) _##x##_ -#endif -#if defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE) -# define FNAME(x) _##x -#endif -#if !defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE) -# define FNAME(x) x##_ -#endif -#if !defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE) -# define FNAME(x) x -#endif -#if !defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST2_UNDERSCORE) -# define FNAME(x) x##__ -#endif - #endif /* _H5f90i_H */ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 6ee4e0e..b24e6ed 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -153,6 +153,7 @@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ FCFLAGS = @FCFLAGS@ +FCLIBS = @FCLIBS@ FFLAGS = @FFLAGS@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ |