summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-11-10 13:36:46 (GMT)
committerGitHub <noreply@github.com>2023-11-10 13:36:46 (GMT)
commit66786fa036fa6da86c56725808c3d82d48a89b0e (patch)
tree5de41a8e066d52c2b9eee37a3d6e258728f73df5 /fortran
parente0d095ebf020706ec7d7c82e6674b18f1a0a2d5b (diff)
downloadhdf5-66786fa036fa6da86c56725808c3d82d48a89b0e.zip
hdf5-66786fa036fa6da86c56725808c3d82d48a89b0e.tar.gz
hdf5-66786fa036fa6da86c56725808c3d82d48a89b0e.tar.bz2
Add intel oneapi windows build to CI CMake (#3836)
Diffstat (limited to 'fortran')
-rw-r--r--fortran/examples/ph5example.f906
-rw-r--r--fortran/src/CMakeLists.txt24
-rw-r--r--fortran/src/H5Pff.F902
-rw-r--r--fortran/src/H5config_f.inc.cmake34
-rw-r--r--fortran/src/H5config_f.inc.in2
-rw-r--r--fortran/src/hdf5_fortrandll.def.in12
-rw-r--r--fortran/test/tH5T_F03.F9014
7 files changed, 55 insertions, 39 deletions
diff --git a/fortran/examples/ph5example.f90 b/fortran/examples/ph5example.f90
index 138969e..29423b3 100644
--- a/fortran/examples/ph5example.f90
+++ b/fortran/examples/ph5example.f90
@@ -24,7 +24,7 @@
CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name
CHARACTER(LEN=100) :: filename ! File name
- INTEGER :: fnamelen ! File name length
+ INTEGER :: fnamelen ! File name length
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id ! Dataset identifier
INTEGER(HID_T) :: filespace ! Dataspace identifier in file
@@ -76,9 +76,9 @@
CALL get_environment_variable("HDF5_PARAPREFIX", filename)
fnamelen = LEN_TRIM(filename)
if ( fnamelen == 0 ) then
- filename = default_fname
+ filename = default_fname
else
- filename = filename(1:fnamelen) // "/" // default_fname
+ filename = filename(1:fnamelen) // "/" // default_fname
endif
print *, "Using filename = ", filename
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 57e17e5..d054503 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -9,12 +9,15 @@ if (WIN32)
if (NOT H5_HAVE_PARALLEL)
set (H5_NOPAREXP ";")
endif ()
+ set (H5_NOSUBFILING ";") # Subfiling is not supported on Windows
set (H5_F03EXP ";")
if (NOT H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE)
set (H5_DBL_NOT_UNIQUE_EXP ";")
endif ()
+ set (CMAKE_NO_DEPRECATED_SYMBOLS 0)
if (NOT H5_NO_DEPRECATED_SYMBOLS)
- set (H5_NO_DEPRECATED_SYMBOLS ";")
+ set (CMAKE_NO_DEPRECATED_SYMBOLS 1)
+ set (DLL_NO_DEPRECATED_SYMBOLS ";")
endif ()
configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY)
endif ()
@@ -25,8 +28,12 @@ endif ()
# Define Parallel variable for passing to H5config_f.inc.cmake
set (CMAKE_H5_HAVE_PARALLEL 0)
+set (CMAKE_H5_HAVE_SUBFILING_VFD 0)
if (H5_HAVE_PARALLEL)
set (CMAKE_H5_HAVE_PARALLEL 1)
+ if (H5_HAVE_SUBFILING_VFD)
+ set (CMAKE_H5_HAVE_SUBFILING_VFD 1)
+ endif ()
endif ()
set (CMAKE_H5_HAVE_FLOAT128 0)
@@ -341,8 +348,6 @@ if (BUILD_STATIC_LIBS)
${LINK_Fortran_LIBS}
"$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
-# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>")
-# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>")
if(MSVC)
set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
@@ -358,7 +363,12 @@ if (BUILD_STATIC_LIBS)
endif ()
if (BUILD_SHARED_LIBS)
- add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED})
+ if(WIN32)
+ set(DLLDEF ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def)
+ else()
+ set(DLLDEF "")
+ endif()
+ add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${DLLDEF} ${f90_F_SOURCES_SHARED})
target_include_directories (${HDF5_F90_LIBSH_TARGET}
PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${HDF5_INSTALL_MODULE_DIR}/shared>"
@@ -374,12 +384,8 @@ if (BUILD_SHARED_LIBS)
PUBLIC ${HDF5_F90_C_LIBSH_TARGET}
PRIVATE ${LINK_Fortran_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>")
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>")
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DLL>")
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def>")
if(MSVC)
- set_property(TARGET ${HDF5_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} /DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def")
+ set_property(TARGET ${HDF5_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
set_target_properties (${HDF5_F90_LIBSH_TARGET} PROPERTIES
FOLDER libraries/fortran
diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90
index 5765095..afd17f3 100644
--- a/fortran/src/H5Pff.F90
+++ b/fortran/src/H5Pff.F90
@@ -5342,7 +5342,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr)
!! \brief Retrieves local and global causes that broke collective I/O on the last parallel I/O call.
!!
!! \param plist_id Dataset transfer property list identifier
-!! \param local_no_collective_cause An enumerated set value indicating the causes that prevented collective I/O in the local process
+!! \param local_no_collective_cause An enumerated set value indicating the causes that prevented collective I/O in the local process
!! \param global_no_collective_cause An enumerated set value indicating the causes across all processes that prevented collective I/O
!! \param hdferr \fortran_error
!!
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index 71bce0e..0f274db 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -12,33 +12,39 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! Define if there is parallel support
-#cmakedefine01 H5_HAVE_PARALLEL
-#if H5_HAVE_PARALLEL == 0
+#cmakedefine01 CMAKE_H5_HAVE_PARALLEL
+#if CMAKE_H5_HAVE_PARALLEL == 0
#undef H5_HAVE_PARALLEL
+#else
+#define H5_HAVE_PARALLEL
#endif
! Define if there is subfiling support
-#cmakedefine01 H5_HAVE_SUBFILING_VFD
-#if H5_HAVE_SUBFILING_VFD == 0
+#cmakedefine01 CMAKE_H5_HAVE_SUBFILING_VFD
+#if CMAKE_H5_HAVE_SUBFILING_VFD == 0
#undef H5_HAVE_SUBFILING_VFD
+#else
+#define H5_HAVE_SUBFILING_VFD
#endif
! Define if on APPLE
#cmakedefine01 H5_HAVE_DARWIN
#if H5_HAVE_DARWIN == 0
#undef H5_HAVE_DARWIN
+#else
+#define H5_HAVE_DARWIN
#endif
! Define if the intrinsic function STORAGE_SIZE exists
-#define H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
+#cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
! Define if the intrinsic function SIZEOF exists
-#define H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
+#cmakedefine H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
! Define if the intrinsic function C_SIZEOF exists
-#define H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
+#cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
-! Define if the intrinsic C_LONG_DOUBLE exists
+! Define if the intrinsic function C_LONG_DOUBLE exists
#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@
! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE
@@ -47,17 +53,17 @@
! Define if the intrinsic module ISO_FORTRAN_ENV exists
#define H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
-! should this be ${HDF_PREFIX} instead of H5 MSB
+! Define the size of C's double
#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
-! should this be ${HDF_PREFIX} instead of H5 MSB
+! Define the size of C's long double
#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
! Define the maximum decimal precision for reals
#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
! If C has quad precision
-#define H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
+#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
! Define if INTEGER*16 is available
#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
@@ -84,7 +90,9 @@
#define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@
! Define if deprecated public API symbols are disabled
-#cmakedefine01 H5_NO_DEPRECATED_SYMBOLS
-#if H5_NO_DEPRECATED_SYMBOLS == 0
+#cmakedefine01 CMAKE_NO_DEPRECATED_SYMBOLS
+#if CMAKE_NO_DEPRECATED_SYMBOLS == 0
#undef H5_NO_DEPRECATED_SYMBOLS
+#else
+#define H5_NO_DEPRECATED_SYMBOLS
#endif
diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in
index 991e4b0..3aeded9 100644
--- a/fortran/src/H5config_f.inc.in
+++ b/fortran/src/H5config_f.inc.in
@@ -41,7 +41,7 @@
! Define if the intrinsic module ISO_FORTRAN_ENV exists
#undef HAVE_ISO_FORTRAN_ENV
-! Define the size of C's long double
+! Define the size of C's double
#undef SIZEOF_DOUBLE
! Define the size of C's long double
diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in
index a8399a3..55f4f2b 100644
--- a/fortran/src/hdf5_fortrandll.def.in
+++ b/fortran/src/hdf5_fortrandll.def.in
@@ -16,7 +16,7 @@ H5A_mp_H5AREAD_CHAR_SCALAR
H5A_mp_H5ACREATE_F
H5A_mp_H5ACREATE_ASYNC_F
H5A_mp_H5AOPEN_NAME_F
-@H5_NO_DEPRECATED_SYMBOLS@H5A_mp_H5AOPEN_IDX_F
+@DLL_NO_DEPRECATED_SYMBOLS@H5A_mp_H5AOPEN_IDX_F
H5A_mp_H5AGET_SPACE_F
H5A_mp_H5AGET_TYPE_F
H5A_mp_H5AGET_NAME_F
@@ -253,7 +253,9 @@ H5O_mp_H5OVISIT_BY_NAME_F
H5O_mp_H5OVISIT_F
H5O_mp_H5OTOKEN_CMP_F
; H5P
+H5P_mp_H5PCLOSE_F
H5P_mp_H5PCREATE_F
+H5P_mp_H5PCREATE_CLASS_F
H5P_mp_H5PSET_PRESERVE_F
H5P_mp_H5PGET_PRESERVE_F
H5P_mp_H5PGET_CLASS_F
@@ -419,10 +421,10 @@ H5P_mp_H5PGET_ACTUAL_SELECTION_IO_MODE_F
; Parallel
@H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F
@H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F
-@H5_NOPAREXP@H5P_mp_H5PSET_FAPL_SUBFILING_F
-@H5_NOPAREXP@H5P_mp_H5PGET_FAPL_SUBFILING_F
-@H5_NOPAREXP@H5P_mp_H5PSET_FAPL_IOC_F
-@H5_NOPAREXP@H5P_mp_H5PGET_FAPL_IOC_F
+@H5_NOPAREXP@@H5_NOSUBFILING@H5P_mp_H5PSET_FAPL_SUBFILING_F
+@H5_NOPAREXP@@H5_NOSUBFILING@H5P_mp_H5PGET_FAPL_SUBFILING_F
+@H5_NOPAREXP@@H5_NOSUBFILING@H5P_mp_H5PSET_FAPL_IOC_F
+@H5_NOPAREXP@@H5_NOSUBFILING@H5P_mp_H5PGET_FAPL_IOC_F
@H5_NOPAREXP@H5P_mp_H5PSET_MPI_PARAMS_F
@H5_NOPAREXP@H5P_mp_H5PGET_MPI_PARAMS_F
@H5_NOPAREXP@H5P_mp_H5PSET_DXPL_MPIO_F
diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90
index 3984597..08dfa22 100644
--- a/fortran/test/tH5T_F03.F90
+++ b/fortran/test/tH5T_F03.F90
@@ -984,7 +984,7 @@ END SUBROUTINE test_array_compound_atomic
INTEGER, PARAMETER :: real_kind_15 = C_DOUBLE !should map to REAL*8 on most modern processors
! Check if C has quad precision extension
-#if H5_HAVE_FLOAT128!=0
+#ifdef H5_HAVE_FLOAT128
! Check if Fortran supports quad precision
# if H5_PAC_FC_MAX_REAL_PRECISION > 26
INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(31)
@@ -3400,7 +3400,7 @@ SUBROUTINE multiple_dset_rw(total_error)
!-------------------------------------------------------------------------
! Subroutine: multiple_dset_rw
!
-! Purpose: Tests the reading and writing of multiple datasets
+! Purpose: Tests the reading and writing of multiple datasets
! using H5Dread_multi and H5Dwrite_multi
!
! Return: Success: 0
@@ -3408,10 +3408,10 @@ SUBROUTINE multiple_dset_rw(total_error)
!-------------------------------------------------------------------------
!
IMPLICIT NONE
-
+
INTEGER, INTENT(INOUT) :: total_error ! number of errors
INTEGER :: error ! HDF hdferror flag
-
+
INTEGER(SIZE_T), PARAMETER :: ndset = 5 ! Number of data sets
INTEGER(HID_T), DIMENSION(:), ALLOCATABLE :: dset_id
INTEGER(HID_T), DIMENSION(:), ALLOCATABLE :: mem_type_id
@@ -3424,9 +3424,9 @@ SUBROUTINE multiple_dset_rw(total_error)
INTEGER, PARAMETER :: sdim=2 ! length of character string
INTEGER, PARAMETER :: ddim=2 ! size of derived type array
INTEGER :: i,j,k
-
+
TYPE(C_PTR), ALLOCATABLE, DIMENSION(:) :: buf_md ! array to hold the multi-datasets
-
+
INTEGER, DIMENSION(1:idim), TARGET :: wbuf_int ! integer write buffer
INTEGER, DIMENSION(1:idim,idim2,idim3), TARGET :: wbuf_intmd
REAL, DIMENSION(1:rdim), TARGET :: wbuf_real ! real write buffer
@@ -3535,7 +3535,7 @@ SUBROUTINE multiple_dset_rw(total_error)
CALL check("h5tinsert_f", error, total_error)
CALL h5tcopy_f(H5T_NATIVE_CHARACTER, strtype, error)
CALL check("h5tcopy_f", error, total_error)
- CALL h5tset_size_f(strtype, INT(sdim,size_t), error)
+ CALL h5tset_size_f(strtype, INT(sdim,size_t), error)
CALL check("h5tset_size_f", error, total_error)
CALL h5tinsert_f(mem_type_id(4), "chr", &
H5OFFSETOF(C_LOC(wbuf_derived(1)),C_LOC(wbuf_derived(1)%c(1:1))), strtype, error)