Skip to content

Commit

Permalink
Fix issue with generalized compiler version output using the wrong fl…
Browse files Browse the repository at this point in the history
…ags (#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.
  • Loading branch information
islas authored Apr 2, 2024
1 parent 0b68af0 commit f630b3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f630b3d

Please sign in to comment.