diff options
-rw-r--r-- | .github/workflows/intel-cmake.yml | 114 | ||||
-rw-r--r-- | .github/workflows/main-cmake.yml | 60 | ||||
-rw-r--r-- | config/cmake-presets/hidden-presets.json | 80 | ||||
-rw-r--r-- | fortran/examples/ph5example.f90 | 6 | ||||
-rw-r--r-- | fortran/src/CMakeLists.txt | 24 | ||||
-rw-r--r-- | fortran/src/H5Pff.F90 | 2 | ||||
-rw-r--r-- | fortran/src/H5config_f.inc.cmake | 34 | ||||
-rw-r--r-- | fortran/src/H5config_f.inc.in | 2 | ||||
-rw-r--r-- | fortran/src/hdf5_fortrandll.def.in | 12 | ||||
-rw-r--r-- | fortran/test/tH5T_F03.F90 | 14 | ||||
-rw-r--r-- | hl/fortran/src/CMakeLists.txt | 18 | ||||
-rw-r--r-- | hl/fortran/src/H5LTff.F90 | 14 |
12 files changed, 282 insertions, 98 deletions
diff --git a/.github/workflows/intel-cmake.yml b/.github/workflows/intel-cmake.yml index 9972376..94dc6cf 100644 --- a/.github/workflows/intel-cmake.yml +++ b/.github/workflows/intel-cmake.yml @@ -13,69 +13,111 @@ permissions: contents: read jobs: - Intel_build_and_test: - name: "Intel ${{ inputs.build_mode }}" + # Linux (Ubuntu) w/ gcc + CMake + # + Intel_oneapi_linux: + name: "ubuntu-oneapi ${{ inputs.build_mode }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: add oneAPI to apt - shell: bash - run: | - cd /tmp - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main" - + # Only CMake need ninja-build, but we just install it unilaterally + # libssl, etc. are needed for the ros3 VFD - name: Install Linux Dependencies run: | - sudo apt update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - - name: install oneAPI dpcpp and fortran compiler - shell: bash - run: | - sudo apt update - sudo apt install -y intel-oneapi-compiler-dpcpp-cpp - sudo apt install -y intel-oneapi-compiler-fortran - - - name: install oneAPI MKL library - shell: bash - run: | - sudo apt install -y intel-oneapi-mkl-devel + - name: add oneAPI to env + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2023.2' - - name: CMake Configure with icx + - name: CMake Configure with oneapi shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja \ + cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja \ -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DCMAKE_TOOLCHAIN_FILE=config/toolchain/intel.cmake \ - -DMKL_ROOT="/opt/intel/oneapi/mkl/latest" \ - -DTBB_ROOT="/opt/intel/oneapi/tbb/latest" \ -DLIBAEC_USE_LOCALCONTENT=OFF \ -DZLIB_USE_LOCALCONTENT=OFF \ - -DHDF5_BUILD_FORTRAN=OFF \ $GITHUB_WORKSPACE # BUILD - name: CMake Build shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh cmake --build . --parallel 3 --config ${{ inputs.build_mode }} working-directory: ${{ runner.workspace }}/build # RUN TESTS - name: CMake Run Tests shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export SYCL_DEVICE_FILTER=opencl.cpu ctest . --parallel 2 -C ${{ inputs.build_mode }} -V working-directory: ${{ runner.workspace }}/build + + Intel_oneapi_windows: + name: "windows-oneapi ${{ inputs.build_mode }}" + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Dependencies (Windows) + run: choco install ninja + + - name: add oneAPI to env + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2023.2' + + - name: CMake Configure with oneapi + shell: pwsh + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} + run: | + mkdir "${{ runner.workspace }}/build" + Set-Location -Path "${{ runner.workspace }}\\build" + cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} -DHDF5_BUILD_FORTRAN=ON -DLIBAEC_USE_LOCALCONTENT=OFF -DZLIB_USE_LOCALCONTENT=OFF ${{ github.workspace }} + + # BUILD + - name: CMake Build + shell: pwsh + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} + run: | + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build + + # RUN TESTS + - name: CMake Run Tests + shell: pwsh + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} + run: | + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -E tfloatsattrs + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/main-cmake.yml b/.github/workflows/main-cmake.yml index 0bf383b..18d4a39 100644 --- a/.github/workflows/main-cmake.yml +++ b/.github/workflows/main-cmake.yml @@ -249,3 +249,63 @@ jobs: # # INSTALL (note that this runs even when we don't run the tests) # + + # + # The GitHub runners are inadequate for running parallel HDF5 tests, + # so we catch most issues in daily testing. What we have here is just + # a compile check to make sure nothing obvious is broken. + # A workflow that builds the library + # Parallel Linux (Ubuntu) w/ gcc + Autotools + # + CMake_build_parallel: + name: "Parallel GCC-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}" + # Don't run the action if the commit message says to skip CI + if: "!contains(github.event.head_commit.message, 'skip-ci')" + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # SETUP + - name: Install Linux Dependencies + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + sudo apt install libaec0 libaec-dev + sudo apt install openmpi-bin openmpi-common mpi-default-dev + echo "CC=mpicc" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4 + + # CMAKE CONFIGURE + - name: CMake Configure + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ENABLE_ALL_WARNINGS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DHDF5_BUILD_FORTRAN=ON \ + -DHDF5_BUILD_JAVA=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_ENABLE_MIRROR_VFD:BOOL=OFF \ + -DHDF5_ENABLE_DIRECT_VFD:BOOL=OFF \ + -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ + $GITHUB_WORKSPACE + shell: bash + + # BUILD + - name: CMake Build + run: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build diff --git a/config/cmake-presets/hidden-presets.json b/config/cmake-presets/hidden-presets.json index fad63b7..81ac98f 100644 --- a/config/cmake-presets/hidden-presets.json +++ b/config/cmake-presets/hidden-presets.json @@ -205,6 +205,28 @@ ] }, { + "name": "ci-x64-Debug-Intel", + "description": "Intel for x64 (Debug)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-x64", + "ci-Debug", + "ci-Intel" + ] + }, + { + "name": "ci-x64-Release-Intel", + "description": "Intel for x64 (Release)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-x64", + "ci-Release", + "ci-Intel" + ] + }, + { "name": "ci-x64-Debug-MSVC-asan", "description": "x64-Debug-MSVC with /fsanitize=address", "hidden": true, @@ -265,7 +287,8 @@ "hidden": true, "inherits": [ "ci-base" - ] + ], + "configuration": "Debug" }, { "name": "ci-x64-Release-MSVC", @@ -273,7 +296,8 @@ "hidden": true, "inherits": [ "ci-base" - ] + ], + "configuration": "RelWithDebInfo" }, { "name": "ci-x64-Debug-Clang", @@ -308,6 +332,24 @@ ] }, { + "name": "ci-x64-Debug-Intel", + "configurePreset": "ci-x64-Debug-Intel", + "hidden": true, + "inherits": [ + "ci-base" + ], + "configuration": "Debug" + }, + { + "name": "ci-x64-Release-Intel", + "configurePreset": "ci-x64-Release-Intel", + "hidden": true, + "inherits": [ + "ci-base" + ], + "configuration": "RelWithDebInfo" + }, + { "name": "ci-x64-Debug-MSVC-asan", "configurePreset": "ci-x64-Debug-MSVC-asan", "hidden": true, @@ -370,7 +412,8 @@ "hidden": true, "inherits": [ "ci-base" - ] + ], + "configuration": "Debug" }, { "name": "ci-x64-Release-MSVC", @@ -378,7 +421,8 @@ "hidden": true, "inherits": [ "ci-base" - ] + ], + "configuration": "RelWithDebInfo" }, { "name": "ci-x64-Debug-Clang", @@ -413,6 +457,22 @@ ] }, { + "name": "ci-x64-Debug-Intel", + "configurePreset": "ci-x64-Debug-Intel", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-x64-Release-Intel", + "configurePreset": "ci-x64-Release-Intel", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { "name": "ci-x64-Debug-MSVC-asan", "configurePreset": "ci-x64-Debug-MSVC-asan", "hidden": true, @@ -467,7 +527,8 @@ "inherits": "ci-base", "generators": [ "ZIP" - ] + ], + "configurations": ["Release"] }, { "name": "ci-x64-Release-Clang", @@ -486,6 +547,15 @@ "generators": [ "TGZ" ] + }, + { + "name": "ci-x64-Release-Intel", + "configurePreset": "ci-x64-Release-Intel", + "hidden": true, + "inherits": "ci-base", + "generators": [ + "TGZ" + ] } ] } 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) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index ed469e5..f225eb8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -22,9 +22,6 @@ if (WIN32 AND MSVC) set_target_properties (H5HL_buildiface PROPERTIES COMPILE_FLAGS "/MT") endif () endif () -#set_property(TARGET H5HL_buildiface APPEND PROPERTY -# LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>" -#) if(MSVC) set_property(TARGET H5HL_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") endif() @@ -182,8 +179,6 @@ if (BUILD_STATIC_LIBS) PRIVATE "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>") -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -198,7 +193,12 @@ if (BUILD_STATIC_LIBS) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) endif () if (BUILD_SHARED_LIBS) - add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED}) + if(WIN32) + set(DLLDEF ${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def) + else() + set(DLLDEF "") + endif() + add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${DLLDEF} ${HDF5_HL_F90_F_SOURCES_SHARED}) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${HDF5_INSTALL_MODULE_DIR}/shared>" @@ -214,12 +214,8 @@ if (BUILD_SHARED_LIBS) PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS} ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>") -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>") -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DLL>") -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def>") if(MSVC) - set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL -DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") + set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl/fortran diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index 8b4e6d3..80e9fe7 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -1115,7 +1115,7 @@ CONTAINS f_ptr = C_LOC(buf(1:1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf_type = SIZEOF(buf(1)) @@ -1165,7 +1165,7 @@ CONTAINS INTEGER(size_t) :: SizeOf_buf_type f_ptr = C_LOC(buf(1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf_type = SIZEOF(buf(1)) @@ -1216,7 +1216,7 @@ CONTAINS f_ptr = C_LOC(buf(1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf_type = SIZEOF(buf(1)) @@ -1264,7 +1264,7 @@ CONTAINS f_ptr = C_LOC(buf(1)(1:1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf_type = STORAGE_SIZE(buf(1)(1:1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf_type = SIZEOF(buf(1:1)(1:1)) @@ -1363,7 +1363,7 @@ CONTAINS f_ptr = C_LOC(buf(1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf = SIZEOF(buf(1)) @@ -1407,7 +1407,7 @@ CONTAINS INTEGER(size_t) :: SizeOf_buf f_ptr = C_LOC(buf(1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf = SIZEOF(buf(1)) @@ -1451,7 +1451,7 @@ CONTAINS INTEGER(size_t) :: SizeOf_buf f_ptr = C_LOC(buf(1)) -#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else SizeOf_buf = SIZEOF(buf(1)) |