summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-09-24 20:02:33 (GMT)
committerGitHub <noreply@github.com>2021-09-24 20:02:33 (GMT)
commit108c7397372751efe5f953c854673cbcfc7356ca (patch)
treeb826ec01ec8dba1e2889021675d11631d8c84b4d
parent9e93204a23346a5b7cf5b8673cf50e6ac2497021 (diff)
downloadhdf5-108c7397372751efe5f953c854673cbcfc7356ca.zip
hdf5-108c7397372751efe5f953c854673cbcfc7356ca.tar.gz
hdf5-108c7397372751efe5f953c854673cbcfc7356ca.tar.bz2
1.8 Merge config changes from dev (#1032)
* Merge config changes from dev * Revert added git file changes * Merge MS clang needs EHsc flag #1035
-rw-r--r--MANIFEST10
-rw-r--r--config/clang-warnings/noerror-general6
-rw-r--r--config/cmake/ConfigureChecks.cmake4
-rw-r--r--config/cmake/H5pubconf.h.in4
-rw-r--r--config/cmake/HDF5_Examples_options.cmake6
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake314
-rw-r--r--config/cmake/HDFCompilerFlags.cmake313
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake7
-rw-r--r--config/cmake/hdf5-config-version.cmake.in2
-rw-r--r--config/cmake/libh5cc.in2
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake6
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake16
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake4
-rw-r--r--config/commence.am2
-rw-r--r--config/gnu-cxxflags20
-rw-r--r--config/gnu-fflags8
-rw-r--r--config/gnu-flags6
-rw-r--r--config/gnu-warnings/cxx-4.91
-rw-r--r--config/gnu-warnings/cxx-94
-rw-r--r--config/gnu-warnings/developer-104
-rw-r--r--config/gnu-warnings/noerror-general6
-rw-r--r--config/intel-cxxflags184
-rw-r--r--config/intel-fflags62
-rw-r--r--config/intel-flags78
-rw-r--r--config/intel-warnings/1519
-rw-r--r--config/intel-warnings/182
-rw-r--r--config/intel-warnings/developer-general4
-rw-r--r--config/intel-warnings/general1
-rw-r--r--config/intel-warnings/win-developer-general1
-rw-r--r--config/intel-warnings/win-general1
-rw-r--r--config/linux-gnulibc114
-rw-r--r--config/pgi-cxxflags100
-rw-r--r--config/pgi-fflags64
-rw-r--r--config/pgi-flags87
-rw-r--r--config/sanitizer/code-coverage.cmake18
-rw-r--r--config/sanitizer/sanitizers.cmake10
-rw-r--r--config/toolchain/clang.cmake9
37 files changed, 958 insertions, 441 deletions
diff --git a/MANIFEST b/MANIFEST
index 65ba64c..ad51e01 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -129,6 +129,7 @@
./config/cygwin
./config/ibm-aix
./config/ibm-flags
+./config/intel-cxxflags
./config/intel-fflags
./config/intel-flags
./config/libhdf5.pc.in
@@ -140,6 +141,7 @@
./config/lt_vers.am
./config/Makefile.am.blank
./config/netbsd
+./config/pgi-cxxflags
./config/pgi-fflags
./config/pgi-flags
./config/solaris
@@ -165,6 +167,7 @@
./config/gnu-warnings/cxx-4.8
./config/gnu-warnings/cxx-4.9
./config/gnu-warnings/cxx-5
+./config/gnu-warnings/cxx-9
./config/gnu-warnings/cxx-error-5
./config/gnu-warnings/cxx-error-general
./config/gnu-warnings/cxx-noerror-5
@@ -189,8 +192,13 @@
./config/gnu-warnings/noerror-5
./config/gnu-warnings/noerror-8
./config/gnu-warnings/noerror-general
-./config/intel-warnings/ifort-general
+./config/intel-warnings/15
+./config/intel-warnings/18
+./config/intel-warnings/developer-general
./config/intel-warnings/general
+./config/intel-warnings/win-developer-general
+./config/intel-warnings/win-general
+./config/intel-warnings/ifort-general
./config/site-specific/BlankForm
diff --git a/config/clang-warnings/noerror-general b/config/clang-warnings/noerror-general
index b570b23..f90c812 100644
--- a/config/clang-warnings/noerror-general
+++ b/config/clang-warnings/noerror-general
@@ -1,6 +1,8 @@
#
-# HDF5 code should not trigger the following warnings under any
-# circumstances, so ask the compiler to treat them as errors:
+# These warnings will be treated as errors, using the error-general file,
+# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or
+# the --enable-warnings-as-errors option is specified for configure.
+# Otherwise this file will be used to treat them as warnings.
#
-Wbad-function-cast
-Wimplicit-function-declaration
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index b437266..729fff8 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -148,7 +148,7 @@ if (NOT WINDOWS)
OUTPUT_VARIABLE OUTPUT
)
if (TEST_DIRECT_VFD_WORKS_COMPILE)
- if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0)
+ if (TEST_DIRECT_VFD_WORKS_RUN EQUAL "0")
HDF_FUNCTION_TEST (HAVE_DIRECT)
set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
add_definitions ("-D_GNU_SOURCE")
@@ -201,7 +201,7 @@ macro (H5ConversionTests TEST msg)
OUTPUT_VARIABLE OUTPUT
)
if (${TEST}_COMPILE)
- if (${TEST}_RUN MATCHES 0)
+ if (${TEST}_RUN EQUAL "0")
set (${TEST} 1 CACHE INTERNAL ${msg})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "${msg}... yes")
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index a41e862..82d9f5f 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -72,7 +72,7 @@
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@
/* Define to 1 if you have the <curl/curl.h> header file. */
-#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@
+#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
@@ -307,7 +307,7 @@
/* Define to 1 if you have the `stat64' function. */
#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@
-/* Define if `struct stat' has the `st_blocks' field */
+/* Define if struct stat has the st_blocks field */
#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@
/* Define to 1 if you have the <stddef.h> header file. */
diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake
index d318aac..4df9301 100644
--- a/config/cmake/HDF5_Examples_options.cmake
+++ b/config/cmake/HDF5_Examples_options.cmake
@@ -40,17 +40,21 @@
### enable FILTERS builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON")
+### default HDF5_PLUGIN_PATH to where the filter libraries are located
+#set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin")
#############################################################################################
### enable parallel program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON")
+#############################################################################################
+### match the hdf5 library namespace
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NAMESPACE:STRING=hdf5::")
#############################################################################################
### enable threadsafe program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
-
#############################################################################################
### enable test program builds, requires reference files in testfiles subdirectory
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON")
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 8bcfb14..f06ffb0 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -9,17 +9,46 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-set(CMAKE_CXX_STANDARD 98)
-set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
-set(CMAKE_CXX_EXTENSIONS OFF)
+set (CMAKE_CXX_STANDARD 98)
+set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
+set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}")
+ message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}")
endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
+if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ 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_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
@@ -71,152 +100,169 @@ endif ()
# HDF5 library compile options
#-----------------------------------------------------------------------------
-if (NOT MSVC AND NOT MINGW)
- 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 (${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/win-general")
+ else ()
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/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/15")
+ endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CXXFLAGS "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CXXFLAGS "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18")
endif()
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if (CMAKE_COMPILER_IS_GNUCXX 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")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
- endif ()
+ endif()
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_COMPILER_IS_GNUCXX 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")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
endif ()
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- 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 ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
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 ()
-
- #-----------------------------------------------------------------------------
- # 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")
- # list (APPEND H5_CXXFLAGS "-Winline -Wreorder -Wport -Wstrict-aliasing")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
- endif ()
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
endif ()
+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")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general")
+ 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 "[Cc]lang")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ endif ()
+else ()
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)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
- endif ()
+ # 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 ()
- # 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/4.8")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
- 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.9+ knows about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
+ # 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/developer-4.8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
endif ()
+ 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")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
- 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 6.x+ knows about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ # 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")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 7.x+ knows about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- 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 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 8.x+ knows about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
- #if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
- #else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
- #endif ()
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- 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 ()
+ # 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 9.x+ knows about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+ # 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")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
+ endif ()
+ 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/9")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
endif ()
endif ()
-else ()
- if (NOT MINGW)
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
+
+ # 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 warniings
+ # 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 ()
#-----------------------------------------------------------------------------
@@ -256,17 +302,17 @@ endif ()
# 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")
+ 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_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")
- set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
+ 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 STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
endif ()
@@ -278,7 +324,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_PROFILING)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}")
endif ()
endif ()
@@ -288,7 +334,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_OPTIMIZATION)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}")
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 0775f59..210e475 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -14,14 +14,42 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
-
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}")
+ message (VERBOSE "Warnings Configuration: C default: ${CMAKE_C_FLAGS}")
endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
+if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ 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)
+else()
+endif()
+
+if(MSVC)
+ 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_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
@@ -81,169 +109,176 @@ endif ()
# HDF5 library compile options
#-----------------------------------------------------------------------------
-if (NOT MSVC AND NOT MINGW)
- #-----------------------------------------------------------------------------
- # Option to allow the user to interpret certain warnings as errors
- #
- # This should NOT be on by default as it can cause a lot of conflicts with
- # new operating systems and compiler versions. Header files that are out of
- # our control (MPI, HDFS, etc.) can also raise warnings.
- #-----------------------------------------------------------------------------
- option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF)
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- message (STATUS "...some warnings will be interpreted as errors")
- endif ()
+#-----------------------------------------------------------------------------
+# Option to allow the user to interpret certain warnings as errors
+#
+# This should NOT be on by default as it can cause a lot of conflicts with
+# new operating systems and compiler versions. Header files that are out of
+# our control (MPI, HDFS, etc.) can also raise warnings.
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF)
+if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ message (STATUS "...some warnings will be interpreted as errors")
+endif ()
- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- list (APPEND HDF5_CMAKE_C_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_C_COMPILER_ID STREQUAL "Intel")
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ list (APPEND HDF5_CMAKE_C_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_C_COMPILER_ID STREQUAL "Intel")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-general")
+ else ()
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
- list (APPEND H5_CFLAGS "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
- list (APPEND H5_CFLAGS "-Wreturn-type -Wstrict-prototypes -Wuninitialized")
- list (APPEND H5_CFLAGS "-Wunknown-pragmas -Wunused-function -Wunused-variable")
+ 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/15")
+ endif()
# this is just a failsafe
list (APPEND H5_CFLAGS "-finline-functions")
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CFLAGS "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CFLAGS "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18")
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")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
- endif ()
- 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 "[Cc]lang")
- ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ 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")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
else ()
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
endif ()
- elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
- list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
endif ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
+ # 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 "[Cc]lang")
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
endif ()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
+ list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
+ endif ()
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
endif ()
+endif ()
- #-----------------------------------------------------------------------------
- # Option to allow the user to enable developer warnings
- # Developer warnings (suggestions from gcc, not code problems)
- #-----------------------------------------------------------------------------
- option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
- if (HDF5_ENABLE_DEV_WARNINGS)
- message (STATUS "....HDF5 developer group warnings are enabled")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
- list (APPEND H5_CFLAGS "-Winline -Wreorder -Wport -Wstrict-aliasing")
- 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 "[Cc]lang")
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- 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")
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable developer warnings
+# Developer warnings (suggestions from gcc, not code problems)
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
+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/win-developer-general")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/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 "[Cc]lang")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ 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 ()
+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 ()
+ # 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 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")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
- 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")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
endif ()
+ 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 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")
- 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 ()
+ # 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")
+ 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")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
- endif ()
- 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 ()
+ # 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")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
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")
+ 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.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 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 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 ()
+ # 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 ()
endif ()
@@ -298,13 +333,13 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
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")
+ 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")
+ 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")
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 18ab621..94c40aa 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -91,9 +91,10 @@ if (NOT MSVC AND NOT MINGW)
#endif ()
# Append more extra warning flags that only gcc 5.x+ knows about
- if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
- endif ()
+ # do not include -Wuse-without-only
+ #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
+ #endif ()
# Append more extra warning flags that only gcc 6.x+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0)
diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in
index 8e93dc6..20ce630 100644
--- a/config/cmake/hdf5-config-version.cmake.in
+++ b/config/cmake/hdf5-config-version.cmake.in
@@ -33,7 +33,7 @@ else()
endif()
if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
- (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
+ (PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in
index c98d9ca..ecdd13e 100644
--- a/config/cmake/libh5cc.in
+++ b/config/cmake/libh5cc.in
@@ -29,4 +29,4 @@ printf 'dir is %s\n' "$dir"
export PKG_CONFIG_PATH=$dir/lib/pkgconfig
-@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@` $@
+@_PKG_CONFIG_COMPILER@ $@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@`
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index b89b915..5a44cde 100755
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -11,7 +11,7 @@
#
#############################################################################################
### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ###
-### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ###
+### BUILD_GENERATOR required [Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564] ###
### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf518.log ###
#############################################################################################
@@ -68,7 +68,7 @@ endif ()
# build generator must be defined
if (NOT DEFINED BUILD_GENERATOR)
- message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
+ message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564")
endif ()
###################################################################
@@ -105,7 +105,7 @@ endif ()
######### Following describes compiler ############
if (NOT DEFINED HPC)
if (NOT DEFINED BUILD_GENERATOR)
- message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
+ message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564")
endif ()
if (WIN32 AND NOT MINGW)
set (SITE_OS_NAME "Windows")
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 61a47be..e89d91e 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -396,15 +396,13 @@ HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T)
HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T)
HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T)
-if (NOT APPLE)
- HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
- HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
- endif ()
- if (MINGW OR NOT WINDOWS)
- HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
- endif ()
+HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
+HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+ set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
+endif ()
+if (MINGW OR NOT WINDOWS)
+ HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T)
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
index 28e7f8a..63101bb 100644
--- a/config/cmake_ext_mod/HDFUseCXX.cmake
+++ b/config/cmake_ext_mod/HDFUseCXX.cmake
@@ -43,6 +43,9 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
endif ()
endif ()
+#Always define
+set (${HDF_PREFIX}_CXX_HAVE_OFFSETOF 1)
+
# For other CXX specific tests, use this MACRO.
macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${OTHER_TEST})
@@ -108,7 +111,6 @@ if (CMAKE_CXX_COMPILER_LOADED)
HDF_NO_STD
BOOL_NOTDEFINED
NO_STATIC_CAST
- CXX_HAVE_OFFSETOF
)
HDF_CXX_FUNCTION_TEST (${cxx_test})
endforeach ()
diff --git a/config/commence.am b/config/commence.am
index 385da06..7f20ae9 100644
--- a/config/commence.am
+++ b/config/commence.am
@@ -44,7 +44,7 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
docdir = $(exec_prefix)/doc
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
+# has been removed. According to the official description of DESTDIR by GNU at
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
# prepended to the normal and complete install path that it precedes for the
# purpose of installing in a temporary directory which is useful for building
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index cba8298..b2ba08d 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -183,7 +183,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Warnings #
############
-# First load the C warnings then add CXX warnings (if needed)
###########
# General #
@@ -199,6 +198,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Developer warnings #
######################
+ # Use the C warnings as CXX warnings are the same
NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
@@ -210,6 +210,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# GCC 4.8 through the end of GCC 4 series
if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8-4.last)"
fi
@@ -220,13 +221,13 @@ if test "X-g++" = "X-$cxx_vendor"; then
# gcc >= 4.8
if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.8)"
+ # Use the C warnings as CXX warnings are the same
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)"
NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)"
fi
# gcc >= 4.9
if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 9; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)"
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)"
fi
@@ -239,27 +240,40 @@ if test "X-g++" = "X-$cxx_vendor"; then
# gcc >= 6
if test $cxx_vers_major -ge 6; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)"
fi
# gcc >= 7
if test $cxx_vers_major -ge 7; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)"
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)"
fi
# gcc 8
if test $cxx_vers_major -ge 8; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)"
#H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)"
#H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments noerror-8)"
+ # Use the C warnings as CXX warnings are the same
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)"
NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)"
fi
# gcc 9
if test $cxx_vers_major -ge 9; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-9)"
+ fi
+
+ # gcc >= 9.3
+ # no cxx warnings, do NOT use C warnings
+
+ # gcc >= 10
+ if test $cxx_vers_major -ge 10; then
+ # Use the C warnings as CXX warnings are the same
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)"
fi
#################
diff --git a/config/gnu-fflags b/config/gnu-fflags
index ec4fcab..ce12561 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -161,10 +161,10 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# gfortran 4.9 (nothing new)
- # gfortran >= 5
- if test $f9x_vers_major -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
- fi
+ # gfortran >= 5 (do not include -Wuse-without-only)
+ #if test $f9x_vers_major -ge 5; then
+ # H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
+ #fi
# gfortran >= 6
if test $f9x_vers_major -ge 6; then
diff --git a/config/gnu-flags b/config/gnu-flags
index 01533de..3e4ceb2 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -207,9 +207,9 @@ if test "X-gcc" = "X-$cc_vendor"; then
H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)"
H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-general)"
- ######################
- # Developer warnings #
- ######################
+ ######################
+ # Developer warnings #
+ ######################
NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
diff --git a/config/gnu-warnings/cxx-4.9 b/config/gnu-warnings/cxx-4.9
index 046d6db..30553bd 100644
--- a/config/gnu-warnings/cxx-4.9
+++ b/config/gnu-warnings/cxx-4.9
@@ -1 +1,2 @@
+-Wdate-time
-Wopenmp-simd
diff --git a/config/gnu-warnings/cxx-9 b/config/gnu-warnings/cxx-9
new file mode 100644
index 0000000..8f843a4
--- /dev/null
+++ b/config/gnu-warnings/cxx-9
@@ -0,0 +1,4 @@
+-Wattribute-alias=2
+-Wmissing-profile
+# Turn this on when the C++ wrappers obey the Rule of Five
+-Wno-deprecated-copy
diff --git a/config/gnu-warnings/developer-10 b/config/gnu-warnings/developer-10
index fcd460d..022c97f 100644
--- a/config/gnu-warnings/developer-10
+++ b/config/gnu-warnings/developer-10
@@ -1,6 +1,2 @@
# New warning
-Warith-conversion
-
-# Enable static analysis of program flow
--fanalyzer
--fdiagnostics-path-format=none
diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general
index f5b4afb..80c1975 100644
--- a/config/gnu-warnings/noerror-general
+++ b/config/gnu-warnings/noerror-general
@@ -1,6 +1,8 @@
#
-# HDF5 code should not trigger the following warnings under any
-# circumstances, so ask the compiler to treat them as errors:
+# These warnings will be treated as errors, using the error-general file,
+# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or
+# the --enable-warnings-as-errors option is specified for configure.
+# Otherwise this file will be used to treat them as warnings.
#
-Wbad-function-cast
-Wimplicit-function-declaration
diff --git a/config/intel-cxxflags b/config/intel-cxxflags
new file mode 100644
index 0000000..484100f
--- /dev/null
+++ b/config/intel-cxxflags
@@ -0,0 +1,184 @@
+# -*- shell-script -*-
+#
+# 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 should be sourced into configure if the compiler is the
+# Intel icpc compiler or a derivative. It is careful not to do anything
+# if the compiler is not Intel; otherwise `cxx_flags_set' is set to `yes'
+#
+
+#
+# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_intel_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg}
+ done)
+ IFS=' ' echo "$*"
+}
+
+# Get the compiler version in a way that works for icpc
+# icpc unless a compiler version is already known
+#
+# cxx_vendor: The compiler name: icpc
+# cxx_version: Version number: 8.0
+#
+if test X = "X$cxx_flags_set"; then
+ cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 |grep 'Version'`"
+ if test X != "X$cxx_version"; then
+ cxx_vendor=icpc
+ cxx_version=`echo $cxx_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'`
+ echo "compiler '$CXX' is Intel $cxx_vendor-$cxx_version"
+
+ # Some version numbers
+ # Intel version numbers are of the form: "major.minor"
+ cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
+ cxx_vers_minor=`echo $cxx_version | cut -f2 -d.`
+ #cxx_vers_patch=`echo $cxx_version | cut -f2 -d.`
+ test -n "$cxx_vers_major" || cxx_vers_major=0
+ test -n "$cxx_vers_minor" || cxx_vers_minor=0
+ test -n "$cxx_vers_patch" || cxx_vers_patch=0
+ cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
+ fi
+fi
+
+# Common Intel flags for various situations
+if test "X-icpc" = "X-$cxx_vendor"; then
+ # Insert section about version specific problems from compiler flags here,
+ # if necessary.
+
+ arch=
+ # Architecture-specific flags
+ # Nothing currently. (Uncomment code below and modify to add any)
+ #case "$host_os-$host_cpu" in
+ # *-i686)
+ # arch="-march=i686"
+ # ;;
+ #esac
+
+ # Host-specific flags
+ # Nothing currently. (Uncomment code below and modify to add any)
+ #case "`hostname`" in
+ # sleipnir.ncsa.uiuc.edu)
+ # arch="$arch -pipe"
+ # ;;
+ #esac
+
+ ###########
+ # General #
+ ###########
+
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch"
+
+ ##############
+ # Production #
+ ##############
+
+ PROD_CXXFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly in configure
+ # -g is handled by the symbols flags
+ DEBUG_CXXFLAGS=
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CXXFLAGS="-Wl,-s"
+ SYMBOLS_CXXFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CXXFLAGS="-p"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CXXFLAGS="-O3"
+ DEBUG_OPT_CXXFLAGS="-O0"
+ NO_OPT_CXXFLAGS="-O0"
+
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ # Add various general warning flags in intel-warnings.
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general)"
+
+ ######################
+ # Developer warnings #
+ ######################
+
+ # Use the C warnings as CXX warnings are the same
+ #NO_DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments no-developer-general)
+ #DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments developer-general)
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+ # intel == 8.0
+ if test $cxx_vers_major -eq 8 -a $cxx_vers_minor -eq 0; then
+ # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2.
+ HIGH_OPT_CFLAGS="-O2"
+ fi
+
+ # intel == 10
+ if test $cxx_vers_major -eq 10; then
+ HIGH_OPT_CFLAGS="-O1"
+ fi
+
+ # intel >= 15
+ if test $cxx_vers_major -ge 15; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 15)"
+ fi
+
+ # intel >= 18
+ if test $cxx_vers_major -ge 18; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 18)"
+ fi
+
+ # intel <= 19
+ if test $cxx_vers_major -le 19; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general-19)"
+ fi
+
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
+
+# Clear cxx info if no flags set
+if test "X-$cxx_flags_set" = "X-"; then
+ cxx_vendor=
+ cxx_version=
+fi
diff --git a/config/intel-fflags b/config/intel-fflags
index b759dfa..42c1781 100644
--- a/config/intel-fflags
+++ b/config/intel-fflags
@@ -56,13 +56,17 @@ if test X = "X$f9x_flags_set"; then
fi
fi
-# Common Intel flags for various situations
if test "X-ifort" = "X-$f9x_vendor"; then
- # Insert section about version specific problems from compiler flags here,
- # if necessary.
+
+ FC_BASENAME=ifort
+ F9XSUFFIXFLAG=""
+ FSEARCH_DIRS=""
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
arch=
- # Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
@@ -78,32 +82,55 @@ if test "X-ifort" = "X-$f9x_vendor"; then
# ;;
#esac
- # General
- FC_BASENAME=ifort
- F9XSUFFIXFLAG=""
- FSEARCH_DIRS=""
- H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free"
- H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)"
+ ##############
+ # Production #
+ ##############
- # Production
PROD_FCFLAGS=
- # Debug
+ #########
+ # Debug #
+ #########
+
DEBUG_FCFLAGS="-check all"
- # Symbols
- SYMBOLS_FCFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_FCFLAGS=
+ SYMBOLS_FCFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
- # Use this for profiling with gprof
PROFILE_FCFLAGS="-p"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_FCFLAGS="-O3"
DEBUG_OPT_FCFLAGS=
NO_OPT_FCFLAGS=
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)"
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+
#################
# Flags are set #
#################
@@ -116,4 +143,3 @@ if test "X-$f9x_flags_set" = "X-"; then
f9x_version=
fi
-
diff --git a/config/intel-flags b/config/intel-flags
index 409ffe9..f46da0a 100644
--- a/config/intel-flags
+++ b/config/intel-flags
@@ -78,26 +78,43 @@ if test "X-icc" = "X-$cc_vendor"; then
# ;;
#esac
- # General
+ ###########
+ # General #
+ ###########
+
# Default to C99 standard.
H5_CFLAGS="$H5_CFLAGS $arch -std=c99"
- # Production
+ ##############
+ # Production #
+ ##############
+
PROD_CFLAGS=
- # Debug
+ #########
+ # Debug #
+ #########
+
# NDEBUG is handled explicitly in configure
DEBUG_CFLAGS=
- # Symbols
- SYMBOLS_CFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_CFLAGS="-Wl,-s"
+ SYMBOLS_CFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
- # Use this for profiling with gprof
PROFILE_CFLAGS="-p"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_CFLAGS="-O3"
DEBUG_OPT_CFLAGS="-O0"
NO_OPT_CFLAGS="-O0"
@@ -110,32 +127,51 @@ if test "X-icc" = "X-$cc_vendor"; then
# General #
###########
+ # Add various general warning flags in intel-warnings.
H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)"
+ ######################
+ # Developer warnings #
+ ######################
+
+ #NO_DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments no-developer-general)
+ #DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments developer-general)
+
#############################
# Version-specific warnings #
#############################
-case "$cc_vendor-$cc_version" in
- icc-1[5-6]*)
- H5_CFLAGS="$H5_CFLAGS -Wcomment -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith -Wreturn-type -Wshadow -Wstrict-prototypes -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-variable -Wwrite-strings"
- ;;
- icc-10*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- icc-8.0*)
+ # intel == 8.0
+ if test $cc_vers_major -eq 8 -a $cc_vers_minor -eq 0; then
# v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2.
HIGH_OPT_CFLAGS="-O2"
- ;;
- icc-*)
- ;;
-esac
+ fi
+
+ # intel == 10
+ if test $cc_vers_major -eq 10; then
+ HIGH_OPT_CFLAGS="-O1"
+ fi
+
+ # intel >= 15
+ if test $cc_vers_major -ge 15; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 15)"
+ fi
+
+ # intel >= 18
+ if test $cc_vers_major -ge 18; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 18)"
+ fi
+
+ # intel <= 19
+ # this file has warnings only available before oneapi versions
+ if test $cc_vers_major -le 19; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general-19)"
+ fi
#################
# Flags are set #
#################
cc_flags_set=yes
-
fi
# Clear cc info if no flags set
diff --git a/config/intel-warnings/15 b/config/intel-warnings/15
new file mode 100644
index 0000000..6746f97
--- /dev/null
+++ b/config/intel-warnings/15
@@ -0,0 +1,19 @@
+-Wcomment
+-Wdeprecated
+-Wextra-tokens
+-Wformat
+-Wformat-security
+-Wmain
+-Wmissing-declarations
+-Wmissing-prototypes
+-Wp64
+-Wpointer-arith
+-Wreturn-type
+-Wshadow
+-Wstrict-prototypes
+-Wtrigraphs
+-Wuninitialized
+-Wunknown-pragmas
+-Wunused-function
+-Wunused-variable
+-Wwrite-strings
diff --git a/config/intel-warnings/18 b/config/intel-warnings/18
new file mode 100644
index 0000000..02bcdea
--- /dev/null
+++ b/config/intel-warnings/18
@@ -0,0 +1,2 @@
+-Wic-pointer
+-Wsign-compare
diff --git a/config/intel-warnings/developer-general b/config/intel-warnings/developer-general
new file mode 100644
index 0000000..fae56f0
--- /dev/null
+++ b/config/intel-warnings/developer-general
@@ -0,0 +1,4 @@
+-Winline
+-Wreorder
+-Wport
+-Wstrict-aliasing
diff --git a/config/intel-warnings/general b/config/intel-warnings/general
index d0b2e25..bd866b6 100644
--- a/config/intel-warnings/general
+++ b/config/intel-warnings/general
@@ -1,2 +1 @@
-Wall
--Wcheck \ No newline at end of file
diff --git a/config/intel-warnings/win-developer-general b/config/intel-warnings/win-developer-general
new file mode 100644
index 0000000..6cd7ed7
--- /dev/null
+++ b/config/intel-warnings/win-developer-general
@@ -0,0 +1 @@
+/Wport
diff --git a/config/intel-warnings/win-general b/config/intel-warnings/win-general
new file mode 100644
index 0000000..ef54b2b
--- /dev/null
+++ b/config/intel-warnings/win-general
@@ -0,0 +1 @@
+/Wall
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1
index 0fef161..d952c4e 100644
--- a/config/linux-gnulibc1
+++ b/config/linux-gnulibc1
@@ -199,9 +199,16 @@ if test -z "$CXX"; then
CXX_BASENAME=g++
fi
+# Figure out Intel CXX compiler flags
+# Do this ahead of GNU to avoid icpc being detected as g++
+. $srcdir/config/intel-cxxflags
+
# Figure out GNU CXX compiler flags
. $srcdir/config/gnu-cxxflags
+# Figure out PGI CXX compiler flags
+. $srcdir/config/pgi-cxxflags
+
# Figure out Clang CXX compiler flags
. $srcdir/config/clang-cxxflags
@@ -314,6 +321,9 @@ fi
# check if the compiler_version_info is already set
if test -z "$cxx_version_info"; then
case $CXX in
+ *pgc++*)
+ cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgc++'`
+ ;;
*g++*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
@@ -322,10 +332,6 @@ case $CXX in
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
- *pgCC*)
- cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgCC'`
- ;;
-
*mpicxx*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep 'version' |\
sed 's/^[a-z0-9]* for //' |\
diff --git a/config/pgi-cxxflags b/config/pgi-cxxflags
new file mode 100644
index 0000000..5fc74ae
--- /dev/null
+++ b/config/pgi-cxxflags
@@ -0,0 +1,100 @@
+# -*- shell-script -*-
+#
+# 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 should be sourced into configure if the compiler is the
+# PGI pgc++ compiler or a derivative. It is careful not to do anything
+# if the compiler is not PGI; otherwise `cxx_flags_set' is set to `yes'
+#
+
+# Get the compiler version in a way that works for pgc++
+# pgc++ unless a compiler version is already known
+#
+# cxx_vendor: The compiler name: pgc++
+# cxx_version: Version number: 5.0-2, 5.2-2
+#
+if test X = "X$cxx_flags_set"; then
+ cxx_version="`$CXX $CXXFLAGS -V 2>&1 |grep '^pgc++ '`"
+ if test X != "X$cxx_version"; then
+ cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*++\).*/\1/'`
+ cxx_version=`echo $cxx_version |sed 's/pgc++ \([-a-z0-9\.\-]*\).*/\1/'`
+ echo "compiler '$CXX' is PGI $cxx_vendor-$cxx_version"
+
+ # Some version numbers
+ # PGI version numbers are of the form: "major.minor-patch"
+ cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
+ cxx_vers_minor=`echo $cxx_version | cut -f2 -d. | cut -f1 -d-`
+ cxx_vers_patch=`echo $cxx_version | cut -f2 -d. | cut -f2 -d-`
+ test -n "$cxx_vers_major" || cxx_vers_major=0
+ test -n "$cxx_vers_minor" || cxx_vers_minor=0
+ test -n "$cxx_vers_patch" || cxx_vers_patch=0
+ cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
+ fi
+fi
+
+# Common PGI flags for various situations
+if test "X-pgc++" = "X-$cxx_vendor"; then
+
+ ###########
+ # General #
+ ###########
+
+ H5_CXXFLAGS="$H5_CXXFLAGS -Minform=warn"
+
+ ##############
+ # Production #
+ ##############
+
+ PROD_CXXFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly in configure
+ # -g is handled by the symbols flags
+ DEBUG_CXXFLAGS="-Mbounds"
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CXXFLAGS="-s"
+ SYMBOLS_CXXFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CXXFLAGS="-Mprof=func,line"
+ # Use this for profiling with gprof
+ #PROFILE_CXXFLAGS="-pg"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CXXFLAGS="-O4"
+ DEBUG_OPT_CXXFLAGS="-gopt -O2"
+ NO_OPT_CXXFLAGS="-O0"
+
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
+
+# Clear cxx info if no flags set
+if test "X-$cxx_flags_set" = "X-"; then
+ cxx_vendor=
+ cxx_version=
+fi
diff --git a/config/pgi-fflags b/config/pgi-fflags
index 3171695..6401d8d 100644
--- a/config/pgi-fflags
+++ b/config/pgi-fflags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -45,11 +45,12 @@ fi
# Common PGI flags for various situations
if test "X-pgf90" = "X-$f9x_vendor"; then
- # Insert section about version specific problems from gnu-flags here, if
- # necessary.
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
arch=
- # Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
@@ -65,15 +66,10 @@ if test "X-pgf90" = "X-$f9x_vendor"; then
# ;;
#esac
- # General
- FC_BASENAME=pgf90
- Fortran_COMPILER_ID=PGI
- F9XSUFFIXFLAG=""
- FSEARCH_DIRS=""
- # Uncomment the following to add something specific for FCFLAGS.
- #FCFLAGS="$FCFLAGS"
+ ##############
+ # Production #
+ ##############
- # Production
# Check for MPI wrapper being used and tweak down compiler options
# Comment out the Tweaking since it caused problems to mpich1.2.6.
# Need to investigate the reasons to tweak.
@@ -84,24 +80,55 @@ if test "X-pgf90" = "X-$f9x_vendor"; then
#fi
PROD_FCFLAGS="-fast -Mnoframe"
- # Debug
+ #########
+ # Debug #
+ #########
+
DEBUG_FCFLAGS="-Mbounds -Mchkptr -Mdclchk"
- # Symbols
- SYMBOLS_FCFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_FCFLAGS="-s"
+ SYMBOLS_FCFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
PROFILE_FCFLAGS="-Mprof=func,line"
# Use this for profiling with gprof
#PROFILE_FCFLAGS="-pg"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_FCFLAGS=
DEBUG_OPT_FCFLAGS=
NO_OPT_FCFLAGS=
- # Flags are set
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ FC_BASENAME=pgf90
+ Fortran_COMPILER_ID=PGI
+ F9XSUFFIXFLAG=""
+ FSEARCH_DIRS=""
+ # Uncomment the following to add something specific for FCFLAGS.
+ #FCFLAGS="$FCFLAGS"
+
+
+
+ #################
+ # Flags are set #
+ #################
f9x_flags_set=yes
fi
@@ -111,4 +138,3 @@ if test "X-$f9x_flags_set" = "X-"; then
f9x_version=
fi
-
diff --git a/config/pgi-flags b/config/pgi-flags
index e1bec00..b197a1c 100644
--- a/config/pgi-flags
+++ b/config/pgi-flags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -45,8 +45,8 @@ fi
# Common PGI flags for various situations
if test "X-pgcc" = "X-$cc_vendor"; then
- # Insert section about version specific problems from gnu-flags here, if
- # necessary.
+ # Insert section about version specific problems from compiler flags here,
+ # if necessary.
arch=
# Architecture-specific flags
@@ -65,58 +65,59 @@ if test "X-pgcc" = "X-$cc_vendor"; then
# ;;
#esac
- # General
- H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=inform"
-
- # Production
- case "$cc_vendor-$cc_version" in
- pgcc-10.6*)
- PROD_CFLAGS=
- ;;
- pgcc-9.*)
- PROD_CFLAGS=
- ;;
- *)
- PROD_CFLAGS="-fast"
- ;;
- esac
-
- # Debug
+ ###########
+ # General #
+ ###########
+
+ # Default to C99 standard.
+ H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=warn"
+
+ ##############
+ # Production #
+ ##############
+
+ # NDEBUG is handled explicitly by the configure script
+ PROD_CFLAGS="-fast"
+
+ #########
+ # Debug #
+ #########
+
# NDEBUG is handled explicitly by the configure script
+ # -g is handled by the symbols flags
DEBUG_CFLAGS="-Mbounds"
- # Symbols
- SYMBOLS_CFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_CFLAGS="-s"
+ SYMBOLS_CFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
PROFILE_CFLAGS="-Mprof=func,line"
# Use this for profiling with gprof
#PROFILE_CFLAGS="-pg"
- # Optimization
- case "$cc_vendor-$cc_version" in
- # Tweak down compiler optimizations for v10.6, it has a bug
- pgcc-10.6*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- # Tweak down compiler optimizations for v9.x
- pgcc-9.*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- *)
- HIGH_OPT_CFLAGS=
- ;;
- esac
- DEBUG_OPT_CFLAGS=
- NO_OPT_CFLAGS=
-
- # Flags are set
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CFLAGS="-O4"
+ DEBUG_OPT_CFLAGS="-gopt -O2"
+ NO_OPT_CFLAGS="-O0"
+
+ #################
+ # Flags are set #
+ #################
cc_flags_set=yes
fi
# Clear cc info if no flags set
if test "X-$cc_flags_set" = "X-"; then
- cc_vendor=
- cc_version=
+ cc_vendor=
+ cc_version=
fi
diff --git a/config/sanitizer/code-coverage.cmake b/config/sanitizer/code-coverage.cmake
index 8d765f7..c79aeac 100644
--- a/config/sanitizer/code-coverage.cmake
+++ b/config/sanitizer/code-coverage.cmake
@@ -99,8 +99,7 @@ if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}
DEPENDS ccov-clean)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
# Messages
message(STATUS "Building with llvm Code Coverage Tools")
@@ -206,8 +205,7 @@ function(target_code_coverage TARGET_NAME)
if(CODE_COVERAGE)
# Add code coverage instrumentation to the target's linker command
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
target_compile_options(${TARGET_NAME} PRIVATE -fprofile-instr-generate
-fcoverage-mapping)
set_property(
@@ -229,8 +227,7 @@ function(target_code_coverage TARGET_NAME)
# Add shared library to processing for 'all' targets
if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
add_custom_target(
ccov-run-${TARGET_NAME}
COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
@@ -250,8 +247,7 @@ function(target_code_coverage TARGET_NAME)
# For executables add targets to run and produce output
if(target_type STREQUAL "EXECUTABLE")
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
# If there are shared objects to also work with, generate the string to
# add them here
@@ -409,8 +405,7 @@ endfunction()
# any subdirectories. To add coverage instrumentation to only specific targets,
# use `target_code_coverage`.
function(add_code_coverage)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
@@ -435,8 +430,7 @@ function(add_code_coverage_all_targets)
"${multi_value_keywords}" ${ARGN})
if(CODE_COVERAGE)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
# Merge the profile data for all of the run executables
add_custom_target(
diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake
index 0803279..8bf1d5b 100644
--- a/config/sanitizer/sanitizers.cmake
+++ b/config/sanitizer/sanitizers.cmake
@@ -30,13 +30,13 @@ endfunction()
message(STATUS "USE_SANITIZER=${USE_SANITIZER}, CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}")
if(USE_SANITIZER)
- if(INTEL_CLANG OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
+ if(INTEL_CLANG OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
- append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
- message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}")
-
if(UNIX)
+ append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}")
+
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
endif()
@@ -83,7 +83,7 @@ if(USE_SANITIZER)
elseif(MSVC)
if(USE_SANITIZER MATCHES "([Aa]ddress)")
message(STATUS "Building with Address sanitizer")
- append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ append("/fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
else()
message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}")
endif()
diff --git a/config/toolchain/clang.cmake b/config/toolchain/clang.cmake
index 5e3b13a..af176aa 100644
--- a/config/toolchain/clang.cmake
+++ b/config/toolchain/clang.cmake
@@ -3,8 +3,13 @@
set(CMAKE_COMPILER_VENDOR "clang")
-set(CMAKE_C_COMPILER clang)
-set(CMAKE_CXX_COMPILER clang++)
+if(WIN32)
+ set(CMAKE_C_COMPILER clang-cl)
+ set(CMAKE_CXX_COMPILER clang-cl)
+else()
+ set(CMAKE_C_COMPILER clang)
+ set(CMAKE_CXX_COMPILER clang++)
+endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# the following is used if cross-compiling