Skip to content

Commit

Permalink
make some flags conditional, add conversion flags from Jeknins tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 committed May 16, 2024
1 parent 9165c51 commit c87410c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 12 additions & 2 deletions cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,18 @@ endif()
if(ENABLE_ALL_WARNINGS)
message(STATUS "Enabling all compiler warnings")

set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wmissing-declarations -Wcast-qual -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wmissing-declarations -Wcast-qual -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}")
if(SUNDIALS_PRECISION MATCHES "EXTENDED")
set(CMAKE_C_FLAGS "-Wdouble-promotion ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wdouble-promotion ${CMAKE_CXX_FLAGS}")
endif()

if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32"))
set(CMAKE_C_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_CXX_FLAGS}")
endif()

set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wmissing-declarations -Wcast-qual -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wmissing-declarations -Wcast-qual -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}")
set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}")
endif()

Expand Down
5 changes: 0 additions & 5 deletions test/env/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ if [ "$compilername" == "gcc" ]; then
export CUDAFLAGS="-g -O3"
fi

# append additional warning flags
if [[ "$SUNDIALS_PRECISION" == "double" && "$SUNDIALS_INDEX_SIZE" == "32" ]]; then
export CFLAGS="${CFLAGS} -Wconversion -Wno-sign-conversion"
export CXXFLAGS="${CXXFLAGS} -Wconversion -Wno-sign-conversion"
fi
# TODO(CJB): add this back after we upgrade the GNU compiler stack on the Jenkins box
# Currently this causes the compiler to segfault on many of the Fortran example codes.
# export FFLAGS="${FFLAGS} -fbounds-check"
Expand Down

0 comments on commit c87410c

Please sign in to comment.