-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Need one argument at least | ||
if [ -z $1 ]; then | ||
echo "$0 needs to be called with the compiler name as an argument"; exit 1 | ||
fi | ||
|
||
# Initialize variables | ||
FF90=$1 | ||
FFLAGS="" | ||
|
||
|
||
# Allow argument mismatch for gfortran >= 10 | ||
|
||
# NOTE: The primary reason for this is that the CGNS library does not provide explicit | ||
# Fortran interface at this time for some of the functions as mentioned | ||
# in the docs https://cgns.github.io/CGNS_docs_current/midlevel/general.html | ||
# and source https://github.com/CGNS/CGNS/blob/develop/src/cgns_f.F90 | ||
# Once CGNS lib supports explicit interface this script should be removed | ||
# and any issues with the code addressed. | ||
|
||
fc=$("$FF90" --version 2>&1 | grep -i 'gnu') | ||
if [ ! -z "$fc" ]; then | ||
# Get the GNU compiler version | ||
version=$("$FF90" -v 2>&1 | grep 'gcc version' | cut -d' ' -f3) | ||
if [ ! -z "$version" ]; then | ||
# Get the major version | ||
version_major=`echo $version | cut -f1 -d.` | ||
fi | ||
|
||
if [ $version_major -ge 10 ]; then | ||
FFLAGS="-fallow-argument-mismatch" | ||
fi | ||
fi | ||
|
||
# Print at end to add to the makefile | ||
echo "$FFLAGS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters