forked from SHYFEM-model/shyfem
-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
132 additions
and
32 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
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
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,71 @@ | ||
#!/bin/sh | ||
# | ||
#------------------------------------------------------------------------ | ||
# | ||
# Copyright (C) 1985-2018 Georg Umgiesser | ||
# | ||
# This file is part of SHYFEM. | ||
# | ||
#------------------------------------------------------------------------ | ||
# | ||
# returns major version of compilers (gfortran and intel) | ||
# | ||
#----------------------------------------------------------- | ||
|
||
Usage() | ||
{ | ||
echo "Usage: cmv.sh [-info] {gfortran|intel}" | ||
} | ||
|
||
info="NO" | ||
if [ "$1" = "-info" ]; then | ||
info="YES" | ||
shift | ||
fi | ||
|
||
if [ $# -eq 0 ]; then | ||
Usage | ||
exit 1 | ||
fi | ||
|
||
#----------------------------------------------------------- | ||
|
||
version=unknown | ||
mversion=0 | ||
|
||
compiler=$1 | ||
compexe=$compiler | ||
[ $compiler = intel ] && compexe=ifort | ||
|
||
prog=$( which $compexe ) | ||
|
||
if [ -n "$prog" ]; then | ||
if [ $compiler = gfortran ]; then | ||
version=$( $prog -v 2>&1 | tail -1 | cut -d " " -f 3 ) | ||
if [ -n "$version" ]; then | ||
mversion=$( echo $version | sed -e 's/\..*//' ) | ||
fi | ||
elif [ $compiler = intel ]; then | ||
version=$( $prog -v 2>&1 | sed -e 's/.*version *//' ) | ||
if [ -n "$version" ]; then | ||
mversion=$( echo $version | sed -e 's/\..*//' ) | ||
fi | ||
else | ||
echo "compiler not supported: $compiler" | ||
Usage | ||
exit 1 | ||
fi | ||
else | ||
echo "cannot find compiler: $compiler" | ||
Usage | ||
exit 1 | ||
fi | ||
|
||
if [ $info = "YES" ]; then | ||
echo "$compiler version=$version major_version=$mversion" | ||
else | ||
echo "$mversion" | ||
fi | ||
|
||
#----------------------------------------------------------- | ||
|
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
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