-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_g95
executable file
·30 lines (25 loc) · 1005 Bytes
/
install_g95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Usage: bash install_g95
REPO_NAME="g95"
TMP_DIR="$(mktemp -d)"
G95DIR="$TMP_DIR/$REPO_NAME/g95/"
cd "$TMP_DIR" || exit 42
git clone https://github.com/zaikunzhang/"$REPO_NAME"
cd "$REPO_NAME" || exit 42
unzip g95.zip
rm -f g95.zip
# Make some links
CRT1="$(find /usr/ -type f -name "crt1.o*" -print -quit)"
CRTI="$(find /usr/ -type f -name "crti.o*" -print -quit)"
CRTN="$(find /usr/ -type f -name "crtn.o*" -print -quit)"
ln -s "$CRT1" "$G95DIR/lib/gcc-lib/x86_64-unknown-linux-gnu/4.0.3/"
ln -s "$CRTI" "$G95DIR/lib/gcc-lib/x86_64-unknown-linux-gnu/4.0.3/"
ln -s "$CRTN" "$G95DIR/lib/gcc-lib/x86_64-unknown-linux-gnu/4.0.3/"
# Set environment variable for subsequent steps
echo "PATH=$PATH:$G95DIR/bin:$G95DIR/lib/gcc-lib/x86_64-unknown-linux-gnu/4.0.3" >> "$GITHUB_ENV"
# Show the result of the installation.
export PATH=$PATH:$G95DIR/bin:$G95DIR/lib/gcc-lib/x86_64-unknown-linux-gnu/4.0.3
echo "The g95 installed is:"
g95 --version
echo "The path to g95 is:"
command -v g95