summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-11-01 19:41:46 (GMT)
committerGitHub <noreply@github.com>2023-11-01 19:41:46 (GMT)
commit64e239c4b6adcf597ac5ada6e7f03cbff126e833 (patch)
treebc532a492d3bd9bacdf0f6f797fc3460f900c15d /config
parent562c53c44a22c979419deb1cb025b2a74900fbac (diff)
downloadhdf5-64e239c4b6adcf597ac5ada6e7f03cbff126e833.zip
hdf5-64e239c4b6adcf597ac5ada6e7f03cbff126e833.tar.gz
hdf5-64e239c4b6adcf597ac5ada6e7f03cbff126e833.tar.bz2
Set NVHPC maximum optimization level to -O1 for now (#3800)
* Set NVHPC maximum optimization level to -O1 for now Compiling HDF5 with NVHPC 23.5 - 23.9 results in test failures in 4 different test files that need to be resolved. Since those tests pass with an optimization level of -O1 (and -O0) and it is currently unclear whether the test failures are due to issues in HDF5 or issues in the 'nvc' compiler, set the maximum optimization level for NVHPC to -O1 until the test failures are resolved. * Disable nvhpc Java testing in CMake and amend known issues * Re-enable testing of Autotools nvhpc
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake38
-rw-r--r--config/nvidia-flags6
2 files changed, 42 insertions, 2 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index e7b9337..7bddad0 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -56,6 +56,44 @@ if (CMAKE_C_COMPILER_ID STREQUAL "NVHPC" )
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -g")
endif ()
+
+ # With at least NVHPC 23.5 - 23.9, compiling with -O2 or higher and -DNDEBUG
+ # appears to have issues that manifest in the tests as incorrect metadata
+ # checksums being read or memory being corrupted. Compiling without -DNDEBUG
+ # does not appear to have these issues, but is not ideal due to compiling in
+ # asserts and other library debug code. Compiling with -O1 also does not appear
+ # to have these issues, so set maximum optimization level to -O1 for now until
+ # it can be determined whether these issues are compiler-specific or issues
+ # in the library.
+ set (cmake_c_flags_minsizerel_edited "${CMAKE_C_FLAGS_MINSIZEREL}")
+ string (REPLACE "-O2" "" cmake_c_flags_minsizerel_edited "${cmake_c_flags_minsizerel_edited}")
+ string (REPLACE "-O3" "" cmake_c_flags_minsizerel_edited "${cmake_c_flags_minsizerel_edited}")
+ string (REPLACE "-O4" "" cmake_c_flags_minsizerel_edited "${cmake_c_flags_minsizerel_edited}")
+ string (REPLACE "-Ofast" "" cmake_c_flags_minsizerel_edited "${cmake_c_flags_minsizerel_edited}")
+ string (REPLACE "-fast" "" cmake_c_flags_minsizerel_edited "${cmake_c_flags_minsizerel_edited}")
+ string (STRIP "${cmake_c_flags_minsizerel_edited}" cmake_c_flags_minsizerel_edited)
+ string (PREPEND cmake_c_flags_minsizerel_edited "-O1 ")
+ set (CMAKE_C_FLAGS_MINSIZEREL "${cmake_c_flags_minsizerel_edited}")
+
+ set (cmake_c_flags_release_edited "${CMAKE_C_FLAGS_RELEASE}")
+ string (REPLACE "-O2" "" cmake_c_flags_release_edited "${cmake_c_flags_release_edited}")
+ string (REPLACE "-O3" "" cmake_c_flags_release_edited "${cmake_c_flags_release_edited}")
+ string (REPLACE "-O4" "" cmake_c_flags_release_edited "${cmake_c_flags_release_edited}")
+ string (REPLACE "-Ofast" "" cmake_c_flags_release_edited "${cmake_c_flags_release_edited}")
+ string (REPLACE "-fast" "" cmake_c_flags_release_edited "${cmake_c_flags_release_edited}")
+ string (STRIP "${cmake_c_flags_release_edited}" cmake_c_flags_release_edited)
+ string (PREPEND cmake_c_flags_release_edited "-O1 ")
+ set (CMAKE_C_FLAGS_RELEASE "${cmake_c_flags_release_edited}")
+
+ set (cmake_c_flags_relwithdebinfo_edited "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+ string (REPLACE "-O2" "" cmake_c_flags_relwithdebinfo_edited "${cmake_c_flags_relwithdebinfo_edited}")
+ string (REPLACE "-O3" "" cmake_c_flags_relwithdebinfo_edited "${cmake_c_flags_relwithdebinfo_edited}")
+ string (REPLACE "-O4" "" cmake_c_flags_relwithdebinfo_edited "${cmake_c_flags_relwithdebinfo_edited}")
+ string (REPLACE "-Ofast" "" cmake_c_flags_relwithdebinfo_edited "${cmake_c_flags_relwithdebinfo_edited}")
+ string (REPLACE "-fast" "" cmake_c_flags_relwithdebinfo_edited "${cmake_c_flags_relwithdebinfo_edited}")
+ string (STRIP "${cmake_c_flags_relwithdebinfo_edited}" cmake_c_flags_relwithdebinfo_edited)
+ string (PREPEND cmake_c_flags_relwithdebinfo_edited "-O1 ")
+ set (CMAKE_C_FLAGS_RELWITHDEBINFO "${cmake_c_flags_relwithdebinfo_edited}")
endif ()
if (CMAKE_COMPILER_IS_GNUCC)
diff --git a/config/nvidia-flags b/config/nvidia-flags
index 864c644..c140edd 100644
--- a/config/nvidia-flags
+++ b/config/nvidia-flags
@@ -76,7 +76,8 @@ if test "X-nvc" = "X-$cc_vendor" -o "X-nvcc" = "X-$cc_vendor"; then
##############
# NDEBUG is handled explicitly by the configure script
- PROD_CFLAGS="-fast"
+ #PROD_CFLAGS="-fast"
+ PROD_CFLAGS="" # -fast implies -O2 and -O2+ currently has test failures.
#########
# Debug #
@@ -106,7 +107,8 @@ if test "X-nvc" = "X-$cc_vendor" -o "X-nvcc" = "X-$cc_vendor"; then
################
HIGH_OPT_CFLAGS="-O1" # -O2+ currently has test failures.
- DEBUG_OPT_CFLAGS="-gopt -O2"
+ #DEBUG_OPT_CFLAGS="-gopt -O2"
+ DEBUG_OPT_CFLAGS="-gopt -O1" # -O2+ currently has test failures.
NO_OPT_CFLAGS="-O0"
#################