@@ -41,10 +41,21 @@ TMPDIR=/tmp
41
41
# # UBUNTU
42
42
# # ------------------------------------------------
43
43
if [ " $DISTRO " = " UBUNTU" ]; then
44
- # Fix for LLVM-3.7 on Ubuntu 14.04
45
- if [ " $DISTRO_VER " == " 14.04" ]; then
46
- if ! grep -q ' deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' /etc/apt/sources.list; then
47
- echo ' deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list > /dev/null
44
+ MAJOR_VER=$( echo " $DISTRO_VER " | cut -d ' .' -f 1)
45
+
46
+ # Fix for LLVM-3.7 on Ubuntu 14 + 17
47
+ if [ " $MAJOR_VER " == " 14" -o " $MAJOR_VER " == " 17" ]; then
48
+ if [ " $MAJOR_VER " == " 14" ]; then
49
+ LLVM_PKG_URL=" http://llvm.org/apt/trusty/"
50
+ LLVM_PKG_TARGET=" llvm-toolchain-trusty-3.7 main"
51
+ fi
52
+ if [ " $MAJOR_VER " == " 17" ]; then
53
+ LLVM_PKG_URL=" http://apt.llvm.org/artful/"
54
+ LLVM_PKG_TARGET=" llvm-toolchain-artful main"
55
+ fi
56
+
57
+ if ! grep -q " deb $LLVM_PKG_URL $LLVM_PKG_TARGET " /etc/apt/sources.list; then
58
+ echo -e " \n# Added by Peloton 'packages.sh' script on $( date) \ndeb $LLVM_PKG_URL $LLVM_PKG_TARGET " | sudo tee -a /etc/apt/sources.list > /dev/null
48
59
fi
49
60
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
50
61
sudo apt-get update -qq
@@ -55,11 +66,28 @@ if [ "$DISTRO" = "UBUNTU" ]; then
55
66
FORCE_Y=" "
56
67
fi
57
68
69
+ FORCE_Y=" "
70
+ PKG_CMAKE=" cmake"
71
+ PKG_LLVM=" llvm-3.7"
72
+ PKG_CLANG=" clang-3.7"
73
+
74
+ # Fix for cmake name change on Ubuntu 14.x and 16.x plus --force-yes deprecation
75
+ if [ " $MAJOR_VER " == " 14" ]; then
76
+ PKG_CMAKE=" cmake3"
77
+ FORCE_Y=" --force-yes"
78
+ fi
79
+ # Fix for llvm on Ubuntu 17.x
80
+ if [ " $MAJOR_VER " == " 17" ]; then
81
+ PKG_LLVM=" llvm-3.9"
82
+ PKG_CLANG=" clang-3.8"
83
+ fi
84
+
58
85
sudo apt-get -qq $FORCE_Y --ignore-missing -y install \
86
+ $PKG_CMAKE \
87
+ $PKG_LLVM \
88
+ $PKG_CLANG \
59
89
git \
60
90
g++ \
61
- clang-3.7 \
62
- $CMAKE_NAME \
63
91
libgflags-dev \
64
92
libprotobuf-dev \
65
93
protobuf-compiler \
@@ -73,7 +101,6 @@ if [ "$DISTRO" = "UBUNTU" ]; then
73
101
valgrind \
74
102
lcov \
75
103
libpqxx-dev \
76
- llvm-3.7 \
77
104
libedit-dev \
78
105
postgresql-client
79
106
0 commit comments