From f630b3d7d12bb703161d0605f85ae3974a03ce24 Mon Sep 17 00:00:00 2001 From: Anthony Islas <128631809+islas@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:56:23 -0700 Subject: [PATCH] Fix issue with generalized compiler version output using the wrong flags (#2030) Fix issue with generalized compiler version output using the wrong flags TYPE: bug fix KEYWORDS: compile, version SOURCE: internal DESCRIPTION OF CHANGES: Problem: A generalized compile version check was proposed in #1987. This logic was implemented in #1942 but the originating logic contains a bug where the `-V` and `--version` flag commands' output is flipped. Solution: Use `-V` in the appropriate spot when `$status` is zero for the `-V` check, and respectively for the `--version` check. LIST OF MODIFIED FILES: M compile TESTS CONDUCTED: 1. With previous bad logic the compile log output shows a compiler error as the wrong flag is used to output version info. With the fix, the correct output now shows in the compile log. --- compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile b/compile index d393dfe36b..e3e2c49b1f 100755 --- a/compile +++ b/compile @@ -410,11 +410,11 @@ else set comp = ( `grep "^SFC" configure.wrf | cut -d"#" -f1 | cut -d"=" -f2-` ) $comp[1] -V >& /dev/null if ( $status == 0 ) then - $comp[1] --version + $comp[1] -V else $comp[1] --version >& /dev/null if ( $status == 0 ) then - $comp[1] -V + $comp[1] --version else echo "Not sure how to figure out the version of this compiler: $comp[1]" endif