-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
install4cmake.sh
executable file
·82 lines (73 loc) · 2.31 KB
/
install4cmake.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# make sure cmake is installed
cmake --version
if [ $? -ne 0 ]; then
echo "[ERROR] Please install cmake first."
echo "[ubuntu] apt-get -y install cmake or [centos] yum -y install cmake or [mac] brew install cmake"
exit 1
fi
unzip -v
if [ $? -ne 0 ]; then
echo "[ERROR] Please install unzip first."
echo "[ubuntu] sudo apt-get -y install curl zip unzip tar or [centos] yum -y install unzip or [mac] brew install unzip"
exit 1
fi
automake --version
if [ $? -ne 0 ]; then
echo "[ERROR] Please install automake first."
echo "[ubuntu] sudo apt-get -y install automake or [centos] yum -y install automake or [mac] brew install automake"
exit 1
fi
if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
DISTRO='CentOS'
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
DISTRO='Ubuntu'
else
DISTRO='unknow'
fi
sysOS=`uname -s`
if [ $sysOS == "Darwin" ];then
gcc --version
if [ $? -ne 0 ]; then
echo "[ERROR] Please install gcc first."
echo "[mac] brew install gcc"
#exit 1
fi
elif [ $sysOS == "Linux" ];then
if [ $DISTRO == "Ubuntu" ]; then
g++ --version
if [ $? -ne 0 ]; then
echo "[ERROR] Please install g++ first."
echo "[Ubuntu] sudo apt-get -y install g++"
exit 1
fi
elif [ $DISTRO == "CentOS" ]; then
g++ --version
if [ $? -ne 0 ]; then
echo "[ERROR] Install g++ first, minimum version is 7.0.0"
echo "[CentOS Step 1] yum install centos-release-scl -y"
echo "[CentOS Step 2] yum install devtoolset-7 -y"
echo "[CentOS Step 3] scl enable devtoolset-7 bash"
exit 1
fi
currentver="$(gcc -dumpfullversion -dumpversion)"
requiredver="7.0.0"
if [ ! "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo "[ERROR] Upgrate g++ first, minimum version is 7.0.0"
echo "[CentOS Step 1] yum install centos-release-scl -y"
echo "[CentOS Step 2] yum install devtoolset-7 -y"
echo "[CentOS Step 3] scl enable devtoolset-7 bash"
exit 1
fi
fi
fi
#g++ sudo apt-get -y install g++
#unzip sudo apt-get -y install unzip
#compile dep libraries
rm -rf ./_Out/Debug
rm -rf ./_Out/Release
cd ./Dependencies
chmod -R 755 build_dep.sh
./build_dep.sh
cd ../
./buildServer.sh
#pwd