12
12
# # g++ manually.
13
13
# #
14
14
# # Supported environments:
15
- # # * Ubuntu (14.04, 16.04)
16
- # # * Fedora
17
- # # * OSX
15
+ # # * Ubuntu (14.04, 16.04, 18.04)
16
+ # # * macOS
17
+ # #
18
+ # # Update (2018-06-08):
19
+ # # We are no longer able to support RedHat/Fedora because those
20
+ # # environments are not supported by TensorFlow.
18
21
# # =================================================================
19
22
20
23
set -o errexit
@@ -44,6 +47,9 @@ TF_TYPE="cpu"
44
47
function install_protobuf3.4.0() {
45
48
# Install Relevant tooling
46
49
# Remove any old versions of protobuf
50
+ # Note: Protobuf 3.5+ PPA available Ubuntu Bionic(18.04) onwards - Should be used
51
+ # when we retire 16.04 too: https://launchpad.net/~maarten-fonville/+archive/ubuntu/protobuf
52
+ # This PPA unfortunately doesnt have Protobuf 3.5 for 16.04, but does for 14.04/18.04+
47
53
DISTRIB=$1 # ubuntu/fedora
48
54
if [ " $DISTRIB " == " ubuntu" ]; then
49
55
sudo apt-get --yes --force-yes remove --purge libprotobuf-dev protobuf-compiler
@@ -60,7 +66,7 @@ function install_protobuf3.4.0() {
60
66
wget -O protobuf-cpp-3.4.0.tar.gz https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-cpp-3.4.0.tar.gz
61
67
tar -xzf protobuf-cpp-3.4.0.tar.gz
62
68
cd protobuf-3.4.0
63
- ./autogen.sh && ./configure && make -j4 && sudo make install && sudo ldconfig
69
+ ./autogen.sh && ./configure && make -j4 && sudo make install && sudo ldconfig || exit 1
64
70
cd ..
65
71
# Cleanup
66
72
rm -rf protobuf-3.4.0 protobuf-cpp-3.4.0.tar.gz
@@ -106,6 +112,10 @@ if [ "$DISTRO" = "UBUNTU" ]; then
106
112
LLVM_PKG_URL=" http://apt.llvm.org/artful/"
107
113
LLVM_PKG_TARGET=" llvm-toolchain-artful main"
108
114
fi
115
+ if [ " $MAJOR_VER " == " 18" ]; then
116
+ LLVM_PKG_URL=" http://apt.llvm.org/bionic/"
117
+ LLVM_PKG_TARGET=" llvm-toolchain-bionic main"
118
+ fi
109
119
110
120
if ! grep -q " deb $LLVM_PKG_URL $LLVM_PKG_TARGET " /etc/apt/sources.list; then
111
121
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
@@ -138,6 +148,12 @@ if [ "$DISTRO" = "UBUNTU" ]; then
138
148
PKG_CLANG=" clang-3.8"
139
149
TF_VERSION=" 1.5.0"
140
150
fi
151
+ # Fix for llvm on Ubuntu 18.x
152
+ if [ " $MAJOR_VER " == " 18" ]; then
153
+ PKG_LLVM=" llvm-3.9"
154
+ PKG_CLANG=" clang-3.9"
155
+ TF_VERSION=" 1.5.0"
156
+ fi
141
157
TFCApiFile=" libtensorflow-${TF_TYPE} -linux-x86_64-${TF_VERSION} .tar.gz"
142
158
LinkerConfigCmd=" sudo ldconfig"
143
159
sudo apt-get -q $FORCE_Y --ignore-missing -y install \
@@ -170,159 +186,15 @@ if [ "$DISTRO" = "UBUNTU" ]; then
170
186
g++ \
171
187
libeigen3-dev \
172
188
ant \
173
- unzip
189
+ unzip \
190
+ zlib1g-dev
174
191
# Install version of protobuf needed by C-API
175
192
install_protobuf3.4.0 " ubuntu"
176
193
# Install tensorflow
177
194
install_tf " $TFCApiFile " " $TF_VERSION " " $LinkerConfigCmd "
178
195
179
196
# # ------------------------------------------------
180
- # # DEBIAN
181
- # # ------------------------------------------------
182
- elif [ " $DISTRO " = " DEBIAN OS" ]; then
183
- sudo apt-get -q --ignore-missing -y install \
184
- git \
185
- g++ \
186
- clang \
187
- cmake \
188
- libgflags-dev \
189
- libprotobuf-dev \
190
- protobuf-compiler \
191
- bison \
192
- flex \
193
- libevent-dev \
194
- libboost-dev \
195
- libboost-thread-dev \
196
- libboost-filesystem-dev \
197
- libjemalloc-dev \
198
- libssl-dev \
199
- valgrind \
200
- lcov \
201
- libpqxx-dev \
202
- llvm-dev \
203
- libedit-dev \
204
- postgresql-client \
205
- libtbb-dev \
206
- libeigen3-dev
207
-
208
- # # ------------------------------------------------
209
- # # FEDORA
210
- # # ------------------------------------------------
211
- elif [[ " $DISTRO " == * " FEDORA" * ]]; then
212
- case $DISTRO_VER in
213
- 26) LLVM=" llvm" ;;
214
- * ) LLVM=" llvm4.0" ;;
215
- esac
216
- TF_VERSION=" 1.5.0"
217
- TFCApiFile=" libtensorflow-${TF_TYPE} -linux-x86_64-${TF_VERSION} .tar.gz"
218
- LinkerConfigCmd=" sudo ldconfig"
219
- sudo dnf -q install -y \
220
- git \
221
- gcc-c++ \
222
- make \
223
- cmake \
224
- gflags-devel \
225
- bison \
226
- flex \
227
- libevent-devel \
228
- openssl-devel \
229
- boost-devel \
230
- jemalloc-devel \
231
- valgrind \
232
- lcov \
233
- libpqxx-devel \
234
- libpqxx \
235
- ${LLVM} \
236
- ${LLVM} -devel \
237
- ${LLVM} -static \
238
- libedit-devel \
239
- postgresql \
240
- libasan \
241
- libtsan \
242
- libubsan \
243
- libatomic \
244
- tbb-devel \
245
- python3-pip \
246
- curl \
247
- autoconf \
248
- automake \
249
- libtool
250
- # Install version of protobuf needed by C-API
251
- install_protobuf3.4.0 " fedora"
252
- # Install tensorflow
253
- install_tf " $TFCApiFile " " $TF_VERSION " " $LinkerConfigCmd "
254
-
255
- # # ------------------------------------------------
256
- # # REDHAT
257
- # # ------------------------------------------------
258
- elif [[ " $DISTRO " == * " REDHAT" * ]] && [[ " ${DISTRO_VER% .* } " == " 7" ]]; then
259
- function install_package() {
260
- if [ " $# " -lt 1 ]; then
261
- echo " The download path is required."
262
- exit 1
263
- fi
264
-
265
- pushd $TMPDIR
266
- wget -nc --no-check-certificate " $1 "
267
- tpath=$( basename " $1 " )
268
- dpath=$( tar --exclude=' */*' -tf " $tpath " )
269
- tar xzf $tpath
270
- pushd $dpath
271
- if [ -e " bootstrap.sh" ]; then
272
- ./bootstrap.sh
273
- sudo ./b2 install
274
- else
275
- ./configure
276
- make
277
- sudo make install
278
- fi
279
- popd ; popd
280
- return 0
281
- }
282
-
283
- # Package download paths
284
- PKGS=(
285
- " https://github.com/schuhschuh/gflags/archive/v2.0.tar.gz"
286
- )
287
- # Add EPEL repository first
288
- sudo yum -q -y install epel-release
289
- sudo yum -q -y upgrade epel-release
290
-
291
- # Simple installations via yum
292
- sudo yum -q -y install \
293
- git \
294
- gcc-c++ \
295
- make \
296
- cmake3 \
297
- flex \
298
- bison \
299
- libevent-devel \
300
- openssl-devel \
301
- boost-devel \
302
- protobuf-devel \
303
- jemalloc-devel \
304
- libedit-devel \
305
- valgrind \
306
- lcov \
307
- m4 \
308
- doxygen \
309
- graphviz \
310
- libpqxx \
311
- libpqxx-devel \
312
- llvm3.9 \
313
- llvm3.9-static \
314
- llvm3.9-devel \
315
- postgresql \
316
- libtbb-dev
317
-
318
- # Manually download some packages to guarantee
319
- # version compatibility
320
- for pkg_path in ${PKGS[@]} ; do
321
- install_package $pkg_path
322
- done
323
-
324
- # # ------------------------------------------------
325
- # # DARWIN (OSX)
197
+ # # DARWIN (macOS)
326
198
# # ------------------------------------------------
327
199
elif [ " $DISTRO " = " DARWIN" ]; then
328
200
set +o errexit
@@ -362,7 +234,7 @@ elif [ "$DISTRO" = "DARWIN" ]; then
362
234
# # UNKNOWN
363
235
# # ------------------------------------------------
364
236
else
365
- echo " Unknown distribution '$DISTRO '"
237
+ echo " Unsupported distribution '$DISTRO '"
366
238
echo " Please contact our support team for additional help." \
367
239
" Be sure to include the contents of this message"
368
240
echo " Platform: $( uname -a) "
0 commit comments