-
Notifications
You must be signed in to change notification settings - Fork 80
/
zzgcc.sh
executable file
·34 lines (26 loc) · 923 Bytes
/
zzgcc.sh
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
31
32
33
34
#!/bin/bash
# install gcc
set -e
ROOTDIR=${ZZROOT:-$HOME/app}
NAME="gcc"
TYPE=".tar.gz"
FILE="$NAME$TYPE"
DOWNLOADURL="http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.5.0/gcc-7.5.0.tar.gz"
echo $NAME will be installed in "$ROOTDIR"
echo CUDA 10 support up to gcc 7, CUDA 9 support up to gcc 5.
echo Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
mkdir -p "$ROOTDIR/downloads"
cd "$ROOTDIR"
if [ -f "downloads/$FILE" ]; then
echo "downloads/$FILE exist"
else
echo "$FILE does not exist, downloading from $DOWNLOADURL"
wget $DOWNLOADURL -O $FILE
mv $FILE downloads/
fi
mkdir -p src/$NAME
tar xf downloads/$FILE -C src/$NAME --strip-components 1
cd src/$NAME
./configure --prefix="$ROOTDIR" --with-gmp="$ROOTDIR" --with-mpfr="$ROOTDIR" --with-mpc="$ROOTDIR" --disable-multilib --enable-languages=c,c++,fortran
make -j"$(nproc)" && make install
echo $NAME installed on "$ROOTDIR"