diff --git a/.github/workflows/ci_linux_meson.yml b/.github/workflows/ci_linux_meson.yml index d4d51c5d..845fd544 100644 --- a/.github/workflows/ci_linux_meson.yml +++ b/.github/workflows/ci_linux_meson.yml @@ -4,7 +4,6 @@ on: push: paths: - "**.build" - - "**.f90" - ".github/workflows/ci_linux_meson.yml" pull_request: diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5727f9..c9468a41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,12 @@ if(NOT CMAKE_BUILD_TYPE) endif() project(h5fortran LANGUAGES C Fortran - VERSION 2.9.1 + VERSION 2.9.2 DESCRIPTION "thin, light object-oriented HDF5 Fortran interface" HOMEPAGE_URL https://github.com/scivision/h5fortran) enable_testing() include(CTest) +include(FeatureSummary) option(test_shaky "run shaky tests" OFF) @@ -19,19 +20,11 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hdf5.cmake) if(NOT HDF5OK) - - message(STATUS "HDF5 library not working with ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}") - - if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) - message(FATAL_ERROR) + message(STATUS "h5fortran: HDF5 not working") + if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + return() endif() - - unset(h5fortran) - unset(h5fortran::fortran) - message(STATUS "h5fortran disabled") - return() - -endif(NOT HDF5OK) +endif() set(CTEST_TEST_TIMEOUT 15) @@ -55,7 +48,6 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake) - include(FeatureSummary) set_package_properties(Threads PROPERTIES DESCRIPTION "the system threads library") set_package_properties(HDF5 PROPERTIES URL "https://hdfgroup.org/" DESCRIPTION "fast, versatile file I/O format" TYPE REQUIRED) set_package_properties(ZLIB PROPERTIES URL "https://www.zlib.net/" DESCRIPTION "patent-free compression library") diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index 290b6539..a6b2e72e 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -33,7 +33,7 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG) endif() include(CheckFortranSourceCompiles) -check_fortran_source_compiles("implicit none (external); end" f2018impnone SRC_EXT f90) +check_fortran_source_compiles("implicit none (type, external); end" f2018impnone SRC_EXT f90) if(NOT f2018impnone) - message(FATAL_ERROR "Compiler does not support Fortran 2018 IMPLICIT NONE (EXTERNAL): ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}") + message(FATAL_ERROR "Compiler does not support Fortran 2018 implicit none (type, external): ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}") endif() diff --git a/cmake/hdf5.cmake b/cmake/hdf5.cmake index 104c3522..0e777e19 100644 --- a/cmake/hdf5.cmake +++ b/cmake/hdf5.cmake @@ -7,7 +7,12 @@ if(WIN32 AND CMAKE_Fortran_COMPILER_ID STREQUAL Intel) set(HDF5_USE_STATIC_LIBRARIES false) endif() -find_package(HDF5 COMPONENTS Fortran HL) +if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + find_package(HDF5 COMPONENTS Fortran HL REQUIRED) +else() + find_package(HDF5 COMPONENTS Fortran HL) +endif() + if(NOT HDF5_FOUND) return() endif() diff --git a/meson.build b/meson.build index 8eea7889..18f01935 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('h5fortran', 'fortran', meson_version : '>=0.52.0', - version : '2.9.1', + version : '2.9.2', default_options : ['default_library=static', 'buildtype=release', 'warning_level=3']) subdir('meson') diff --git a/src/interface.f90 b/src/interface.f90 index 4d6dbc52..4d807bc7 100644 --- a/src/interface.f90 +++ b/src/interface.f90 @@ -16,7 +16,7 @@ module h5fortran use string_utils, only : toLower, strip_trailing_null, truncate_string_null -implicit none (external) +implicit none (type, external) private public :: hdf5_file, toLower, hdf_shape_check, hdf_get_slice, hdf_wrapup, hsize_t, strip_trailing_null, truncate_string_null, & check, h5write, h5read diff --git a/src/read.f90 b/src/read.f90 index 5839f34a..70c98e6d 100644 --- a/src/read.f90 +++ b/src/read.f90 @@ -4,7 +4,7 @@ h5pget_layout_f, h5pget_chunk_f, H5D_CONTIGUOUS_F, H5D_CHUNKED_F use H5LT, only : h5ltpath_valid_f -implicit none (external) +implicit none (type, external) contains diff --git a/src/reader.f90 b/src/reader.f90 index e9f4f96d..260644df 100644 --- a/src/reader.f90 +++ b/src/reader.f90 @@ -4,7 +4,7 @@ use hdf5, only : h5dread_f use h5lt, only : h5ltread_dataset_string_f -implicit none (external) +implicit none (type, external) contains diff --git a/src/reader_lt.f90 b/src/reader_lt.f90 index e0ebd6df..f30a7129 100644 --- a/src/reader_lt.f90 +++ b/src/reader_lt.f90 @@ -1,6 +1,6 @@ submodule (h5fortran:read) reader_lt -implicit none (external) +implicit none (type, external) contains diff --git a/src/reader_nd.f90 b/src/reader_nd.f90 index 943c0fcf..6d750f8f 100644 --- a/src/reader_nd.f90 +++ b/src/reader_nd.f90 @@ -1,7 +1,7 @@ !! conceptual--not tested--will use h5dread_f instead submodule (h5fortran:read) reader_ND -implicit none (external) +implicit none (type, external) contains diff --git a/src/string_utils.f90 b/src/string_utils.f90 index 8ba2f65c..8472f1a9 100644 --- a/src/string_utils.f90 +++ b/src/string_utils.f90 @@ -3,7 +3,7 @@ module string_utils use, intrinsic:: iso_c_binding, only: c_null_char -implicit none (external) +implicit none (type, external) contains diff --git a/src/tests/read_slice.f90 b/src/tests/read_slice.f90 index c30d4d10..0fce1a33 100644 --- a/src/tests/read_slice.f90 +++ b/src/tests/read_slice.f90 @@ -1,7 +1,7 @@ program read_slice !! example of Fortran reading smaller array into slice of larger array via subroutine -implicit none (external) +implicit none (type, external) type :: foo integer :: i44(4,4) diff --git a/src/tests/test_array.f90 b/src/tests/test_array.f90 index 7d351df2..991a516d 100644 --- a/src/tests/test_array.f90 +++ b/src/tests/test_array.f90 @@ -4,7 +4,7 @@ module test_array use, intrinsic :: iso_fortran_env, only: real32, real64, int32, stderr=>error_unit use h5fortran, only : hdf5_file, hsize_t -implicit none (external) +implicit none (type, external) real(real32) :: nan diff --git a/src/tests/test_deflate.f90 b/src/tests/test_deflate.f90 index 317e9312..975ac19c 100644 --- a/src/tests/test_deflate.f90 +++ b/src/tests/test_deflate.f90 @@ -5,7 +5,7 @@ program test_deflate use h5fortran, only: hdf5_file, toLower, strip_trailing_null, truncate_string_null use hdf5, only: H5D_CHUNKED_F, H5D_CONTIGUOUS_F, hsize_t -implicit none (external) +implicit none (type, external) character(:), allocatable :: path character(256) :: argv diff --git a/src/tests/test_error.f90 b/src/tests/test_error.f90 index c9740e56..0be5ba2e 100644 --- a/src/tests/test_error.f90 +++ b/src/tests/test_error.f90 @@ -3,7 +3,7 @@ program test_error use, intrinsic:: iso_fortran_env, only: int32, real32, real64, stderr=>error_unit use h5fortran, only: hdf5_file -implicit none (external) +implicit none (type, external) type(hdf5_file) :: h5f diff --git a/src/tests/test_exist.f90 b/src/tests/test_exist.f90 index 9a40aa13..1396c765 100644 --- a/src/tests/test_exist.f90 +++ b/src/tests/test_exist.f90 @@ -3,7 +3,7 @@ program test_exist use, intrinsic :: iso_fortran_env, only : stderr=>error_unit use h5fortran, only: hdf5_file, h5write -implicit none (external) +implicit none (type, external) type(hdf5_file) :: h character(:), allocatable :: path diff --git a/src/tests/test_hdf5_ifc.f90 b/src/tests/test_hdf5_ifc.f90 index a591a816..40bd2728 100644 --- a/src/tests/test_hdf5_ifc.f90 +++ b/src/tests/test_hdf5_ifc.f90 @@ -9,7 +9,7 @@ program test_hdf5 use test_scalar, only : test_scalar_rw use test_string, only : test_string_rw, test_lowercase, test_strip_null -implicit none (external) +implicit none (type, external) character(:), allocatable :: path character(256) :: argv diff --git a/src/tests/test_lt.f90 b/src/tests/test_lt.f90 index 0ab24002..720c4467 100644 --- a/src/tests/test_lt.f90 +++ b/src/tests/test_lt.f90 @@ -2,7 +2,7 @@ module test_lt use h5fortran, only : h5write, h5read -implicit none (external) +implicit none (type, external) contains diff --git a/src/tests/test_minimal.f90 b/src/tests/test_minimal.f90 index 548c5339..90f4ec40 100644 --- a/src/tests/test_minimal.f90 +++ b/src/tests/test_minimal.f90 @@ -3,7 +3,7 @@ program test_minimal use hdf5, only : HID_T, HSIZE_T, H5_INTEGER_KIND, h5kind_to_type, h5open_f, h5close_f, h5fclose_f, h5fcreate_f, H5F_ACC_TRUNC_F use h5lt, only : h5ltmake_dataset_f -implicit none (external) +implicit none (type, external) integer :: ierr, p integer(HID_T) :: lid diff --git a/src/tests/test_scalar.f90 b/src/tests/test_scalar.f90 index 3e623fca..01e1f30f 100644 --- a/src/tests/test_scalar.f90 +++ b/src/tests/test_scalar.f90 @@ -4,7 +4,7 @@ module test_scalar use hdf5, only: HSIZE_T use h5fortran, only: hdf5_file -implicit none (external) +implicit none (type, external) contains diff --git a/src/tests/test_shape.f90 b/src/tests/test_shape.f90 index 5a99503c..2f3f868d 100644 --- a/src/tests/test_shape.f90 +++ b/src/tests/test_shape.f90 @@ -3,7 +3,7 @@ program test_shape use h5fortran, only: hdf5_file,hsize_t use, intrinsic:: iso_fortran_env, only: real64, stdout=>output_unit, stderr=>error_unit -implicit none (external) +implicit none (type, external) type(hdf5_file) :: h5f character(1024) :: argv diff --git a/src/tests/test_string.f90 b/src/tests/test_string.f90 index d0fc0aa5..aa32b66d 100644 --- a/src/tests/test_string.f90 +++ b/src/tests/test_string.f90 @@ -5,7 +5,7 @@ module test_string use h5fortran, only : toLower, hdf5_file, strip_trailing_null, truncate_string_null -implicit none (external) +implicit none (type, external) contains diff --git a/src/write.f90 b/src/write.f90 index c4180fc9..54155ffe 100644 --- a/src/write.f90 +++ b/src/write.f90 @@ -8,7 +8,7 @@ use H5LT, only: h5ltpath_valid_f, h5ltset_attribute_string_f, h5ltmake_dataset_string_f -implicit none (external) +implicit none (type, external) contains diff --git a/src/writer.f90 b/src/writer.f90 index 63d515a6..b3e073a0 100644 --- a/src/writer.f90 +++ b/src/writer.f90 @@ -2,7 +2,7 @@ !! This submodule is for writing 0-D..7-D data use hdf5, only: h5dwrite_f -implicit none (external) +implicit none (type, external) contains diff --git a/src/writer_lt.f90 b/src/writer_lt.f90 index cece5115..65b0fa63 100644 --- a/src/writer_lt.f90 +++ b/src/writer_lt.f90 @@ -1,6 +1,6 @@ submodule (h5fortran:write) writer_lt -implicit none (external) +implicit none (type, external) contains diff --git a/src/writer_nd.f90 b/src/writer_nd.f90 index fd01fdea..811c1d09 100644 --- a/src/writer_nd.f90 +++ b/src/writer_nd.f90 @@ -1,7 +1,7 @@ !! conceptual--not tested submodule (h5fortran:write) writer_ND -implicit none (external) +implicit none (type, external) contains