Skip to content

Commit

Permalink
Remove -W options from config-specs in favor of build system
Browse files Browse the repository at this point in the history
If we're enabling a warning in the PostCompilerConfig.cmake file, it
makes no sense to disable it in config-specs.ini.  So stop doing that.
But some of them are needed, and we likely want them, so do our best to
keep them disabled if need be (and do it in the build system so that
people not using GenConfig can benefit as well).

Signed-off-by: Samuel E. Browne <[email protected]>
  • Loading branch information
sebrowne committed Jan 2, 2025
1 parent 9d766c6 commit 1209a65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
13 changes: 12 additions & 1 deletion cmake/ProjectCompilerPostConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ macro(enable_warnings warnings)
endmacro()


macro(disable_warnings warnings)
message(STATUS "Trilinos warnings disabled: ${warnings}")
foreach(warning ${warnings})
set(CMAKE_CXX_FLAGS "-Wno-${warning} ${CMAKE_CXX_FLAGS}")
endforeach()
endmacro()


macro(enable_errors errors)
message(STATUS "Trilinos warnings-as-errors enabled: ${errors}")
foreach(error ${errors})
Expand All @@ -43,6 +51,7 @@ IF (KokkosEnable)
# being treated as an internal package.
ENDIF()

set(explicitly_disabled_warnings inline)
set(upcoming_warnings shadow ${Trilinos_ADDITIONAL_WARNINGS})
set(promoted_warnings
address
Expand Down Expand Up @@ -79,4 +88,6 @@ if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN")
elseif("${Trilinos_WARNINGS_MODE}" STREQUAL "ERROR")
enable_errors("${promoted_warnings};${upcoming_warnings}")
disable_warnings_for_deprecated_packages()
endif()
endif()

disable_warnings("${explicitly_disabled_warnings}")
12 changes: 6 additions & 6 deletions packages/framework/ini-files/config-specs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ opt-set-cmake-var TPL_ENABLE_Scotch BOOL FORCE : OFF
opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ${NETCDF_C_LIB|ENV}/libnetcdf.so

opt-set-cmake-var Trilinos_ENABLE_Fortran OFF BOOL : OFF
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-label
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare

[rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_all]
use rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
Expand Down Expand Up @@ -1636,7 +1636,7 @@ use SPACK_NETLIB_BLAS_LAPACK
opt-set-cmake-var MPI_EXEC_PRE_NUMPROCS_FLAGS STRING : --bind-to;none --mca btl vader,self
opt-set-cmake-var CMAKE_CXX_EXTENSIONS BOOL : OFF
opt-set-cmake-var Teko_DISABLE_LSCSTABALIZED_TPETRA_ALPAH_INV_D BOOL : ON
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-inline -Wno-nonnull-compare -Wno-address
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare

opt-set-cmake-var TPL_HDF5_LIBRARIES STRING : ${HDF5_LIB|ENV}/libhdf5_hl.so;${HDF5_LIB|ENV}/libhdf5.so;${ZLIB_LIB|ENV}/libz.so;-ldl

Expand Down Expand Up @@ -1672,7 +1672,7 @@ opt-set-cmake-var ROL_example_PDE-OPT_helmholtz_example_02_MPI_1_DISABLE BOOL
opt-set-cmake-var Pliris_vector_random_MPI_3_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_4_DISABLE BOOL : ON

opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

# Test failures as of 11-28-22
opt-set-cmake-var ROL_example_PDE-OPT_navier-stokes_example_01_MPI_4_DISABLE BOOL : ON
Expand Down Expand Up @@ -1766,7 +1766,7 @@ use PACKAGE-ENABLES|NO-PACKAGE-ENABLES
use COMMON_SPACK_TPLS

opt-set-cmake-var MPI_EXEC_PRE_NUMPROCS_FLAGS STRING : --bind-to;none --mca btl vader,self
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

opt-set-cmake-var TPL_ENABLE_SuperLUDist BOOL FORCE : ON
opt-set-cmake-var TPL_ENABLE_ParMETIS BOOL FORCE : ON
Expand Down Expand Up @@ -1814,7 +1814,7 @@ use PACKAGE-ENABLES|NO-PACKAGE-ENABLES

use COMMON_SPACK_TPLS

opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-but-set-variable -Wno-unused-label
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-unused-but-set-variable

opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ""

Expand Down Expand Up @@ -1853,7 +1853,7 @@ opt-set-cmake-var ROL_example_PDE-OPT_helmholtz_example_02_MPI_1_DISABLE BOO
opt-set-cmake-var ROL_example_PDE-OPT_navier-stokes_example_01_MPI_4_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_3_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_4_DISABLE BOOL : ON
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

opt-set-cmake-var TPL_ENABLE_SuperLUDist BOOL FORCE: OFF

Expand Down

0 comments on commit 1209a65

Please sign in to comment.