Files
runner-images-temp/images/linux/scripts/installers/gfortran.sh
T

39 lines
904 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-02-04 17:14:16 +03:00
################################################################################
## File: gfortran.sh
## Desc: Installs GNU Fortran
################################################################################
2020-11-25 11:13:17 +04:00
source $HELPER_SCRIPTS/os.sh
2020-02-04 17:14:16 +03:00
function InstallFortran {
version=$1
echo "Installing $version..."
apt-get install $version -y
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v $version; then
echo "$version was not installed"
exit 1
fi
}
# Install GNU Fortran compiler
2020-02-05 14:08:16 +03:00
add-apt-repository ppa:ubuntu-toolchain-r/test -y
2020-02-04 17:14:16 +03:00
apt-get update -y
versions=(
"gfortran-8"
"gfortran-9"
)
2020-11-25 11:13:17 +04:00
if ! isUbuntu16; then
versions+=("gfortran-10")
fi
2020-02-04 17:14:16 +03:00
for version in ${versions[*]}
do
InstallFortran $version
done