summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2013-03-29 13:34:25 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2013-03-29 13:34:25 (GMT)
commit2571bbbc7b52cf776433af69f7078bf0d75d9ef6 (patch)
tree279244ba03401e17781b273d02a9f9d9a981d8bd /fortran
parent8461df0911aecf6665b4a19d4a66e4d11bc31e3c (diff)
downloadhdf5-2571bbbc7b52cf776433af69f7078bf0d75d9ef6.zip
hdf5-2571bbbc7b52cf776433af69f7078bf0d75d9ef6.tar.gz
hdf5-2571bbbc7b52cf776433af69f7078bf0d75d9ef6.tar.bz2
[svn-r23488] merged windows dll changes from the trunk to the branch.
svn merge -r23351:23487 https://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran . Tested: windows.
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/h5fc.in55
-rw-r--r--fortran/src/hdf5_fortrandll.def.in1
-rw-r--r--fortran/test/tf.f9011
3 files changed, 46 insertions, 21 deletions
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index 2d7b5b4..37f7c71 100644
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -80,12 +80,11 @@ FLINKERBASE="@FC@"
# FFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
-# User's FFLAGS come after their H5BLD counterparts to override
-# them. User's LDFLAGS come just before clibpath, user's LIBS come after
-# $link_objs and before the hdf5 libraries in $link_args, followed by any
-# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
-# or LIBS carried in from the hdf5 build.
-
+# User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
+# before clibpath, user's LIBS come after $link_objs and before the hdf5
+# libraries in $link_args, followed by any external library paths and libraries
+# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
+# The order of the flags is intended to give precedence to the user's flags.
H5BLD_FFLAGS="@AM_FCFLAGS@ @FCFLAGS@"
F9XMODFLAG="@F9XMODFLAG@"
F9XSUFFIXFLAG="@F9XSUFFIXFLAG@"
@@ -98,7 +97,16 @@ FFLAGS="${HDF5_FFLAGS:-$FFLAGSBASE}"
LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
LIBS="${HDF5_LIBS:-$LIBSBASE}"
-USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+# If a static library is available, the default will be to use it. If the only
+# available library is shared, it will be used by default. The user can
+# override either default, although choosing an unavailable library will result
+# in link errors.
+STATIC_AVAILABLE="@enable_static@"
+if test "${STATIC_AVAILABLE}" = "yes"; then
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+else
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}"
+fi
usage() {
# A wonderfully informative "usage" message.
@@ -233,8 +241,13 @@ for arg in $@ ; do
*) allargs="$allargs $arg"
if [ -s "$arg" ] ; then
ext=`expr "$arg" : '.*\(\..*\)'`
- if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \
- "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then
+ if [ "$ext" = ".f" -o "$ext" = ".F" -o \
+ "$ext" = ".for" -o "$ext" = ".FOR" -o \
+ "$ext" = ".ftn" -o "$ext" = ".FTN" -o \
+ "$ext" = ".f90" -o "$ext" = ".F90" -o \
+ "$ext" = ".f95" -o "$ext" = ".F95" -o \
+ "$ext" = ".f03" -o "$ext" = ".F03" -o \
+ "$ext" = ".f08" -o "$ext" = ".F08" ] ; then
do_compile="yes"
compile_args="$compile_args $arg"
fname=`basename $arg $ext`
@@ -303,6 +316,20 @@ if test "x$do_link" = "xyes"; then
if test -n "$flag"; then
shared_link="${flag}${libdir}"
+ # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded
+ # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH).
+ if test -n "$LDFLAGS"; then
+ for entry in $LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
+ if test -n "$H5BLD_LDFLAGS"; then
+ for entry in $H5BLD_LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
@@ -344,11 +371,11 @@ if test "x$do_link" = "xyes"; then
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
- # User's FFLAGS come after their H5BLD counterparts to override
- # them. User's LDFLAGS come just before clibpath, user's LIBS come after
- # $link_objs and before the hdf5 libraries in $link_args, followed by any
- # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
- # or LIBS carried in from the hdf5 build.
+ # User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
+ # before clibpath, user's LIBS come after $link_objs and before the hdf5
+ # libraries in $link_args, followed by any external library paths and libraries
+ # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
+ # The order of the flags is intended to give precedence to the user's flags.
$SHOW $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link
status=$?
fi
diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in
index 4ce185b..62030f0 100644
--- a/fortran/src/hdf5_fortrandll.def.in
+++ b/fortran/src/hdf5_fortrandll.def.in
@@ -6,6 +6,7 @@ H5LIB_mp_H5GET_LIBVERSION_F
H5LIB_mp_H5CHECK_VERSION_F
H5LIB_mp_H5GARBAGE_COLLECT_F
H5LIB_mp_H5DONT_ATEXIT_F
+H5LIB_mp_H5KIND_TO_TYPE
@H5_NOF03EXP@H5LIB_PROVISIONAL_mp_H5OFFSETOF
; H5_DBLE_INTERFACE
H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR
diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90
index d5c32c8..4f73fda 100644
--- a/fortran/test/tf.f90
+++ b/fortran/test/tf.f90
@@ -30,7 +30,7 @@
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
-!DEC$attributes dllexport :: verify_real
+!DEC$attributes dllexport :: verify_real_kind_7
!DEC$endif
SUBROUTINE verify_real_kind_7(string,value,correct_value,total_error)
USE HDF5
@@ -115,7 +115,7 @@ END SUBROUTINE verify
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
-!DEC$attributes dllexport :: verify
+!DEC$attributes dllexport :: verify_Fortran_INTEGER_4
!DEC$endif
SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error)
USE HDF5
@@ -129,9 +129,6 @@ SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error)
RETURN
END SUBROUTINE verify_Fortran_INTEGER_4
-
-
-
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$attributes dllexport :: verifyLogical
@@ -151,7 +148,7 @@ END SUBROUTINE verifyLogical
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$attributes dllexport :: verifyString
!DEC$endif
-SUBROUTINE verifystring(string, value,correct_value,total_error)
+SUBROUTINE verifyString(string, value,correct_value,total_error)
CHARACTER*(*) :: string
CHARACTER*(*) :: value, correct_value
INTEGER :: total_error
@@ -160,7 +157,7 @@ SUBROUTINE verifystring(string, value,correct_value,total_error)
WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string
ENDIF
RETURN
-END SUBROUTINE verifystring
+END SUBROUTINE verifyString
!----------------------------------------------------------------------