Skip to content

Commit

Permalink
Merge pull request #9354 from NREL/fix_kiva_build_errors
Browse files Browse the repository at this point in the history
Fix #9353 - Kiva build error on mac with clang >= 13
  • Loading branch information
Myoldmopar authored Mar 29, 2022
2 parents fa02272 + b6b5e93 commit ed759b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
target_compile_options(project_warnings INTERFACE -Wno-delete-non-virtual-dtor)
target_compile_options(project_warnings INTERFACE -Wno-missing-braces)
if(CMAKE_COMPILER_IS_GNUCXX) # g++
target_compile_options(project_warnings INTERFACE -Wno-unused-but-set-parameter -Wno-unused-but-set-variable)
# Suppress unused-but-set warnings until more serious ones are addressed
target_compile_options(project_warnings INTERFACE -Wno-unused-but-set-parameter -Wno-unused-but-set-variable)
target_compile_options(project_warnings INTERFACE -Wno-maybe-uninitialized)
target_compile_options(project_warnings INTERFACE -Wno-aggressive-loop-optimizations)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
# Suppress unused-but-set warnings until more serious ones are addressed
target_compile_options(project_warnings INTERFACE -Wno-unused-but-set-parameter -Wno-unused-but-set-variable)
endif()
target_compile_options(project_warnings INTERFACE -Wno-vexing-parse)
target_compile_options(project_warnings INTERFACE -Wno-invalid-source-encoding)
endif()
Expand Down
5 changes: 3 additions & 2 deletions third_party/kiva-ep/src/libkiva/Ground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ void Ground::calculateSurfaceAverages() {
}

double totalQ = 0.0;
double totalQc = 0.0, totalQr = 0.0;
double totalQc = 0.0;
// double totalQr = 0.0;
double TA = 0;
double hA = 0.0, hcA = 0.0, hrA = 0.0;
double totalArea = 0.0;
Expand Down Expand Up @@ -368,7 +369,7 @@ void Ground::calculateSurfaceAverages() {
hA += Ahc + Ahr;

totalQc += Qc;
totalQr += Qr;
// totalQr += Qr;
totalQ += Qc + Qr + q * A;

TA += TNew[index] * A;
Expand Down
1 change: 1 addition & 0 deletions third_party/kiva-ep/src/libkiva/Ground.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#pragma clang diagnostic push
#if __clang_major__ >= 13
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#elif defined(__GNUC__) && defined(__linux__)
#pragma GCC diagnostic push
Expand Down

4 comments on commit ed759b1

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2508 of 2508 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2486 of 2486 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1744 of 1744 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (746 of 746 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.