diff --git a/.github/workflows/cmake-analysis.yml b/.github/workflows/cmake-analysis.yml index 36dea0dc39e..a978205b303 100644 --- a/.github/workflows/cmake-analysis.yml +++ b/.github/workflows/cmake-analysis.yml @@ -106,7 +106,7 @@ jobs: - name: Run ctest (Linux_coverage) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH_COV,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}_COV,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log shell: bash continue-on-error: true @@ -206,7 +206,7 @@ jobs: - name: Run ctest (Linux_Leak) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-LEAK,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-LEAK,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log shell: bash continue-on-error: true @@ -306,7 +306,7 @@ jobs: - name: Run ctest (Linux_Address) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-ADDR,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-ADDR,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log shell: bash continue-on-error: true @@ -406,7 +406,7 @@ jobs: - name: Run ctest (Linux_UndefinedBehavior) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-UNDEF,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-UNDEF,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log shell: bash continue-on-error: true diff --git a/.github/workflows/cmake-script.yml b/.github/workflows/cmake-script.yml index f30504f10da..617eb4b0236 100644 --- a/.github/workflows/cmake-script.yml +++ b/.github/workflows/cmake-script.yml @@ -111,7 +111,7 @@ jobs: - name: Run ctest script (Windows) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }},LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true @@ -200,7 +200,7 @@ jobs: - name: Run ctest (Linux) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-GCC,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-GCC,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true @@ -302,7 +302,7 @@ jobs: id: run-ctest run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true @@ -387,7 +387,7 @@ jobs: - name: Run ctest (Linux S3) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-S3,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-S3,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true @@ -493,7 +493,7 @@ jobs: CXX: ${{ steps.setup-fortran.outputs.cc }} run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: pwsh continue-on-error: true @@ -588,7 +588,7 @@ jobs: CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true @@ -682,7 +682,7 @@ jobs: - name: Run ctest (Linux_clang) run: | cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,CTEST_SITE_EXT=${{ github.event.repository.full_name }}-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log shell: bash continue-on-error: true diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e81276cafdd..8c16fbef02f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -125,12 +125,6 @@ jobs: with: build_mode: "Release" - call-release-cmake-cygwin: - name: "CMake Cygwin Workflows" - uses: ./.github/workflows/cygwin-cmake.yml - with: - build_mode: "Release" - call-release-cmake-xpr: name: "CMake TestExpress Workflows" uses: ./.github/workflows/testxpr-cmake.yml diff --git a/.github/workflows/cygwin-cmake.yml b/.github/workflows/cygwin-cmake.yml index 57674acbbe0..31f0fb83dd2 100644 --- a/.github/workflows/cygwin-cmake.yml +++ b/.github/workflows/cygwin-cmake.yml @@ -4,10 +4,20 @@ name: hdf5 dev CMake cygwin on: workflow_call: inputs: - build_mode: - description: "release vs. debug build" + snap_name: + description: 'The name in the source tarballs' + type: string + required: false + default: hdfsrc + file_base: + description: "The common base name of the source tarballs" required: true type: string + use_environ: + description: 'Environment to locate files' + type: string + required: true + default: snapshots permissions: contents: read @@ -30,36 +40,80 @@ jobs: with: packages: cmake gcc-fortran make ninja zlib-devel flex bison perl - - name: CMake Configure + - name: Set file base name (Cygwin) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + # Get files created by release script + - name: Get zip-tarball (Cygwin) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: zip-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Cygwin) run: | - export PATH=/usr/bin:$PATH - mkdir build - cd build - cmake -C ../config/cmake/cacheinit.cmake \ - -G Ninja \ - --log-level=VERBOSE \ - -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \ - -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ - -DLIBAEC_USE_LOCALCONTENT=OFF \ - -DZLIB_USE_LOCALCONTENT=OFF \ - -DHDF5_BUILD_FORTRAN:BOOL=ON \ - -DHDF5_BUILD_JAVA:BOOL=OFF \ - .. + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} - - name: CMake Build + - name: Uncompress source (Cygwin) + working-directory: ${{ github.workspace }} + run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Copy script files for the space (Cygwin) run: | - export PATH=/usr/bin:$PATH - cd build - cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Cygwin) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Cygwin) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_GENERATE_HEADERS=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") - - name: CMake Run Tests + - name: Run ctest (Cygwin) shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' run: | - export PATH=/usr/bin:$PATH - cd build - ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -# ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -R "FORTRAN|H5TEST" + export PATH=/usr/bin:$PATH + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-CYG,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Cygwin) + uses: actions/upload-artifact@v4 + with: + name: gcc-cygwin-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 65150c5f3ec..4ca2d983dbe 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -59,6 +59,15 @@ jobs: use_tag: snapshot use_environ: snapshots + call-release-cmake-cygwin: + needs: [get-old-names, call-workflow-tarball] + name: "CMake Cygwin Workflows" + uses: ./.github/workflows/cygwin-cmake.yml + with: + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} + use_environ: snapshots + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + call-workflow-c-script: needs: [get-old-names, call-workflow-tarball] uses: ./.github/workflows/cmake-script.yml diff --git a/.github/workflows/h5py.yml b/.github/workflows/h5py.yml index c6c6aa7505b..f8da6c4f7e2 100644 --- a/.github/workflows/h5py.yml +++ b/.github/workflows/h5py.yml @@ -21,7 +21,7 @@ jobs: - name: Run a multi-line script run: | - sed -i 's/hdf5@1.10.4:1.14/hdf5@1.10.4:/g' \ + sed -i 's/hdf5@1.10.6:1.14/hdf5@1.10.6:/g' \ ./spack/var/spack/repos/builtin/packages/py-h5py/package.py . ./spack/share/spack/setup-env.sh ./spack/bin/spack spec py-h5py@master+mpi ^hdf5@develop-1.17 diff --git a/CMakeLists.txt b/CMakeLists.txt index d356fc0d1d0..4336471e80a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1186,7 +1186,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) if (HDF5_BUILD_FORTRAN) message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") - include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake) + include (${HDF_RESOURCES_DIR}/HDFCompilerFortranFlags.cmake) include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) @@ -1246,7 +1246,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") endif () endif () - include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake) + include (${HDF_RESOURCES_DIR}/HDFCompilerCXXFlags.cmake) add_subdirectory (c++) if (HDF5_BUILD_HL_LIB) diff --git a/README.md b/README.md index ab51d912acc..f7b5c631422 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -HDF5 version 1.17.0 currently under development +HDF5 version 2.0.0 currently under development ![HDF5 Logo](doxygen/img/HDF5.png) @@ -10,8 +10,6 @@ HDF5 version 1.17.0 currently under development [![CVE regression](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/cve.yml?branch=develop&label=CVE)](https://github.com/HDFGroup/hdf5/actions/workflows/cve.yml?query=branch%3Adevelop) [![HDF5 VOL connectors build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/vol.yml?branch=develop&label=HDF5-VOL)](https://github.com/HDFGroup/hdf5/actions/workflows/vol.yml?query=branch%3Adevelop) [![HDF5 VFD build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/vfd.yml?branch=develop&label=HDF5-VFD)](https://github.com/HDFGroup/hdf5/actions/workflows/vfd.yml?query=branch%3Adevelop) -[![1.14 cmake build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/cmake.yml?branch=hdf5_1_14&label=HDF5%201.14%20CMake%20CI)](https://github.com/HDFGroup/hdf5/actions/workflows/cmake.yml?query=branch%3Ahdf5_1_14) -[![1.14 autotools build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/autotools.yml?branch=hdf5_1_14&label=HDF5%201.14%20Autotools%20CI)](https://github.com/HDFGroup/hdf5/actions/workflows/autotools.yml?query=branch%3Ahdf5_1_14) [![BSD](https://img.shields.io/badge/License-BSD-blue.svg)](https://github.com/HDFGroup/hdf5/blob/develop/LICENSE) [HPC configure/build/test results](https://my.cdash.org/index.php?project=HDF5) @@ -90,7 +88,7 @@ are tentative. | Release | New Features | | ------- | ------------ | -| 2.0.0 | Drop Autotools support, complex number support, updated library defaults (cache sizes, etc.), semantic versioning | +| 2.0.0 | Drop Autotools support, drop the C++ API, drop the HDF5 <--> GIF tools, add complex number support, update library defaults (cache sizes, etc.), use semantic versioning | | FUTURE | Multi-threaded HDF5, crashproofing / metadata journaling, Full (VFD) SWMR, encryption, digital signatures, sparse datasets, improved storage for variable-length datatypes, better Unicode support (especially on Windows) | NOTE: In the March 2025 release we will begin using semantic versioning (https://semver.org/) and the previously announced 1.16.0 version will instead be numbered 2.0.0. diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake deleted file mode 100644 index b6c14efd931..00000000000 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ /dev/null @@ -1,362 +0,0 @@ -# -# 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 LICENSE 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. -# -ENABLE_LANGUAGE (CXX) - -set (CMAKE_CXX_STANDARD 11) -set (CMAKE_CXX_STANDARD_REQUIRED TRUE) - -set (CMAKE_CXX_EXTENSIONS OFF) - -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") -message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") -#----------------------------------------------------------------------------- -# Compiler specific flags : Shouldn't there be compiler tests for these -#----------------------------------------------------------------------------- -if (WIN32 AND (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")) - set (_INTEL_WINDOWS 1) -endif () - -if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") - set (_CLANG_MSVC_WINDOWS 1) -endif() - -# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. -if ((_CLANG_MSVC_WINDOWS OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105") - endif () -endif () - -if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED) - if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) - if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") - endif () - else () - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") - endif () - endif () -endif () - -if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_LOADED) - if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) - if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C11_STANDARD_COMPILE_OPTION}") - endif () - endif () - if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=warn") - if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") - endif () - else () - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Mbounds -gopt -g") - endif () -endif () - -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") - if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") - endif () - else () - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") - endif () - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) - if (HDF5_ENABLE_BUILD_DIAGS) - message (STATUS "... default color and URL extended diagnostic messages enabled") - else () - message (STATUS "... disable color and URL extended diagnostic messages") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") - endif () - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to disable compiler warnings -#----------------------------------------------------------------------------- -if (HDF5_DISABLE_COMPILER_WARNINGS) - message (STATUS "....Compiler warnings are suppressed") - # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it. - if (MSVC) - set (HDF5_WARNINGS_BLOCKED 1) - if (CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") - endif () - endif () - if (WIN32) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif () - - # Most compilers use -w to suppress warnings. - if (NOT HDF5_WARNINGS_BLOCKED) - if (CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# HDF5 library compile options - to be made available to all targets -#----------------------------------------------------------------------------- - -if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP") -else () - # General flags - # - # Note that some of the flags listed here really should be developer - # flags (listed in a separate variable, below) but we put them here - # because they are not raised by the current code and we'd like to - # know if they do start showing up. - # - # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) - # warnings that are emitted. If you need it, add it at configure time. - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/general") - endif() - if (NOT _INTEL_WINDOWS) - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/15") - endif() - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/18") - endif() - endif() - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_LOADED - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - # add the general CXX flags for g++ compiler versions 4.8 and above. - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") - endif () - elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/general") - endif() - elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") - list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform") - endif () - message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable developer warnings -# Developer warnings (suggestions from gcc, not code problems) -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_DEV_WARNINGS) - message (STATUS "....HDF5 developer group warnings are enabled") - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-developer-general") - else () - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/developer-general") - endif() - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") - elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-developer-general") - else () - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/developer-general") - endif() - elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") - endif () -else () - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") - elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") - endif () -endif () - -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") - endif () - - # Append more extra warning flags that only gcc 4.8+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.8") - if (HDF5_ENABLE_DEV_WARNINGS) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-developer-4.8") - else () - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-cxx-developer-4.8") - endif () - endif () - - # Append more extra warning flags that only gcc 4.9+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9") - endif () - - # Append more extra warning flags that only gcc 5.1+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5") - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") - endif () - - # Append more extra warning flags that only gcc 6.x+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") - endif () - - # Append more extra warning flags that only gcc 7.x+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") - if (HDF5_ENABLE_DEV_WARNINGS) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") - #else () - # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") - endif () - endif () - - # Append more extra warning flags that only gcc 8.x+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") - if (HDF5_ENABLE_DEV_WARNINGS) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") - else () - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") - endif () - endif () - - # Append more extra warning flags that only gcc 9.x+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-9") - endif () - - # Append more extra warning flags that only gcc 9.3+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3) - # do not use C warnings, gnu-warnings 9.3, no cxx warnings - # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") - endif () - - # Append more extra warning flags that only gcc 10.x+ knows about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) - if (HDF5_ENABLE_DEV_WARNINGS) - # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") - #else () - # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable all warnings -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_ALL_WARNINGS) - message (STATUS "....All Warnings are enabled") - if (MSVC) - if (HDF5_ENABLE_DEV_WARNINGS) - if (CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668") - endif () - else () - if (CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127") - endif () - endif () - else () - if (CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS}) - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# This is in here to help some of the GCC based IDES like Eclipse -# and code blocks parse the compiler errors and warnings better. -#----------------------------------------------------------------------------- -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif () - -#----------------------------------------------------------------------------- -# Option for --enable-symbols -# This option will force/override the default setting for all configurations -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_SYMBOLS MATCHES "YES") - if (CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" AND NOT _INTEL_WINDOWS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - endif () - endif () -elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") - if (CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s") - elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM" AND NOT _INTEL_WINDOWS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# Option for --enable-profiling -# This option will force/override the default setting for all configurations -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_PROFILING) - if (CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") - endif () -endif () - -#----------------------------------------------------------------------------- -# Option for --enable-optimization -# This option will force/override the default setting for all configurations -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_OPTIMIZATION) - if (CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") - endif () -endif () diff --git a/config/cmake/HDFClangCXXFlags.cmake b/config/cmake/HDFClangCXXFlags.cmake new file mode 100644 index 00000000000..90b2f07a33f --- /dev/null +++ b/config/cmake/HDFClangCXXFlags.cmake @@ -0,0 +1,52 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +if (WIN32 AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + set (_CLANG_MSVC_WINDOWS 1) +endif() + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 CXX developer group warnings are enabled") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") +else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") +endif () diff --git a/config/cmake/HDFClangFlags.cmake b/config/cmake/HDFClangFlags.cmake new file mode 100644 index 00000000000..8b931d965fa --- /dev/null +++ b/config/cmake/HDFClangFlags.cmake @@ -0,0 +1,73 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +if (WIN32 AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + set (_CLANG_MSVC_WINDOWS 1) + if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000") + endif() +endif () + +# Disable deprecation warnings for standard C functions. +# really only needed for newer versions of VS, but should +# not hurt other versions, and this will work into the +# future +if (MSVC OR _CLANG_MSVC_WINDOWS) + add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") + + # Turn on -Winline warnings now only for non-Debug and + # non-Developer builds. For at least GNU compilers this + # flag appears to conflict specifically with the -Og + # optimization flag and will produce warnings about functions + # not being considered for inlining + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + list (APPEND H5_CFLAGS "-Winline") + endif () +else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") +endif () diff --git a/config/cmake/HDFCompilerCXXFlags.cmake b/config/cmake/HDFCompilerCXXFlags.cmake new file mode 100644 index 00000000000..1a8ffed0ee7 --- /dev/null +++ b/config/cmake/HDFCompilerCXXFlags.cmake @@ -0,0 +1,162 @@ +# +# 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. +# +ENABLE_LANGUAGE (CXX) + +set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD_REQUIRED TRUE) + +set (CMAKE_CXX_EXTENSIONS OFF) + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") +message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. +if ((_CLANG_MSVC_WINDOWS OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105") + endif () +endif () + +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED) + if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) + if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") + endif () + else () + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +if (CMAKE_CXX_COMPILER_LOADED) + if (HDF5_DISABLE_COMPILER_WARNINGS) + message (STATUS "....Compiler warnings are suppressed") + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + endif () + if (WIN32) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif () + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () + endif () + + if (CMAKE_CXX_COMPILER_ID MATCHES "NVHPC" ) + include (${HDF_RESOURCES_DIR}/HDFNvhpcCXXFlags.cmake) + endif () + + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + include (${HDF_RESOURCES_DIR}/HDFGnuCXXFlags.cmake) + endif () + + if (CMAKE_CXX_COMPILER_ID MATCHES "Intel") + include (${HDF_RESOURCES_DIR}/HDFIntelCXXFlags.cmake) + endif () + + if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + include (${HDF_RESOURCES_DIR}/HDFMsvcCXXFlags.cmake) + endif () + + #because this will match other compilers with clang in the name this should be checked last + if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + include (${HDF_RESOURCES_DIR}/HDFClangCXXFlags.cmake) + endif () + + #----------------------------------------------------------------------------- + # HDF5 library compile options - to be made available to all targets + #----------------------------------------------------------------------------- + + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP") + else () + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform") + endif () + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") + endif () + + #----------------------------------------------------------------------------- + # Option to allow the user to enable all warnings + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_ALL_WARNINGS) + message (STATUS "....All Warnings are enabled") + if (MSVC) + if (HDF5_ENABLE_DEV_WARNINGS) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668") + else () + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127") + endif () + else () + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS}) + endif () + endif () + + #----------------------------------------------------------------------------- + # Option for --enable-profiling + # This option will force/override the default setting for all configurations + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_PROFILING) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") + endif () + + #----------------------------------------------------------------------------- + # Option for --enable-optimization + # This option will force/override the default setting for all configurations + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_OPTIMIZATION) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") + endif () +endif () + +#----------------------------------------------------------------------------- +# The build mode flags are not added to CMAKE_CXX_FLAGS, so create a separate +# variable for them so they can be written out to libhdf5.settings and +# H5build_settings.c +#----------------------------------------------------------------------------- +if ("${HDF_CFG_NAME}" STREQUAL "Debug") + set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Developer") + set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEVELOPER}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Release") + set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}") +elseif ("${HDF_CFG_NAME}" STREQUAL "MinSizeRel") + set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_MINSIZEREL}") +elseif ("${HDF_CFG_NAME}" STREQUAL "RelWithDebInfo") + set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") +else () + set (HDF5_BUILD_MODE_CXX_FLAGS "") +endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 78aa3c37027..d00fd8209de 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -16,77 +16,17 @@ set (CMAKE_C_FLAGS "${CMAKE_C11_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}") message (VERBOSE "Warnings Configuration: C default: ${CMAKE_C_FLAGS}") #----------------------------------------------------------------------------- -# Compiler specific flags : Shouldn't there be compiler tests for these +# Compiler specific flags #----------------------------------------------------------------------------- -if (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")) - set (_INTEL_WINDOWS 1) -endif () - -if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") - set (_CLANG_MSVC_WINDOWS 1) -endif () - # Disable deprecation warnings for standard C functions. # really only needed for newer versions of VS, but should # not hurt other versions, and this will work into the # future -if (MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS) - add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) -endif () - if (MSVC) + add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000") endif () -# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. -if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105") -endif () - -if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000") -endif() - -if (CMAKE_C_COMPILER_ID STREQUAL "NVHPC" ) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=warn") - if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") - if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") - endif () - else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -gopt") - endif () -endif () - -if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") - if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") - endif () - else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND - NOT CMAKE_C_CLANG_TIDY) - # `clang-tidy` does not understand -fstdarg-opt - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") - endif () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) - #----------------------------------------------------------------------------- - # Option to allow the user to enable build extended diagnostics - # - # This should NOT be on by default as it can cause process issues. - #----------------------------------------------------------------------------- - option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) - mark_as_advanced (HDF5_ENABLE_BUILD_DIAGS) - if (HDF5_ENABLE_BUILD_DIAGS) - message (STATUS "... default color and URL extended diagnostic messages enabled") - else () - message (STATUS "... disable color and URL extended diagnostic messages") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") - endif () - endif () - endif () -endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -116,6 +56,27 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) endif () endif () +if (CMAKE_C_COMPILER_ID MATCHES "NVHPC" ) + include (${HDF_RESOURCES_DIR}/HDFNvhpcFlags.cmake) +endif () + +if (CMAKE_C_COMPILER_ID MATCHES "GNU") + include (${HDF_RESOURCES_DIR}/HDFGnuFlags.cmake) +endif () + +if (CMAKE_C_COMPILER_ID MATCHES "Intel") + include (${HDF_RESOURCES_DIR}/HDFIntelFlags.cmake) +endif () + +if (CMAKE_C_COMPILER_ID MATCHES "MSVC") + include (${HDF_RESOURCES_DIR}/HDFMsvcFlags.cmake) +endif () + +#because this will match other compilers with clang in the name this should be checked last +if (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + include (${HDF_RESOURCES_DIR}/HDFClangFlags.cmake) +endif () + #----------------------------------------------------------------------------- # HDF5 library compile options - to be made available to all targets #----------------------------------------------------------------------------- @@ -144,43 +105,7 @@ else () # # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. - if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/general") - endif() - if (NOT _INTEL_WINDOWS) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/15") - endif () - # this is just a failsafe - list (APPEND H5_CFLAGS "-finline-functions") - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/18") - endif () - endif () - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Add general CFlags for GCC versions 4.8 and above - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") - endif () - # gcc automatically inlines based on the optimization level - # this is just a failsafe - list (APPEND H5_CFLAGS "-finline-functions") - elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-general") - else () - # this is just a failsafe - list (APPEND H5_CFLAGS "-finline-functions") - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/general") - endif () - elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") - elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") + if (CMAKE_C_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") @@ -195,134 +120,6 @@ if (${HDF_CFG_NAME} MATCHES "Developer") # Developer build modes should always have these types of warnings enabled set (HDF5_ENABLE_DEV_WARNINGS ON CACHE BOOL "Enable HDF5 developer group warnings" FORCE) endif () -if (HDF5_ENABLE_DEV_WARNINGS) - message (STATUS "....HDF5 developer group warnings are enabled") - if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-developer-general") - else () - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/developer-general") - endif () - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") - elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-developer-general") - else () - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/developer-general") - endif () - elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") - endif () - - # Turn on -Winline warnings now only for non-Debug and - # non-Developer builds. For at least GNU compilers this - # flag appears to conflict specifically with the -Og - # optimization flag and will produce warnings about functions - # not being considered for inlining - if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - list (APPEND H5_CFLAGS "-Winline") - elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) - list (APPEND H5_CFLAGS "-Winline") - elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" AND NOT _INTEL_WINDOWS) - list (APPEND H5_CFLAGS "-Winline") - elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - list (APPEND H5_CFLAGS "-Winline") - endif () - endif () -else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") - elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") - endif () -endif () - -if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") - endif () - - # Append more extra warning flags that only gcc 4.8+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") - else () - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") - endif () - endif () - - # Append more extra warning flags that only gcc 4.9+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") - endif () - - # Append more extra warning flags that only gcc 5.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") - endif () - - # Append more extra warning flags that only gcc 6.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") - endif () - - # Append more extra warning flags that only gcc 7.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-7") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") - #else () - # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") - endif () - endif () - - # Append more extra warning flags that only gcc 8.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") - else () - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") - endif () - endif () - - # Append more extra warning flags that only gcc 9.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") - endif () - - # Append more extra warning flags that only gcc 9.3+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") - endif () - - # Append more extra warning flags that only gcc 10.x+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") - #else () - # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") - endif () - endif () - - # Append more extra warning flags that only gcc 12.x+ knows about - # or which should only be enabled for gcc 12.x+ - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-12") - #else () - # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-12") - endif () - endif () -endif () #----------------------------------------------------------------------------- # Option to allow the user to enable debug output @@ -363,14 +160,6 @@ if (HDF5_ENABLE_ALL_WARNINGS) endif () endif () -#----------------------------------------------------------------------------- -# This is in here to help some of the GCC based IDES like Eclipse -# and code blocks parse the compiler errors and warnings better. -#----------------------------------------------------------------------------- -if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -endif () - #----------------------------------------------------------------------------- # Option for --enable-asserts # By default, CMake adds NDEBUG to CMAKE_${lang}_FLAGS for Release build types @@ -393,19 +182,6 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS) #option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF) set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)") set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES) -if (HDF5_ENABLE_SYMBOLS MATCHES "YES") - if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer") - endif () -elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") - if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") - endif () -endif () MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS) #----------------------------------------------------------------------------- @@ -427,3 +203,23 @@ if (HDF5_ENABLE_OPTIMIZATION) list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}") endif () MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION) + +#----------------------------------------------------------------------------- +# The build mode flags are not added to CMAKE_C_FLAGS, so create a separate +# variable for them so they can be written out to libhdf5.settings and +# H5build_settings.c +#----------------------------------------------------------------------------- +if ("${HDF_CFG_NAME}" STREQUAL "Debug") + set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_DEBUG}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Developer") + set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_DEVELOPER}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Release") + set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}") +elseif ("${HDF_CFG_NAME}" STREQUAL "MinSizeRel") + set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_MINSIZEREL}") +elseif ("${HDF_CFG_NAME}" STREQUAL "RelWithDebInfo") + set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") +else () + set (HDF5_BUILD_MODE_C_FLAGS "") +endif () + diff --git a/config/cmake/HDFCompilerFortranFlags.cmake b/config/cmake/HDFCompilerFortranFlags.cmake new file mode 100644 index 00000000000..17d7af3ede5 --- /dev/null +++ b/config/cmake/HDFCompilerFortranFlags.cmake @@ -0,0 +1,86 @@ +# +# 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. +# + +message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +if (HDF5_DISABLE_COMPILER_WARNINGS) + message (STATUS "....Compiler warnings are suppressed") + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + endif () + if (WIN32) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif () + # Borland uses -w- to suppress warnings. + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w-") + endif () + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w") + endif () +endif () + +if (CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC" ) + include (${HDF_RESOURCES_DIR}/HDFNvhpcFortranFlags.cmake) +endif () + +if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU") + include (${HDF_RESOURCES_DIR}/HDFGnuFortranFlags.cmake) +endif () + +if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") + include (${HDF_RESOURCES_DIR}/HDFIntelFortranFlags.cmake) +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") + message (STATUS "... Select IEEE floating-point mode full") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ieee=full") +endif () + +if (NOT MSVC AND NOT MINGW) + # General flags + if (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") + endif () + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# The build mode flags are not added to CMAKE_Fortran_FLAGS, so create a separate +# variable for them so they can be written out to libhdf5.settings and +# H5build_settings.c +#----------------------------------------------------------------------------- +if ("${HDF_CFG_NAME}" STREQUAL "Debug") + set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_DEBUG}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Developer") + set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_DEVELOPER}") +elseif ("${HDF_CFG_NAME}" STREQUAL "Release") + set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELEASE}") +elseif ("${HDF_CFG_NAME}" STREQUAL "MinSizeRel") + set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_MINSIZEREL}") +elseif ("${HDF_CFG_NAME}" STREQUAL "RelWithDebInfo") + set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}") +else () + set (HDF5_BUILD_MODE_Fortran_FLAGS "") +endif () + diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake deleted file mode 100644 index f238c7e82cc..00000000000 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ /dev/null @@ -1,158 +0,0 @@ -# -# 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 LICENSE 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. -# - -message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") - -#----------------------------------------------------------------------------- -# Option to allow the user to disable compiler warnings -#----------------------------------------------------------------------------- -if (HDF5_DISABLE_COMPILER_WARNINGS) - message (STATUS "....Compiler warnings are suppressed") - # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it. - if (MSVC) - set (HDF5_WARNINGS_BLOCKED 1) - if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none") - elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none") - endif () - endif () - if (WIN32) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif () - # Borland uses -w- to suppress warnings. - if (BORLAND) - set (HDF5_WARNINGS_BLOCKED 1) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w-") - endif () - - # Most compilers use -w to suppress warnings. - if (NOT HDF5_WARNINGS_BLOCKED) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w") - endif () -endif () - -#----------------------------------------------------------------------------- -# HDF5 library compile options - to be made available to all targets -#----------------------------------------------------------------------------- -if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) - if (HDF5_ENABLE_BUILD_DIAGS) - message (STATUS "... default color and URL extended diagnostic messages enabled") - else () - message (STATUS "... disable color and URL extended diagnostic messages") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") - endif () -endif () - -if (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") - message (STATUS "... Select IEEE floating-point mode full") - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ieee=full") -endif () -if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") - if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnoframe") - if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -s") - endif () - else () - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mbounds -Mchkptr -Mdclchk -g") - endif () -endif () - -if (NOT MSVC AND NOT MINGW) - # General flags - if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-ifort-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/ifort-general") - endif() - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-free") - elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-general") - endif () - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none") - if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0 AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008ts") - else () - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008") - endif () - elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") - if (_INTEL_WINDOWS) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-ifort-general") - else () - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/ifort-general") - endif() - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-free") - elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") - list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") - endif () - message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") - - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - # Append more extra warning flags that only gcc 4.8+ knows about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-4.8") - else () - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-4.8") - endif () - endif () - - # Append more extra warning flags that only gcc 4.9+ knows about - #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") - #endif () - - # Append more extra warning flags that only gcc 5.x+ knows about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-5") - endif () - endif () - - # Append more extra warning flags that only gcc 6.x+ knows about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6") - endif () - - # Append more extra warning flags that only gcc 7.x+ knows about - #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7") - #endif () - - # Append more extra warning flags that only gcc 8.x+ knows about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8") - endif () - - # Append more extra warning flags that only gcc 9.x+ knows about - #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9") - #endif () - endif () -else () - if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-ifort-general") - list (APPEND HDF5_CMAKE_Fortran_FLAGS "/stand:f03" "/free") - elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-ifort-general") - list (APPEND HDF5_CMAKE_Fortran_FLAGS "/stand:f03" "/free") - endif () -endif () - diff --git a/config/cmake/HDFGnuCXXFlags.cmake b/config/cmake/HDFGnuCXXFlags.cmake new file mode 100644 index 00000000000..99aec322229 --- /dev/null +++ b/config/cmake/HDFGnuCXXFlags.cmake @@ -0,0 +1,192 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +############################################################################### +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- + + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") + if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") + endif () + else () + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") + endif () + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () + endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # add the general CXX flags for g++ compiler versions 4.8 and above. + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") + endif () + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 CXX developer group warnings are enabled") + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") +else () + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") +endif () + + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... Only needed for gcc 4.X + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") + endif () + + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-developer-4.8") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-cxx-developer-4.8") + endif () + endif () + + # Append more extra warning flags that only gcc 4.9+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9") + endif () + + # Append more extra warning flags that only gcc 5.1+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") + endif () + + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") + endif () + + # Append more extra warning flags that only gcc 7.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () + endif () + + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () + endif () + + # Append more extra warning flags that only gcc 9.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-9") + endif () + + # Append more extra warning flags that only gcc 9.3+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3) + # do not use C warnings, gnu-warnings 9.3, no cxx warnings + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") + endif () + + # Append more extra warning flags that only gcc 10.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") + endif () + endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable all warnings +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_ALL_WARNINGS) + message (STATUS "....All CXX Warnings are enabled") + if (MSVC) + if (HDF5_ENABLE_DEV_WARNINGS) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668") + else () + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127") + endif () + else () + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS}) + endif () +endif () + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") + +#----------------------------------------------------------------------------- +# Option for --enable-symbols +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_SYMBOLS MATCHES "YES") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") +elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") +endif () diff --git a/config/cmake/HDFGnuFlags.cmake b/config/cmake/HDFGnuFlags.cmake new file mode 100644 index 00000000000..5367c5237d8 --- /dev/null +++ b/config/cmake/HDFGnuFlags.cmake @@ -0,0 +1,195 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_C_COMPILER_ID STREQUAL "GNU") +############################################################################### +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- + + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") + if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") + endif () + else () + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND + NOT CMAKE_C_CLANG_TIDY) + # `clang-tidy` does not understand -fstdarg-opt + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") + endif () + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + #----------------------------------------------------------------------------- + # Option to allow the user to enable build extended diagnostics + # + # This should NOT be on by default as it can cause process issues. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + mark_as_advanced (HDF5_ENABLE_BUILD_DIAGS) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () + endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + # Add general CFlags for GCC versions 4.8 and above + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + endif () + # gcc automatically inlines based on the optimization level + # this is just a failsafe + list (APPEND H5_CFLAGS "-finline-functions") + message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + endif () + + # Turn on -Winline warnings now only for non-Debug and + # non-Developer builds. For at least GNU compilers this + # flag appears to conflict specifically with the -Og + # optimization flag and will produce warnings about functions + # not being considered for inlining + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + list (APPEND H5_CFLAGS "-Winline") + endif () +else () + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + endif () +endif () + + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... Only needed for gcc 4.X + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") + endif () + + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") + endif () + endif () + + # Append more extra warning flags that only gcc 4.9+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") + endif () + + # Append more extra warning flags that only gcc 5.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + endif () + + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") + endif () + + # Append more extra warning flags that only gcc 7.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-7") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () + endif () + + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () + endif () + + # Append more extra warning flags that only gcc 9.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") + endif () + + # Append more extra warning flags that only gcc 9.3+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") + endif () + + # Append more extra warning flags that only gcc 10.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") + #else () + # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") + endif () + endif () + + # Append more extra warning flags that only gcc 12.x+ knows about + # or which should only be enabled for gcc 12.x+ + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-12") + #else () + # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-12") + endif () + endif () + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") + +#----------------------------------------------------------------------------- +# Option for --enable-symbols +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_SYMBOLS MATCHES "YES") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer") +elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") +endif () diff --git a/config/cmake/HDFGnuFortranFlags.cmake b/config/cmake/HDFGnuFortranFlags.cmake new file mode 100644 index 00000000000..a114ceb0e08 --- /dev/null +++ b/config/cmake/HDFGnuFortranFlags.cmake @@ -0,0 +1,90 @@ +# +# 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 included from HDFCompilerFortranFlags.cmake with +# if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU" ) +############################################################################### + +message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () +endif () + +if (NOT MSVC AND NOT MINGW) + # General flags + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-general") + endif () + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none") + if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0 AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008ts") + else () + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008") + endif () + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-4.8") + else () + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-4.8") + endif () + endif () + + # Append more extra warning flags that only gcc 4.9+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") + #endif () + + # Append more extra warning flags that only gcc 5.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-5") + endif () + endif () + + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6") + endif () + + # Append more extra warning flags that only gcc 7.x+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7") + #endif () + + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8") + endif () + + # Append more extra warning flags that only gcc 9.x+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9") + #endif () +endif () + diff --git a/config/cmake/HDFIntelCXXFlags.cmake b/config/cmake/HDFIntelCXXFlags.cmake new file mode 100644 index 00000000000..02220b51d46 --- /dev/null +++ b/config/cmake/HDFIntelCXXFlags.cmake @@ -0,0 +1,93 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_CXX_COMPILER_ID MATCHES "Intel") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +if (WIN32) + set (_INTEL_WINDOWS 1) +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/general") + endif() + if (NOT _INTEL_WINDOWS) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/15") + endif () + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/18") + endif () + endif () + elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/general") + endif () + endif () + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 CXX developer group warnings are enabled") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-developer-general") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/developer-general") + endif () + elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-developer-general") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/developer-general") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-symbols +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (NOT _INTEL_WINDOWS) + if (HDF5_ENABLE_SYMBOLS MATCHES "YES") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s") + endif () +endif () diff --git a/config/cmake/HDFIntelFlags.cmake b/config/cmake/HDFIntelFlags.cmake new file mode 100644 index 00000000000..dbdbb616c15 --- /dev/null +++ b/config/cmake/HDFIntelFlags.cmake @@ -0,0 +1,106 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_C_COMPILER_ID MATCHES "Intel") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +if (WIN32) + set (_INTEL_WINDOWS 1) +endif () + +# Disable deprecation warnings for standard C functions. +# really only needed for newer versions of VS, but should +# not hurt other versions, and this will work into the +# future +if (MSVC OR _INTEL_WINDOWS) + add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_C_COMPILER_ID STREQUAL "Intel") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/general") + endif() + if (NOT _INTEL_WINDOWS) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/15") + endif () + # this is just a failsafe + list (APPEND H5_CFLAGS "-finline-functions") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/18") + endif () + endif () + elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-general") + else () + # this is just a failsafe + list (APPEND H5_CFLAGS "-finline-functions") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/general") + endif () + endif () + message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable developer warnings +# Developer warnings (suggestions from gcc, not code problems) +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + if (CMAKE_C_COMPILER_ID STREQUAL "Intel") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-developer-general") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/developer-general") + endif () + elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-developer-general") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/developer-general") + endif () + endif () +endif () + +# Turn on -Winline warnings now only for non-Debug and +# non-Developer builds. For at least GNU compilers this +# flag appears to conflict specifically with the -Og +# optimization flag and will produce warnings about functions +# not being considered for inlining +if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS) + list (APPEND H5_CFLAGS "-Winline") + elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" AND NOT _INTEL_WINDOWS) + list (APPEND H5_CFLAGS "-Winline") + endif () +endif () diff --git a/config/cmake/HDFIntelFortranFlags.cmake b/config/cmake/HDFIntelFortranFlags.cmake new file mode 100644 index 00000000000..8f55badf699 --- /dev/null +++ b/config/cmake/HDFIntelFortranFlags.cmake @@ -0,0 +1,65 @@ +# +# 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 included from HDFCompilerFortranFlags.cmake with +# if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" ) +############################################################################### + +message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +if (HDF5_DISABLE_COMPILER_WARNINGS) + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + if (MSVC) + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none") + elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (NOT MSVC AND NOT MINGW) + # General flags + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-ifort-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/ifort-general") + endif() + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-free") + elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") + if (_INTEL_WINDOWS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-ifort-general") + else () + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/ifort-general") + endif() + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-free") + endif () + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") +else () + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/win-ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "/stand:f03" "/free") + elseif (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/oneapi/win-ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "/stand:f03" "/free") + endif () +endif () + diff --git a/config/cmake/HDFMsvcCXXFlags.cmake b/config/cmake/HDFMsvcCXXFlags.cmake new file mode 100644 index 00000000000..4970622cc3d --- /dev/null +++ b/config/cmake/HDFMsvcCXXFlags.cmake @@ -0,0 +1,26 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- + +# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105") + endif () diff --git a/config/cmake/HDFMsvcFlags.cmake b/config/cmake/HDFMsvcFlags.cmake new file mode 100644 index 00000000000..a0ca9290f93 --- /dev/null +++ b/config/cmake/HDFMsvcFlags.cmake @@ -0,0 +1,25 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_C_COMPILER_ID MATCHES "MSVC") +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- + +# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105") +endif () diff --git a/config/cmake/HDFNvhpcCXXFlags.cmake b/config/cmake/HDFNvhpcCXXFlags.cmake new file mode 100644 index 00000000000..eab491bf01e --- /dev/null +++ b/config/cmake/HDFNvhpcCXXFlags.cmake @@ -0,0 +1,33 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_CXX_COMPILER_ID MATCHES "NVHPC" ) +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) + if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C11_STANDARD_COMPILE_OPTION}") + endif () +endif () +if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=warn") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + endif () +else () + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Mbounds -gopt -g") +endif () diff --git a/config/cmake/HDFNvhpcFlags.cmake b/config/cmake/HDFNvhpcFlags.cmake new file mode 100644 index 00000000000..77443942064 --- /dev/null +++ b/config/cmake/HDFNvhpcFlags.cmake @@ -0,0 +1,28 @@ +# +# 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 included from HDFCompilerFlags.cmake with +# if (CMAKE_C_COMPILER_ID MATCHES "NVHPC" ) +############################################################################### + +#----------------------------------------------------------------------------- +# Compiler specific flags +#----------------------------------------------------------------------------- +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=warn") +if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") + endif () +else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -gopt") +endif () diff --git a/config/cmake/HDFNvhpcFortranFlags.cmake b/config/cmake/HDFNvhpcFortranFlags.cmake new file mode 100644 index 00000000000..a6ae6930262 --- /dev/null +++ b/config/cmake/HDFNvhpcFortranFlags.cmake @@ -0,0 +1,38 @@ +# +# 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 included from HDFCompilerFortranFlags.cmake with +# if (CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC" ) +############################################################################### + +message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") + +#----------------------------------------------------------------------------- +# HDF5 library compile options - to be made available to all targets +#----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnoframe") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -s") + endif () + else () + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mbounds -Mchkptr -Mdclchk -g") + endif () +endif () + +if (NOT MSVC AND NOT MINGW) + # General flags + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") +endif () + diff --git a/configure.ac b/configure.ac index 82d0ef1f462..76f30618d2c 100644 --- a/configure.ac +++ b/configure.ac @@ -4106,8 +4106,9 @@ fi ## and installed with the libraries (used to generate libhdf5.settings). ## -## HDF5 version from the first line of the README.md file. -H5_VERSION="`cut -d' ' -f3 $srcdir/README.md | head -1`" +## HDF5 version from H5public.h (3rd field of #define H5_VERS_STR "1.17.0" +## w/ sed to remove quotes). +H5_VERSION=`grep 'H5_VERS_STR' $srcdir/src/H5public.h | sed s/\"//g | cut -d' ' -f3` AC_SUBST([H5_VERSION]) ## Configuration date diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index b601fcbf528..a9302c35fe3 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -875,7 +875,7 @@ HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF HDF5_ENABLE_MAP_API "Build the map API" OFF -HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON +HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF HDF5_BUILD_GENERATORS "Build Test Generators" OFF HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 5cc43eeb05e..a50a7919395 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -62,6 +62,24 @@ New Features The following API routines support concurrent multithreaded operation: + - Added CMake build mode flags to the libhdf5.settings file + + Flags from the CMake build mode (e.g., optimization) are not a part of + CMAKE__FLAGS and were not exported to the libhdf5.settings file. This + has been fixed and the C, Fortran, and C++ build mode flags are now exported to + the file. + + This also affects the text output of H5check_version() and the libhdf5.settings + string stored in the library (for those who use strings(1), etc. to get + build info from the binary). + + - CMake: Split compiler specific flags into separate files + + The compiler specific flags have been split into separate files to make + it easier to maintain and add new compiler flags. The flags for NVHPC, + Intel, GNU and Clang compilers are now in separate files included from + the current compiler flags files; HDFCompilerFlags.cmake. + - Added support for native zlib-ng compression. Changed the zlib-ng CMake logic to prefer the native zlib-ng library. Added diff --git a/release_docs/RELEASE_PROCESS.md b/release_docs/RELEASE_PROCESS.md index 60ace68d21f..8f54d9b9be2 100644 --- a/release_docs/RELEASE_PROCESS.md +++ b/release_docs/RELEASE_PROCESS.md @@ -94,7 +94,9 @@ For more information on the HDF5 versioning and backward and forward compatibili - `$ bin/h5vers -s X.Y.Z-{SR+1};` - `$ git commit -m "Updated release preparation branch version number to X.Y.Z-{SR+1}"` - `$ git push` -7. Update default configuration mode +7. ** OBSOLETE CURRENTLY ** + Most will disappear when autotools support is removed, and none of these are currently necessary + Update default configuration mode - `$ git checkout hdf5_X_Y_Z;` and `$ bin/switch_maint_mode -disable ./configure.ac` to disable `AM_MAINTAINER_MODE`. - Need to set option `HDF5_GENERATE_HEADERS` to `OFF`, currently in line 996 of [src/CMakeLists.txt][u11]. - Change the **release preparation branch**'s (i.e. hdf5_X_Y_Z) default configuration mode from development to production in [configure.ac][u12]. @@ -103,6 +105,7 @@ For more information on the HDF5 versioning and backward and forward compatibili - Under `if test "X-$BUILD_MODE" = X- ; then` change `BUILD_MODE=debug` to `BUILD_MODE=production`. - Run `sh ./autogen.sh` to regenerate the UNIX build system files and commit the changes. (use `git status --ignored` to see the changes and `git add -f` to add all files. First delete any new files not to be committed, notably `src/H5public.h~` and `autom4te.cache/`.) - `$ git push with commit message listing change steps for creating release branch` + ** END OBSOLETE CURRENTLY ** 8. E-mail hdf5lib@hdfgroup.org to indicate that the code freeze on the release support branch (i.e. hdf5_X_Y) has been lifted and development on the next maintenance release can resume. The code freeze will remain in place on the release preparation branch (i.e. hdf5_X_Y_Z) indefinitely. ### 7. Perform Release Testing (Test Automation Team | Release Manager | Project Leads) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d2cafa37df2..644539bfc00 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1026,7 +1026,7 @@ set (H5_PUBLIC_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) -option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) if (H5_PERL_FOUND) diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index dccb73f80bc..9ab9b6a94f3 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -22,6 +22,7 @@ /* Public header files */ #include "H5FDpublic.h" /* File drivers */ +#include "H5FDsec2.h" /* sec2 driver */ /** ID for the windows VFD */ #define H5FD_WINDOWS (H5OPEN H5FD_SEC2_id_g) @@ -30,12 +31,6 @@ extern "C" { #endif /* __cplusplus */ -/** @private - * - * \brief ID for the windows (sec2) VFD - */ -H5_DLLVAR hid_t H5FD_SEC2_id_g; - /** * \ingroup FAPL * diff --git a/src/H5build_settings.cmake.c.in b/src/H5build_settings.cmake.c.in index 2698f295327..19c902ace64 100644 --- a/src/H5build_settings.cmake.c.in +++ b/src/H5build_settings.cmake.c.in @@ -56,7 +56,7 @@ const char H5build_settings[]= " CPPFLAGS: @CPPFLAGS@\n" " H5_CPPFLAGS: @H5_CPPFLAGS@\n" " AM_CPPFLAGS: @AM_CPPFLAGS@\n" - " C Flags: @CMAKE_C_FLAGS@\n" + " C Flags: @CMAKE_C_FLAGS@ @HDF5_BUILD_MODE_C_FLAGS@\n" " H5 C Flags: @HDF5_CMAKE_C_FLAGS@\n" " AM C Flags: @AM_CFLAGS@\n" " Shared C Library: @H5_ENABLE_SHARED_LIB@\n" @@ -65,7 +65,7 @@ const char H5build_settings[]= "\n" " Fortran: @HDF5_BUILD_FORTRAN@\n" " Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@\n" - " Fortran Flags: @CMAKE_Fortran_FLAGS@\n" + " Fortran Flags: @CMAKE_Fortran_FLAGS@ @HDF5_BUILD_MODE_Fortran_FLAGS@\n" " H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@\n" " AM Fortran Flags: @AM_FCFLAGS@\n" " Shared Fortran Library: @H5_ENABLE_SHARED_LIB@\n" @@ -74,7 +74,7 @@ const char H5build_settings[]= "\n" " C++: @HDF5_BUILD_CPP_LIB@\n" " C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@\n" - " C++ Flags: @CMAKE_CXX_FLAGS@\n" + " C++ Flags: @CMAKE_CXX_FLAGS@ @HDF5_BUILD_MODE_CXX_FLAGS@\n" " H5 C++ Flags: @HDF5_CMAKE_CXX_FLAGS@\n" " AM C++ Flags: @AM_CXXFLAGS@\n" " Shared C++ Library: @H5_ENABLE_SHARED_LIB@\n" diff --git a/src/libhdf5.settings.cmake.in b/src/libhdf5.settings.cmake.in index d2541c86263..c6368ec1e13 100644 --- a/src/libhdf5.settings.cmake.in +++ b/src/libhdf5.settings.cmake.in @@ -38,7 +38,7 @@ Languages: CPPFLAGS: @CPPFLAGS@ H5_CPPFLAGS: @H5_CPPFLAGS@ AM_CPPFLAGS: @AM_CPPFLAGS@ - CFLAGS: @CMAKE_C_FLAGS@ + CFLAGS: @CMAKE_C_FLAGS@ @HDF5_BUILD_MODE_C_FLAGS@ H5_CFLAGS: @HDF5_CMAKE_C_FLAGS@ AM_CFLAGS: @AM_CFLAGS@ Shared C Library: @H5_ENABLE_SHARED_LIB@ @@ -46,7 +46,7 @@ Languages: Fortran: @HDF5_BUILD_FORTRAN@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@ - Fortran Flags: @CMAKE_Fortran_FLAGS@ + Fortran Flags: @CMAKE_Fortran_FLAGS@ @HDF5_BUILD_MODE_Fortran_FLAGS@ H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@ AM Fortran Flags: @AM_FCFLAGS@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@ @@ -55,7 +55,7 @@ Languages: C++: @HDF5_BUILD_CPP_LIB@ C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@ - C++ Flags: @CMAKE_CXX_FLAGS@ + C++ Flags: @CMAKE_CXX_FLAGS@ @HDF5_BUILD_MODE_CXX_FLAGS@ H5 C++ Flags: @HDF5_CMAKE_CXX_FLAGS@ AM C++ Flags: @AM_CXXFLAGS@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@ diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 41fd15389a9..d06eceb3e81 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -399,10 +399,9 @@ # -------------------------------------------------------------------- HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/expected/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files") - if (WIN32 AND CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.18362.0) + # Certain versions of Visual Studio produce rounding differences compared with the reference data of the tfloatsattr test + if (WIN32 AND (CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.18362.0 OR CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_GREATER_EQUAL 19.41.34123.0)) configure_file(${PROJECT_SOURCE_DIR}/exportfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF) - #file (READ ${PROJECT_SOURCE_DIR}/exportfiles/tbinregR.exp TEST_STREAM) - #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/expected/tfloatsattrs.wddl" "${PROJECT_BINARY_DIR}/testfiles/std/tfloatsattrs.ddl" "h5dump_std_files") else () HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/exportfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files") diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index e2c6aee1baa..47d72306808 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1928,7 +1928,7 @@ ADD_H5_DMP_NO_OPT_TEST (tst_onion_objs "TEST" 0 tst_onion_objs.h5 --src-vfd-name ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) + ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,0) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters diff --git a/tools/test/h5repack/dynlib_vrpk.c b/tools/test/h5repack/dynlib_vrpk.c index 91934222ea1..bd276b7d772 100644 --- a/tools/test/h5repack/dynlib_vrpk.c +++ b/tools/test/h5repack/dynlib_vrpk.c @@ -9,31 +9,34 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* - * Purpose: Tests the plugin module (H5PL) + * Purpose: Test group filter plugin for the filter_pluging.c test. */ #include #include -#include "H5PLextern.h" +#include -#define H5Z_FILTER_DYNLIB4 260 +#include "H5PLextern.h" -#define PUSH_ERR(func, minor, str) \ - H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str) +#define FILTER4_ID 260 +#define SUFFIX_LEN 8 +#define GROUP_SUFFIX ".h5group" -static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, - size_t nbytes, size_t *buf_size, void **buf); +static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, + size_t nbytes, size_t *buf_size, void **buf); -/* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB4[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB4, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib4", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - H5Z_filter_dynlib4, /* The actual filter function */ +/* Filter class struct */ +const H5Z_class2_t FILTER_INFO[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER4_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 4", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + append_to_group_name, /* The actual filter function */ }}; H5PL_type_t @@ -44,66 +47,66 @@ H5PLget_plugin_type(void) const void * H5PLget_plugin_info(void) { - return H5Z_DYNLIB4; + return FILTER_INFO; } /*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib4 + * Function: append_to_group_name * - * Purpose: A dynlib4 filter method that adds on and subtract from - * the original value with another value. It will be built - * as a shared library. plugin.c test will load and use - * this filter library. Designed to call a HDF function. + * Purpose: On write: + * Appends the suffix ".h5group" to the group name + * On read: + * Removes the ".h5group" suffix from the group name * - * Return: Success: Data chunk size - * - * Failure: 0 + * Return: Success: Data size in bytes + * Failure: 0 * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) +append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) { - int *int_ptr = (int *)*buf; /* Pointer to the data values */ - size_t buf_left = *buf_size; /* Amount of data buffer left to process */ - int add_on = 0; - unsigned ver_info[3]; - - /* Check for the library version */ - if (H5get_libversion(&ver_info[0], &ver_info[1], &ver_info[2]) < 0) { - PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion"); - return (0); - } + size_t new_name_size = 0; /* Return value */ + /* Check for the correct number of parameters */ - if (cd_nelmts == 0) - return (0); + if (cd_nelmts > 0) + return 0; + + /* Assignment to eliminate unused parameter warning. */ + (void)cd_values; + + if (flags & H5Z_FLAG_REVERSE) { + /* READ - Remove the suffix from the group name */ + new_name_size = *buf_size = nbytes - SUFFIX_LEN; + } + else { + /* WRITE - Append the suffix to the group name */ + void *outbuf = NULL; /* Pointer to new buffer */ + unsigned char *dst = NULL; /* Temporary pointer to destination buffer */ + + /* Get memory for the new, larger string buffer using the + * library's memory allocator. + */ + if (NULL == (dst = (unsigned char *)(outbuf = H5allocate_memory(nbytes + SUFFIX_LEN, 0)))) + return 0; + + /* Copy raw data */ + memcpy((void *)dst, (const void *)(*buf), nbytes); + + /* Append suffix to raw data for storage */ + dst += nbytes; + memcpy((void *)dst, (const void *)GROUP_SUFFIX, SUFFIX_LEN); - /* Check that permanent parameters are set correctly */ - if (cd_values[0] > 9) - return (0); + /* Free the passed-in buffer using the library's allocator */ + H5free_memory(*buf); - if (ver_info[0] != cd_values[1] || ver_info[1] != cd_values[2]) { - PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion does not match"); - return (0); + /* Set return values */ + *buf_size = nbytes + SUFFIX_LEN; + *buf = outbuf; + outbuf = NULL; + new_name_size = *buf_size; } - add_on = (int)cd_values[0]; - - if (flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Subtract the "add on" value to all the data values */ - while (buf_left > 0) { - *int_ptr++ -= add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Add the "add on" value to all the data values */ - while (buf_left > 0) { - *int_ptr++ += add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end else */ - - return nbytes; -} /* end H5Z_filter_dynlib4() */ + return new_name_size; +} /* append_to_group_name() */ diff --git a/tools/test/h5repack/expected/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/expected/h5repack_layout.h5-plugin_version_test.ddl index fe10a5588df..1ec465b1177 100644 --- a/tools/test/h5repack/expected/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/expected/h5repack_layout.h5-plugin_version_test.ddl @@ -5,13 +5,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -27,13 +26,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -49,13 +47,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -71,13 +68,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -93,13 +89,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 20, 10 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3232 (0.990:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -115,13 +110,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { @@ -137,13 +131,12 @@ GROUP "/" { DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { CHUNKED ( 40, 20 ) - SIZE 3200 (1.000:1 COMPRESSION) + SIZE 3208 (0.998:1 COMPRESSION) } FILTERS { USER_DEFINED_FILTER { FILTER_ID 260 - COMMENT dynlib4 - PARAMS { 9 1 17 0 } + COMMENT test filter plugin 4 } } FILLVALUE { diff --git a/tools/test/h5repack/expected/plugin_version_test.h5repack_layout.h5.tst b/tools/test/h5repack/expected/plugin_version_test.h5repack_layout.h5.tst index f5c47365a3f..4dda73dfe3a 100644 --- a/tools/test/h5repack/expected/plugin_version_test.h5repack_layout.h5.tst +++ b/tools/test/h5repack/expected/plugin_version_test.h5repack_layout.h5.tst @@ -6,10 +6,10 @@ Making new file ... Type Filter (Compression) Name ----------------------------------------- group / - dset UD (1.000:1) /dset1 - dset UD (1.000:1) /dset2 - dset UD (1.000:1) /dset3 - dset UD (1.000:1) /dset4 - dset UD (1.000:1) /dset_chunk - dset UD (1.000:1) /dset_compact - dset UD (1.000:1) /dset_contiguous + dset UD (0.998:1) /dset1 + dset UD (0.998:1) /dset2 + dset UD (0.998:1) /dset3 + dset UD (0.998:1) /dset4 + dset UD (0.990:1) /dset_chunk + dset UD (0.998:1) /dset_compact + dset UD (0.998:1) /dset_contiguous diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index e073796c538..98b888517f5 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -245,10 +245,9 @@ TOOLTEST_DUMP() ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR -version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,0,4,9,$version_str" +arg="h5repack_layout.h5 -v -f UD=260,0,0" TOOLTEST_DUMP plugin_version_test $arg arg="h5repack_layout.h5 -v -f UD=257,0,1,9"