-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add -fallow-argument-mismatch for GCC 10+ * use compiler flag from config * typo fix
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
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
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,32 @@ | ||
#!/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 reason for adding this flag is because Tapenade 3.16's ADFirstAidKit is not compliant with GCC 10+. | ||
# This should be removed once Tapenade fixes this or removes the ADFirstAidKit. | ||
|
||
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" |