forked from heavyai/heavydb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapd-deps-linux.sh
executable file
·294 lines (253 loc) · 9.75 KB
/
mapd-deps-linux.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#!/bin/bash
set -e
set -x
SUFFIX=${SUFFIX:=$(date +%Y%m%d)}
PREFIX=${MAPD_PATH:="/usr/local/mapd-deps/$SUFFIX"}
if [ ! -w $(dirname $PREFIX) ] ; then
SUDO=sudo
fi
$SUDO mkdir -p $PREFIX
$SUDO chown -R $USER $PREFIX
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib64:$PREFIX/lib:$LD_LIBRARY_PATH
download() {
wget --continue "$1"
}
extract() {
tar xvf "$1"
}
makej() {
make -j $(nproc)
}
download_make_install() {
name="$(basename $1)"
download "$1"
extract $name
if [ -z "$2" ]; then
pushd ${name%%.tar*}
else
pushd $2
fi
./configure --prefix=$PREFIX $3
makej
make install
popd
}
# gmp, mpc, mpfr, autoconf, automake
# note: if gmp fails on POWER8:
# wget https://gmplib.org/repo/gmp/raw-rev/4a6d258b467f
# patch -p1 < 4a6d258b467f
# https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
download_make_install https://internal-dependencies.mapd.com/thirdparty/gmp-6.1.2.tar.xz "" "--enable-fat"
# http://www.mpfr.org/mpfr-current/mpfr-3.1.5.tar.xz
download_make_install https://internal-dependencies.mapd.com/thirdparty/mpfr-3.1.5.tar.xz "" "--with-gmp=$PREFIX"
download_make_install ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz "" "--with-gmp=$PREFIX"
download_make_install ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz # "" "--build=powerpc64le-unknown-linux-gnu"
download_make_install ftp://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.xz
# gcc
VERS=4.9.4
download ftp://ftp.gnu.org/gnu/gcc/gcc-$VERS/gcc-$VERS.tar.bz2
extract gcc-$VERS.tar.bz2
pushd gcc-$VERS
export CPPFLAGS="-I$PREFIX/include"
./configure \
--prefix=$PREFIX \
--disable-multilib \
--enable-bootstrap \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--disable-libunwind-exceptions \
--enable-gnu-unique-object \
--enable-languages=c,c++ \
--with-tune=generic \
--with-gmp=$PREFIX \
--with-mpc=$PREFIX \
--with-mpfr=$PREFIX #replace '--with-tune=generic' with '--with-tune=power8' for POWER8
makej
make install
popd
export CC=$PREFIX/bin/gcc
export CXX=$PREFIX/bin/g++
download_make_install ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
# http://zlib.net/zlib-1.2.8.tar.xz
download_make_install https://internal-dependencies.mapd.com/thirdparty/zlib-1.2.8.tar.xz
download http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
extract bzip2-1.0.6.tar.gz
pushd bzip2-1.0.6
makej
make install PREFIX=$PREFIX
popd
CFLAGS="-fPIC" download_make_install ftp://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz # "" "--build=powerpc64le-unknown-linux-gnu"
download_make_install ftp://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.xz # "" "--build=powerpc64le-unknown-linux-gnu"
# https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/flexpp-bisonpp/bisonpp-1.21-45.tar.gz
download_make_install https://internal-dependencies.mapd.com/thirdparty/bisonpp-1.21-45.tar.gz bison++-1.21
CFLAGS="-fPIC" download_make_install ftp://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz
# http://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.bz2
download https://internal-dependencies.mapd.com/thirdparty/boost_1_62_0.tar.bz2
extract boost_1_62_0.tar.bz2
pushd boost_1_62_0
./bootstrap.sh --prefix=$PREFIX
./b2 cxxflags=-fPIC install --prefix=$PREFIX || true
popd
# http://www.cmake.org/files/v3.7/cmake-3.7.2.tar.gz
download_make_install https://internal-dependencies.mapd.com/thirdparty/cmake-3.7.2.tar.gz
# folly
download https://github.com/google/double-conversion/archive/4abe3267170fa52f39460460456990dbae803f4d.tar.gz
extract 4abe3267170fa52f39460460456990dbae803f4d.tar.gz
mv double-conversion-4abe3267170fa52f39460460456990dbae803f4d google-double-conversion-4abe326
mkdir -p google-double-conversion-4abe326/build
pushd google-double-conversion-4abe326/build
cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX ..
makej
make install
popd
download https://github.com/gflags/gflags/archive/v2.2.0.tar.gz
extract v2.2.0.tar.gz
mkdir -p gflags-2.2.0/build
pushd gflags-2.2.0/build
cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX ..
makej
make install
popd
CXXFLAGS="-fPIC" download_make_install https://github.com/google/glog/archive/v0.3.4.tar.gz glog-0.3.4 "--enable-shared=no" # --build=powerpc64le-unknown-linux-gnu"
download_make_install https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
download https://github.com/facebook/folly/archive/v2017.04.10.00.tar.gz
extract v2017.04.10.00.tar.gz
pushd folly-2017.04.10.00/folly
OLDPATH=$PATH
PATH=/usr/bin
/usr/bin/autoreconf -ivf
PATH=$OLDPATH
CXXFLAGS="-fPIC -pthread" ./configure --prefix=$PREFIX --with-boost=$PREFIX --with-boost-libdir=$PREFIX/lib --enable-shared=no
makej
make install
popd
# llvm
download_make_install http://thrysoee.dk/editline/libedit-20160903-3.1.tar.gz
VERS=4.0.0
download http://releases.llvm.org/$VERS/llvm-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/cfe-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/compiler-rt-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/lldb-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/lld-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/libcxx-$VERS.src.tar.xz
download http://releases.llvm.org/$VERS/libcxxabi-$VERS.src.tar.xz
rm -rf llvm-$VERS.src
extract llvm-$VERS.src.tar.xz
extract cfe-$VERS.src.tar.xz
extract compiler-rt-$VERS.src.tar.xz
extract lld-$VERS.src.tar.xz
extract lldb-$VERS.src.tar.xz
extract libcxx-$VERS.src.tar.xz
extract libcxxabi-$VERS.src.tar.xz
mv cfe-$VERS.src llvm-$VERS.src/tools/clang
mv compiler-rt-$VERS.src llvm-$VERS.src/projects/compiler-rt
mv lld-$VERS.src llvm-$VERS.src/tools/lld
mv lldb-$VERS.src llvm-$VERS.src/tools/lldb
mv libcxx-$VERS.src llvm-$VERS.src/projects/libcxx
mv libcxxabi-$VERS.src llvm-$VERS.src/projects/libcxxabi
rm -rf build.llvm-$VERS
mkdir build.llvm-$VERS
pushd build.llvm-$VERS
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DLLVM_ENABLE_RTTI=on ../llvm-$VERS.src
makej
if [ ! -d "lib/python2.7" ]; then
cp -R lib64/python2.7 lib/python2.7
fi
make install
popd
# openssl (probably not a good idea)
#download https://www.openssl.org/source/openssl-1.0.2c.tar.gz
#x openssl-1.0.2c.tar.gz
#pushd openssl-1.0.2c
#./Configure shared --prefix=$PREFIX linux-x86_64
#makej
#make install
#popd
# https://curl.haxx.se/download/curl-7.50.0.tar.bz2
download_make_install https://internal-dependencies.mapd.com/thirdparty/curl-7.50.0.tar.bz2 "" "--disable-ldap --disable-ldaps"
# http://www.cryptopp.com/cryptopp563.zip
download https://internal-dependencies.mapd.com/thirdparty/cryptopp563.zip
unzip -a -d cryptopp563 cryptopp563
pushd cryptopp563
PREFIX=$PREFIX make all shared
PREFIX=$PREFIX make install
popd
# thrift
VERS=0.10.0
download http://apache.claz.org/thrift/$VERS/thrift-$VERS.tar.gz
extract thrift-$VERS.tar.gz
pushd thrift-$VERS
CFLAGS="-fPIC" CXXFLAGS="-fPIC" JAVA_PREFIX=$PREFIX/lib ./configure --prefix=$PREFIX --with-lua=no --with-python=no --with-php=no --with-boost-libdir=$PREFIX/lib
makej
make install
popd
# backend rendering
# https://downloads.sourceforge.net/project/glew/glew/1.13.0/glew-1.13.0.tgz
download https://internal-dependencies.mapd.com/thirdparty/glew-1.13.0.tgz
extract glew-1.13.0.tgz
pushd glew-1.13.0
patch -p1 < ../mapd-deps-glew-egl.patch
make extensions
make DESTDIR=$PREFIX GLEW_DEST=""
make DESTDIR=$PREFIX GLEW_DEST="" install
make DESTDIR=$PREFIX GLEW_DEST="" install.mx
popd
# http://download.sourceforge.net/libpng/libpng-1.6.21.tar.xz
download_make_install https://internal-dependencies.mapd.com/thirdparty/libpng-1.6.21.tar.xz
# c-blosc
VERS=1.11.3
download https://github.com/Blosc/c-blosc/archive/v$VERS.tar.gz
extract v$VERS.tar.gz
BDIR="c-blosc-$VERS/build"
rm -rf "$BDIR"
mkdir -p "$BDIR"
pushd "$BDIR"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_BENCHMARKS=off -DBUILD_TESTS=off -DPREFER_EXTERNAL_SNAPPY=off -DPREFER_EXTERNAL_ZLIB=off -DPREFER_EXTERNAL_ZSTD=off ..
makej
make install
popd
# geo
# https://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2
download_make_install https://internal-dependencies.mapd.com/thirdparty/expat-2.2.0.tar.bz2
# https://github.com/google/libkml/archive/master.zip
download https://internal-dependencies.mapd.com/thirdparty/libkml-master.zip
unzip -u libkml-master.zip
pushd libkml-master
./autogen.sh || true
./configure --with-expat-include-dir=$PREFIX/include/ --with-expat-lib-dir=$PREFIX/lib --prefix=$PREFIX --enable-static --disable-java --disable-python --disable-swig
makej
make install
popd
download_make_install http://download.osgeo.org/proj/proj-4.9.3.tar.gz
download_make_install http://download.osgeo.org/gdal/2.0.3/gdal-2.0.3.tar.xz "" "--without-curl --without-geos --with-libkml=$PREFIX --with-static-proj4=$PREFIX"
# arrow
VERS=0.4.1
download https://github.com/apache/arrow/archive/apache-arrow-$VERS.tar.gz
extract apache-arrow-$VERS.tar.gz
mkdir -p arrow-apache-arrow-$VERS/cpp/build
pushd arrow-apache-arrow-$VERS/cpp/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DARROW_BUILD_SHARED=off \
-DARROW_BUILD_STATIC=on \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DARROW_BOOST_USE_SHARED=off \
-DARROW_JEMALLOC_USE_SHARED=off \
..
makej
make install
popd
# https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
download https://internal-dependencies.mapd.com/thirdparty/go1.8.1.linux-amd64.tar.gz
extract go1.8.1.linux-amd64.tar.gz
mv go $PREFIX
sed -e "s|%MAPD_DEPS_ROOT%|$PREFIX|g" mapd-deps.modulefile.in > mapd-deps-$SUFFIX.modulefile
sed -e "s|%MAPD_DEPS_ROOT%|$PREFIX|g" mapd-deps.sh.in > mapd-deps-$SUFFIX.sh
cp mapd-deps-$SUFFIX.sh mapd-deps-$SUFFIX.modulefile $PREFIX
if [ "$1" = "--compress" ] ; then
tar acvf mapd-deps-$SUFFIX.tar.xz -C $(dirname $PREFIX) $SUFFIX
fi