summaryrefslogtreecommitdiffstats
path: root/fortran/examples
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2024-01-30 18:20:58 (GMT)
committerGitHub <noreply@github.com>2024-01-30 18:20:58 (GMT)
commit3a3501df2d35babb508fa4944690c564a43c22f5 (patch)
tree493a2480190f3019f9c359c8aa3b12f2615380d7 /fortran/examples
parent791915e92a291704393cd2e740d658f4e46a8683 (diff)
downloadhdf5-3a3501df2d35babb508fa4944690c564a43c22f5.zip
hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.gz
hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.bz2
h5 compiler wrappers now pass all arguments passed to it to the compile line (#3954)
* The issue was that the "allargs" variable was not being used in the final command of the compiler wrapper. Any entries containing an escaped quote (\", \') or other non-matching argument (*) would not be passed to the compile line. I have fixed this problem by ensuring all arguments passed to the compiler wrapper are now included in the compile line. * added testing for compiler wrappers
Diffstat (limited to 'fortran/examples')
-rw-r--r--fortran/examples/testh5fc.sh.in35
1 files changed, 31 insertions, 4 deletions
diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in
index 0328bbb..5b6a9de 100644
--- a/fortran/examples/testh5fc.sh.in
+++ b/fortran/examples/testh5fc.sh.in
@@ -42,11 +42,13 @@ myos=`uname -s`
myhostnama=`uname -n`
# Generate some source files and library for tests.
-suffix=f90 # source file suffix
+suffix=F90 # source file suffix
hdf5main=${H5TOOL}_hdf5main.$suffix
hdf5main_o=${H5TOOL}_hdf5main.o
appmain=${H5TOOL}_appmain.$suffix
appmain_o=${H5TOOL}_appmain.o
+args=${H5TOOL}_args.$suffix
+args_o=${H5TOOL}_args.o
prog1=${H5TOOL}_prog1.$suffix
prog1_o=${H5TOOL}_prog1.o
prog2=${H5TOOL}_prog2.$suffix
@@ -106,7 +108,7 @@ cat > $hdf5main <<EOF
IMPLICIT NONE
- CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name
+ CHARACTER(LEN=9), PARAMETER :: filename = "apptmp.h5" ! File name
INTEGER(HID_T) :: file_id ! File identifier
INTEGER :: error ! Error flag
@@ -118,17 +120,38 @@ cat > $hdf5main <<EOF
END PROGRAM FILEEXAMPLE
EOF
+# Generate an args Main Program:
+# An application main that test misc command line arguments being passed.
+cat > $args <<EOF
+ PROGRAM ARGS
+ USE HDF5 ! This module contains all necessary modules
+
+ IMPLICIT NONE
+ CHARACTER(LEN=1), PARAMETER :: chr1 = SGL_QUOTE ! 'H'
+ CHARACTER(LEN=3), PARAMETER :: chr3 = DBL_QUOTE ! "HDF"
+ INTEGER, PARAMETER :: val = MISC ! 42
+ CHARACTER(LEN=9), PARAMETER :: filename = "argtmp.h5" ! File name
+ INTEGER(HID_T) :: file_id ! File identifier
+
+ INTEGER :: error ! Error flag
+
+ CALL h5open_f (error)
+ CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
+ CALL h5fclose_f(file_id, error)
+ CALL h5close_f(error)
+ END PROGRAM ARGS
+EOF
# Parse option
# None
-# Print a line-line message left justified in a field of 70 characters
+# Print a line-line message left justified in a field of 73 characters
# beginning with the word "Testing".
#
TESTING() {
SPACES=" "
- echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+ echo "Testing $* $SPACES" | cut -c1-73 | tr -d '\012'
}
@@ -199,6 +222,10 @@ $RANLIB $applib
TOOLTEST $appmain $applib
TOOLTEST $appmain_o $applib
+# HDF5 program that depends on input args.
+echo "***"Simple Compile and Link in one step with user-supplied arguments.
+TOOLTEST -DSGL_QUOTE=\'H\' -DDBL_QUOTE=\"HDF\" -DMISC=42 $args
+
# No preprocess test since -E is not a common option for Fortran compilers.
##############################################################################