hdf5/m4/aclocal_fc.f90
Larry Knox dded9372c2
Sync develop changes March 25 - March 28 to hdf5_1_14 (#4284)
* Take user block into account when returning chunk addresses (#4236)

Both H5Dchunk_iter() and H5Dget_chunk_info(_by_coord)() did not take
the size of the user block into account when reporting addresses. Since
the #1 use of these functions is to root around in the file for the raw
data, this is kind of a problem.

Fixes GitHub issue #3003

* Fix a minor warning in h5test.c (#4242)

* Turn on -Werror for Java in GitHub -Werror workflows (#4243)

* Update Windows CI to not install ninja (#4230)

* Rework Fortran macros to use the proper code. (#4240)

* Correct reference copy for 16 API (#4244)

* Determine MPI LOGICAL during build, used in tests. (#4246)

* Skip userblock test in chunk_info.c for multi-file VFDs (#4249)

* Match generators with real cmake -G output on Windows (#4252)

* Add Julia GitHub Actions. (#4123)

* Re-revert to using autoreconf in autogen.sh (#4253)

We previously tried removing the per-tool invocation of the Autotools
and instead simply invoked autoreconf (PR #1906). This was reverted
when it turned out that the NAG Fortran compiler had trouble with an
undecorated -shared linker flag.

It turns out that this is due to a bug in libtool 2.4.2 and earlier.
Since this version of libtool is over a decade old, we're un-reverting
the change. We've added a release note for anyone who has to build
from source on elderly platforms.

Fixes #1343

* Rewrite H5T__path_find_real for clarity (#4225)

* Move conversion path free logic to helper function

* Add tgz extensions on names (#4255)

* Remove an error check regarding large cache objects (#4254)

* Remove an error check regarding large cache objects

In PR#4231 an assert() call was converted to a normal HDF5 error
check. It turns out that the original assert() was added by a
developer as a way of being alerted that large cache objects
existed instead of as a guard against incorrect behavior, making
it unnecessary in either debug or release builds.

The error check has been removed.

* Update RELEASE.txt

* File format security issues (#4234)

* Add job timeout to cygwin workflow (#4260)

* Replace user-define with user-defined (#4261)

* Improve the CMake clang -fsanitize=memory flags (#4267)

-fsanitize=memory is almost useless without
using -fsanitize-memory-track-origins=2 and we shoud probably add
-fno-optimize-sibling-calls as well.

* Add documentation (H5M) (#4259)

* Add documentation (H5P) (#4262)

* MPI type correction (#4268)

* corrected type for MPI_*_f2c APIs

* fixed return type of callback

* reset compilation flags of logical test program

* Clean up test/cmpd_dtransform.c (#4270)

* Clean up test/cmpd_dtransform.c

* Fix uninitialized memory warning from sanitizers
* FAIL_STACK_ERROR --> TEST_ERROR
* Emit output
* Delete test file when done

* Fix typo

* H5Fdelete() --> remove()

* Fix uninitialized memory issues in packet table (#4271)

* replace deprecated CMAKE_COMPILER_IS_GNU** (#4272)

* Prevent stack overflows in H5E__push_stack (#4264)

* Minor fixes after merge of file format security fixes (#4263)

* Update H5_IS_BUFFER_OVERFLOW to account for 'size' of 0

* Invert a few checks to avoid function call

* CHECK --> CHECK_PTR in tmisc.c (#4274)

* Add release note for CVE-2017-17507 (#4275)

* Update Cygwin installation guide (#4265)

* Addresses configuration fortran testing flags (#4276)

* turn warnings to errors in fortran configure test

* Intel fortran test fix

* Merge julia workflows into standard ci format (#4273)

* Fix range check in H5_addr_overlap (#4278)

When the H5_addr_overlap macro was updated to use H5_RANGE_OVERLAP,
it failed to take into account that H5_RANGE_OVERLAP expects the
range to be inclusive. This lead to an assertion failure in
H5MM_memcpy due to a memcpy operation on overlapping memory.
This has been fixed by subtracting 1 from the calculated high
bound values passed to H5_RANGE_OVERLAP

* Fix potential buffer read overflows in H5PB_read (#4279)

H5PB_read previously did not account for the fact that the size of the
read it's performing could overflow the page buffer pointer, depending
on the calculated offset for the read. This has been fixed by adjusting
the size of the read if it's determined that it would overflow the page.
2024-03-29 15:10:33 -05:00

255 lines
7.6 KiB
Fortran

! COPYRIGHT
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the COPYING file, which can be found at the root of the source code *
! distribution tree, or in https://www.hdfgroup.org/licenses. *
! If you do not have access to either file, you may request a copy from *
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! This file contains all the configure test programs
! used by autotools and cmake. This avoids having to
! duplicate code for both cmake and autotool tests.
! For autotools, a program below is chosen via a
! sed command in aclocal_fc.m4. For cmake, a program
! below is chosen via the macro READ_SOURCE in
! HDF5UseFortran.cmake
!
PROGRAM PROG_FC_ISO_FORTRAN_ENV
USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : logical_kinds
END PROGRAM PROG_FC_ISO_FORTRAN_ENV
PROGRAM PROG_FC_SIZEOF
i = sizeof(x)
END PROGRAM PROG_FC_SIZEOF
PROGRAM PROG_FC_C_SIZEOF
USE ISO_C_BINDING
INTEGER(C_INT) :: a
INTEGER(C_SIZE_T) :: RESULT
RESULT = C_SIZEOF(a)
END PROGRAM PROG_FC_C_SIZEOF
PROGRAM PROG_FC_STORAGE_SIZE
INTEGER :: a
INTEGER :: RESULT
RESULT = STORAGE_SIZE(a)
END PROGRAM PROG_FC_STORAGE_SIZE
PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE
USE ISO_C_BINDING
REAL(KIND=C_LONG_DOUBLE) :: d
END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE
PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS
USE iso_c_binding
IMPLICIT NONE
TYPE(C_PTR) :: ptr
TYPE(C_FUNPTR) :: funptr
CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr
ptr = C_LOC(ichr(1:1))
END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS
PROGRAM PROG_CHAR_ALLOC
CHARACTER(:), ALLOCATABLE :: str
END PROGRAM PROG_CHAR_ALLOC
!---- START ----- Check to see C_BOOL is different from LOGICAL
MODULE l_type_mod
USE ISO_C_BINDING
INTERFACE h5t
MODULE PROCEDURE h5t_c_bool
MODULE PROCEDURE h5t_logical
END INTERFACE
CONTAINS
SUBROUTINE h5t_c_bool(lcb)
LOGICAL(KIND=C_BOOL) :: lcb
END SUBROUTINE h5t_c_bool
SUBROUTINE h5t_logical(l)
LOGICAL :: l
END SUBROUTINE h5t_logical
END MODULE l_type_mod
PROGRAM PROG_FC_C_BOOL_EQ_LOGICAL
USE ISO_C_BINDING
USE l_type_mod
LOGICAL(KIND=C_BOOL) :: lcb
LOGICAL :: l
CALL h5t(lcb)
CALL h5t(l)
END PROGRAM PROG_FC_C_BOOL_EQ_LOGICAL
!---- END ------- Check to see C_BOOL is different from LOGICAL
!---- START ----- Check to see C_LONG_DOUBLE is different from C_DOUBLE
MODULE type_mod
USE ISO_C_BINDING
INTERFACE h5t
MODULE PROCEDURE h5t_c_double
MODULE PROCEDURE h5t_c_long_double
END INTERFACE
CONTAINS
SUBROUTINE h5t_c_double(r)
REAL(KIND=C_DOUBLE) :: r
END SUBROUTINE h5t_c_double
SUBROUTINE h5t_c_long_double(d)
REAL(KIND=C_LONG_DOUBLE) :: d
END SUBROUTINE h5t_c_long_double
END MODULE type_mod
PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE
USE ISO_C_BINDING
USE type_mod
REAL(KIND=C_DOUBLE) :: r
REAL(KIND=C_LONG_DOUBLE) :: d
CALL h5t(r)
CALL h5t(d)
END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE
!---- END ------- Check to see C_LONG_DOUBLE is different from C_DOUBLE
!---- START ----- Determine the available KINDs for REALs and INTEGERs
PROGRAM FC_AVAIL_KINDS
USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT
IMPLICIT NONE
INTEGER :: ik, jk, k, kk, max_decimal_prec
INTEGER :: prev_rkind, num_rkinds = 1, num_ikinds = 1
INTEGER, DIMENSION(1:10) :: list_ikinds = -1
INTEGER, DIMENSION(1:10) :: list_rkinds = -1
LOGICAL :: new_kind
! Find integer KINDs
list_ikinds(num_ikinds)=SELECTED_INT_KIND(1)
DO ik = 2, 36
k = SELECTED_INT_KIND(ik)
IF(k.LT.0) EXIT
IF(k.GT.list_ikinds(num_ikinds))THEN
num_ikinds = num_ikinds + 1
list_ikinds(num_ikinds) = k
ENDIF
ENDDO
DO k = 1, num_ikinds
WRITE(stdout,'(I0)', ADVANCE='NO') list_ikinds(k)
IF(k.NE.num_ikinds)THEN
WRITE(stdout,'(A)',ADVANCE='NO') ','
ELSE
WRITE(stdout,'()')
ENDIF
ENDDO
! Find real KINDs
list_rkinds(num_rkinds)=SELECTED_REAL_KIND(1)
max_decimal_prec = 1
prev_rkind=list_rkinds(num_rkinds)
prec: DO ik = 2, 36
exp: DO jk = 1, 700
k = SELECTED_REAL_KIND(ik,jk)
IF(k.LT.0) EXIT exp
IF(k.NE.prev_rkind)THEN
! Check if we already have that kind
new_kind = .TRUE.
DO kk = 1, num_rkinds
IF(k.EQ.list_rkinds(kk))THEN
new_kind=.FALSE.
EXIT
ENDIF
ENDDO
IF(new_kind)THEN
num_rkinds = num_rkinds + 1
list_rkinds(num_rkinds) = k
prev_rkind=list_rkinds(num_rkinds)
ENDIF
ENDIF
max_decimal_prec = ik
ENDDO exp
ENDDO prec
DO k = 1, num_rkinds
WRITE(stdout,'(I0)', ADVANCE='NO') list_rkinds(k)
IF(k.NE.num_rkinds)THEN
WRITE(stdout,'(A)',ADVANCE='NO') ','
ELSE
WRITE(stdout,'()')
ENDIF
ENDDO
WRITE(stdout,'(I0)') max_decimal_prec
WRITE(stdout,'(I0)') num_ikinds
WRITE(stdout,'(I0)') num_rkinds
END PROGRAM FC_AVAIL_KINDS
!---- END ----- Determine the available KINDs for REALs and INTEGERs
!---- START ----- Determine the available KINDs for REALs, INTEGERs and LOGICALs -- ISO_FORTRAN_ENV (F08)
PROGRAM FC08_AVAIL_KINDS
USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT, integer_kinds, real_kinds, logical_kinds
IMPLICIT NONE
INTEGER :: ik, jk, k, max_decimal_prec
INTEGER :: num_rkinds, num_ikinds, num_lkinds
! Find integer KINDs
num_ikinds = SIZE(integer_kinds)
DO k = 1, num_ikinds
WRITE(stdout,'(I0)', ADVANCE='NO') integer_kinds(k)
IF(k.NE.num_ikinds)THEN
WRITE(stdout,'(A)',ADVANCE='NO') ','
ELSE
WRITE(stdout,'()')
ENDIF
ENDDO
! Find real KINDs
num_rkinds = SIZE(real_kinds)
max_decimal_prec = 1
prec: DO ik = 2, 36
exp: DO jk = 1, 700
k = SELECTED_REAL_KIND(ik,jk)
IF(k.LT.0) EXIT exp
max_decimal_prec = ik
ENDDO exp
ENDDO prec
DO k = 1, num_rkinds
WRITE(stdout,'(I0)', ADVANCE='NO') real_kinds(k)
IF(k.NE.num_rkinds)THEN
WRITE(stdout,'(A)',ADVANCE='NO') ','
ELSE
WRITE(stdout,'()')
ENDIF
ENDDO
WRITE(stdout,'(I0)') max_decimal_prec
WRITE(stdout,'(I0)') num_ikinds
WRITE(stdout,'(I0)') num_rkinds
! Find logical KINDs
num_lkinds = SIZE(logical_kinds)
WRITE(stdout,'(I0)') num_lkinds
DO k = 1, num_lkinds
WRITE(stdout,'(I0)', ADVANCE='NO') logical_kinds(k)
IF(k.NE.num_lkinds)THEN
WRITE(stdout,'(A)',ADVANCE='NO') ','
ELSE
WRITE(stdout,'()')
ENDIF
ENDDO
END PROGRAM FC08_AVAIL_KINDS
!---- END ----- Determine the available KINDs for REALs, INTEGERs and LOGICALs -- ISO_FORTRAN_ENV (F08)
PROGRAM FC_MPI_CHECK
USE mpi
INTEGER :: comm, amode, info, fh, ierror
CHARACTER(LEN=1) :: filename
CALL MPI_File_open( comm, filename, amode, info, fh, ierror)
END PROGRAM FC_MPI_CHECK