From 2bb6619528c1faef3382705f9635f85ad32e6f6d Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:17:20 -0500 Subject: Develop intel split (#3722) * Split intel compiler flags into sub-folders * Update Intel options for warnings * Mostly CMake, Autotools needs additional work --- config/cmake/HDFCXXCompilerFlags.cmake | 38 ++++++--- config/cmake/HDFCompilerFlags.cmake | 90 +++++++++++++--------- config/cmake/HDFFortranCompilerFlags.cmake | 20 ++++- config/gnu-warnings/developer-general | 8 -- config/intel-cxxflags | 12 +-- config/intel-fflags | 2 +- config/intel-flags | 12 +-- config/intel-warnings/15 | 19 ----- config/intel-warnings/18 | 2 - config/intel-warnings/classic/15 | 19 +++++ config/intel-warnings/classic/18 | 2 + config/intel-warnings/classic/developer-general | 3 + config/intel-warnings/classic/general | 1 + config/intel-warnings/classic/ifort-general | 1 + .../intel-warnings/classic/win-developer-general | 1 + config/intel-warnings/classic/win-general | 1 + config/intel-warnings/classic/win-ifort-general | 1 + config/intel-warnings/developer-general | 11 --- config/intel-warnings/general | 1 - config/intel-warnings/ifort-general | 1 - config/intel-warnings/oneapi/developer-general | 2 + config/intel-warnings/oneapi/general | 1 + config/intel-warnings/oneapi/ifort-general | 1 + config/intel-warnings/oneapi/win-developer-general | 2 + config/intel-warnings/oneapi/win-general | 1 + config/intel-warnings/oneapi/win-ifort-general | 1 + config/intel-warnings/win-developer-general | 1 - config/intel-warnings/win-general | 1 - config/intel-warnings/win-ifort-general | 1 - 29 files changed, 151 insertions(+), 105 deletions(-) delete mode 100644 config/intel-warnings/15 delete mode 100644 config/intel-warnings/18 create mode 100644 config/intel-warnings/classic/15 create mode 100644 config/intel-warnings/classic/18 create mode 100644 config/intel-warnings/classic/developer-general create mode 100644 config/intel-warnings/classic/general create mode 100644 config/intel-warnings/classic/ifort-general create mode 100644 config/intel-warnings/classic/win-developer-general create mode 100644 config/intel-warnings/classic/win-general create mode 100644 config/intel-warnings/classic/win-ifort-general delete mode 100644 config/intel-warnings/developer-general delete mode 100644 config/intel-warnings/general delete mode 100644 config/intel-warnings/ifort-general create mode 100644 config/intel-warnings/oneapi/developer-general create mode 100644 config/intel-warnings/oneapi/general create mode 100644 config/intel-warnings/oneapi/ifort-general create mode 100644 config/intel-warnings/oneapi/win-developer-general create mode 100644 config/intel-warnings/oneapi/win-general create mode 100644 config/intel-warnings/oneapi/win-ifort-general delete mode 100644 config/intel-warnings/win-developer-general delete mode 100644 config/intel-warnings/win-general delete mode 100644 config/intel-warnings/win-ifort-general diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 13f712d..dd120c9 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -21,7 +21,7 @@ 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") +if (WIN32 AND (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")) set (_INTEL_WINDOWS 1) endif () @@ -130,16 +130,16 @@ else () # 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") + 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/general") + 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/15") + 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/18") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/classic/18") endif() endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") @@ -149,7 +149,13 @@ else () 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" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + 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") @@ -164,18 +170,28 @@ endif () 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") + 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" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + 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 "IntelLLVM" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") endif () endif () @@ -307,6 +323,8 @@ 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 () @@ -315,6 +333,8 @@ 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 () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index a6bce98..e7b9337 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -9,8 +9,8 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -set(CMAKE_C_STANDARD 99) -set(CMAKE_C_STANDARD_REQUIRED TRUE) +set (CMAKE_C_STANDARD 99) +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}") @@ -18,45 +18,45 @@ message (VERBOSE "Warnings Configuration: C default: ${CMAKE_C_FLAGS}") #----------------------------------------------------------------------------- # 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 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() +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 OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS) + add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +endif () -if(MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000") -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 (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 (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") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") endif () else () - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -g") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -g") endif () -endif() +endif () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") @@ -146,20 +146,20 @@ else () # 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") + 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/general") + 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/15") - endif() + 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/18") - endif() - endif() + 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) @@ -169,7 +169,15 @@ else () # 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" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + 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") @@ -191,13 +199,19 @@ 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") + 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/developer-general") + 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" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + 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 () @@ -211,12 +225,16 @@ if (HDF5_ENABLE_DEV_WARNINGS) 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 "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") endif () endif () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index f207c70..8ac3f49 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -23,6 +23,8 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) 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) @@ -70,7 +72,11 @@ endif () if (NOT MSVC AND NOT MINGW) # General flags if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general") + 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") @@ -85,6 +91,13 @@ if (NOT MSVC AND NOT MINGW) 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 () @@ -135,7 +148,10 @@ if (NOT MSVC AND NOT MINGW) endif () else () if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general") + 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/gnu-warnings/developer-general b/config/gnu-warnings/developer-general index 79ecd6a..af70172 100644 --- a/config/gnu-warnings/developer-general +++ b/config/gnu-warnings/developer-general @@ -7,11 +7,3 @@ -Wswitch-enum -Wunsafe-loop-optimizations -Wunused-macros -# -Winline warnings aren't included here because, for at least -# GNU compilers, this flag appears to conflict specifically with -# the -Og optimization level flag added for Debug and Developer -# builds and will produce warnings about functions not being -# considered for inlining. The flag will be added to the list -# of compiler flags separately if developer warnings are enabled -# and the build type is not Debug or Developer -#-Winline diff --git a/config/intel-cxxflags b/config/intel-cxxflags index 107b087..40a3f0e 100644 --- a/config/intel-cxxflags +++ b/config/intel-cxxflags @@ -129,15 +129,15 @@ if test "X-icpc" = "X-$cxx_vendor"; then # 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)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments classic/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) + #NO_DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments classic/no-developer-general) + #DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments classic/developer-general) ############################# # Version-specific warnings # @@ -157,19 +157,19 @@ if test "X-icpc" = "X-$cxx_vendor"; then # 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)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments classic/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)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments classic/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)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments classic/general-19)" fi ################# diff --git a/config/intel-fflags b/config/intel-fflags index ad1ce7c..b6307c1 100644 --- a/config/intel-fflags +++ b/config/intel-fflags @@ -123,7 +123,7 @@ if test "X-ifort" = "X-$f9x_vendor"; then ########### H5_FCFLAGS="$H5_FCFLAGS -free" - H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)" + H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments classic/ifort-general)" ############################# # Version-specific warnings # diff --git a/config/intel-flags b/config/intel-flags index fbec7ef..134452c 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -127,14 +127,14 @@ if test "X-icc" = "X-$cc_vendor"; then ########### # Add various general warning flags in intel-warnings. - H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments classic/general)" ###################### # Developer warnings # ###################### - #NO_DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments no-developer-general) - #DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments developer-general) + #NO_DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments classic/no-developer-general) + #DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments classic/developer-general) ############################# # Version-specific warnings # @@ -153,18 +153,18 @@ if test "X-icc" = "X-$cc_vendor"; then # intel >= 15 if test $cc_vers_major -ge 15; then - H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 15)" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments classic/15)" fi # intel >= 18 if test $cc_vers_major -ge 18; then - H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 18)" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments classic/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)" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments classic/general-19)" fi ################# diff --git a/config/intel-warnings/15 b/config/intel-warnings/15 deleted file mode 100644 index 6746f97..0000000 --- a/config/intel-warnings/15 +++ /dev/null @@ -1,19 +0,0 @@ --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 deleted file mode 100644 index 02bcdea..0000000 --- a/config/intel-warnings/18 +++ /dev/null @@ -1,2 +0,0 @@ --Wic-pointer --Wsign-compare diff --git a/config/intel-warnings/classic/15 b/config/intel-warnings/classic/15 new file mode 100644 index 0000000..6746f97 --- /dev/null +++ b/config/intel-warnings/classic/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/classic/18 b/config/intel-warnings/classic/18 new file mode 100644 index 0000000..02bcdea --- /dev/null +++ b/config/intel-warnings/classic/18 @@ -0,0 +1,2 @@ +-Wic-pointer +-Wsign-compare diff --git a/config/intel-warnings/classic/developer-general b/config/intel-warnings/classic/developer-general new file mode 100644 index 0000000..6f4e9e9 --- /dev/null +++ b/config/intel-warnings/classic/developer-general @@ -0,0 +1,3 @@ +-Wreorder +-Wport +-Wstrict-aliasing diff --git a/config/intel-warnings/classic/general b/config/intel-warnings/classic/general new file mode 100644 index 0000000..bd866b6 --- /dev/null +++ b/config/intel-warnings/classic/general @@ -0,0 +1 @@ +-Wall diff --git a/config/intel-warnings/classic/ifort-general b/config/intel-warnings/classic/ifort-general new file mode 100644 index 0000000..1644c7c --- /dev/null +++ b/config/intel-warnings/classic/ifort-general @@ -0,0 +1 @@ +-warn all diff --git a/config/intel-warnings/classic/win-developer-general b/config/intel-warnings/classic/win-developer-general new file mode 100644 index 0000000..6cd7ed7 --- /dev/null +++ b/config/intel-warnings/classic/win-developer-general @@ -0,0 +1 @@ +/Wport diff --git a/config/intel-warnings/classic/win-general b/config/intel-warnings/classic/win-general new file mode 100644 index 0000000..ef54b2b --- /dev/null +++ b/config/intel-warnings/classic/win-general @@ -0,0 +1 @@ +/Wall diff --git a/config/intel-warnings/classic/win-ifort-general b/config/intel-warnings/classic/win-ifort-general new file mode 100644 index 0000000..a335959 --- /dev/null +++ b/config/intel-warnings/classic/win-ifort-general @@ -0,0 +1 @@ +/warn:all diff --git a/config/intel-warnings/developer-general b/config/intel-warnings/developer-general deleted file mode 100644 index 861218e..0000000 --- a/config/intel-warnings/developer-general +++ /dev/null @@ -1,11 +0,0 @@ --Wreorder --Wport --Wstrict-aliasing -# -Winline warnings aren't included here because, for at least -# GNU compilers, this flag appears to conflict specifically with -# the -Og optimization level flag added for Debug and Developer -# builds and will produce warnings about functions not being -# considered for inlining. The flag will be added to the list -# of compiler flags separately if developer warnings are enabled -# and the build type is not Debug or Developer -#-Winline diff --git a/config/intel-warnings/general b/config/intel-warnings/general deleted file mode 100644 index bd866b6..0000000 --- a/config/intel-warnings/general +++ /dev/null @@ -1 +0,0 @@ --Wall diff --git a/config/intel-warnings/ifort-general b/config/intel-warnings/ifort-general deleted file mode 100644 index 1644c7c..0000000 --- a/config/intel-warnings/ifort-general +++ /dev/null @@ -1 +0,0 @@ --warn all diff --git a/config/intel-warnings/oneapi/developer-general b/config/intel-warnings/oneapi/developer-general new file mode 100644 index 0000000..122c33d --- /dev/null +++ b/config/intel-warnings/oneapi/developer-general @@ -0,0 +1,2 @@ +-Wreorder +-Wstrict-aliasing diff --git a/config/intel-warnings/oneapi/general b/config/intel-warnings/oneapi/general new file mode 100644 index 0000000..bd866b6 --- /dev/null +++ b/config/intel-warnings/oneapi/general @@ -0,0 +1 @@ +-Wall diff --git a/config/intel-warnings/oneapi/ifort-general b/config/intel-warnings/oneapi/ifort-general new file mode 100644 index 0000000..1644c7c --- /dev/null +++ b/config/intel-warnings/oneapi/ifort-general @@ -0,0 +1 @@ +-warn all diff --git a/config/intel-warnings/oneapi/win-developer-general b/config/intel-warnings/oneapi/win-developer-general new file mode 100644 index 0000000..ba86a0f --- /dev/null +++ b/config/intel-warnings/oneapi/win-developer-general @@ -0,0 +1,2 @@ +/Wreorder +/Wstrict-aliasing diff --git a/config/intel-warnings/oneapi/win-general b/config/intel-warnings/oneapi/win-general new file mode 100644 index 0000000..ef54b2b --- /dev/null +++ b/config/intel-warnings/oneapi/win-general @@ -0,0 +1 @@ +/Wall diff --git a/config/intel-warnings/oneapi/win-ifort-general b/config/intel-warnings/oneapi/win-ifort-general new file mode 100644 index 0000000..a335959 --- /dev/null +++ b/config/intel-warnings/oneapi/win-ifort-general @@ -0,0 +1 @@ +/warn:all diff --git a/config/intel-warnings/win-developer-general b/config/intel-warnings/win-developer-general deleted file mode 100644 index 6cd7ed7..0000000 --- a/config/intel-warnings/win-developer-general +++ /dev/null @@ -1 +0,0 @@ -/Wport diff --git a/config/intel-warnings/win-general b/config/intel-warnings/win-general deleted file mode 100644 index ef54b2b..0000000 --- a/config/intel-warnings/win-general +++ /dev/null @@ -1 +0,0 @@ -/Wall diff --git a/config/intel-warnings/win-ifort-general b/config/intel-warnings/win-ifort-general deleted file mode 100644 index a335959..0000000 --- a/config/intel-warnings/win-ifort-general +++ /dev/null @@ -1 +0,0 @@ -/warn:all -- cgit v0.12