2019-12-09 15:49:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
printf "Running on "
|
|
|
|
case `uname -s` in
|
|
|
|
Linux*) echo "Linux" ;;
|
|
|
|
Darwin*) echo "Mac" ;;
|
|
|
|
[CIGWIN,MINGW]*) echo "Windows" ;;
|
|
|
|
*) echo "unknown OS" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
printf "OS version " && uname -r
|
|
|
|
|
|
|
|
arch=`uname -m`
|
|
|
|
echo "Processor architecture $arch"
|
|
|
|
|
|
|
|
check() {
|
2021-11-19 13:56:31 +01:00
|
|
|
printf "Looking for %s... " $1 && command -v $1 || (echo "not found"; exit 1)
|
2019-12-09 15:49:37 +01:00
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
|
|
|
for FC in ifort gfortran f77; do
|
|
|
|
check $FC && break
|
|
|
|
done
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Fortran compiler not found. Cannot proceed"
|
|
|
|
exit 1
|
|
|
|
else
|
2021-11-19 13:56:31 +01:00
|
|
|
echo "Use $FC as Fortran compiler"
|
2019-12-09 15:49:37 +01:00
|
|
|
fi
|
|
|
|
|
2021-11-19 13:56:31 +01:00
|
|
|
# $FC --version
|