From abc4ac216d56fe013a0783c079ae9e19429bacd9 Mon Sep 17 00:00:00 2001 From: Panagiotis Velissariou Date: Thu, 19 May 2022 22:57:18 -0500 Subject: [PATCH] workaround to compile with gfortran >= 10; argument mismatch errors when compiling with gfortran >= 10 --- model/bin/cmplr.env | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/model/bin/cmplr.env b/model/bin/cmplr.env index dee68b1cb..e7eff9477 100644 --- a/model/bin/cmplr.env +++ b/model/bin/cmplr.env @@ -234,6 +234,8 @@ if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || [ "$cmplr" == "gnu_pr # COMPILER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + _GCC_VER="$(echo $(gcc --version | head -1 | cut -d ' ' -f 3 | cut -d '.' -f 1))" + # Only match `error` and `warn` at beginning of line: err_pattern='^error' warn_pattern='^warn' @@ -252,7 +254,12 @@ if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || [ "$cmplr" == "gnu_pr # OPTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # common options - optc='-c -J$path_m -g -fno-second-underscore -ffree-line-length-none -fconvert=big-endian' + if [ ${_GCC_VER:-0} -ge 10 ] ; then + #optc='-c -J$path_m -p -g -fallow-argument-mismatch -fallow-invalid-boz -fno-second-underscore -ffree-line-length-none -fconvert=big-endian' + optc='-c -J$path_m -p -g -fallow-argument-mismatch -fno-second-underscore -ffree-line-length-none -fconvert=big-endian' + else + optc='-c -J$path_m -p -g -fno-second-underscore -ffree-line-length-none -fconvert=big-endian' + fi optl='-o $prog -g' # omp options