forked from heavyai/heavydb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapd-deps-ubuntu1604.sh
216 lines (185 loc) · 4.87 KB
/
mapd-deps-ubuntu1604.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
#!/usr/bin/env bash
set -e
set -x
SUFFIX=${SUFFIX:=$(date +%Y%m%d)}
PREFIX=/usr/local/mapd-deps
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPTS_DIR/common-functions.sh
source /etc/os-release
sudo mkdir -p $PREFIX
sudo chown -R $(id -u) $PREFIX
sudo apt update
sudo apt install -y \
software-properties-common \
build-essential \
libtool \
ccache \
git \
wget \
curl \
libgoogle-glog-dev \
libssl-dev \
libevent-dev \
default-jre \
default-jre-headless \
default-jdk \
default-jdk-headless \
maven \
libncurses5-dev \
libldap2-dev \
binutils-dev \
google-perftools \
libdouble-conversion-dev \
libevent-dev \
libgflags-dev \
libgoogle-perftools-dev \
libiberty-dev \
libjemalloc-dev \
libglu1-mesa-dev \
liblz4-dev \
liblzma-dev \
libbz2-dev \
libarchive-dev \
libcurl4-openssl-dev \
libedit-dev \
uuid-dev \
libsnappy-dev \
zlib1g-dev \
autoconf \
autoconf-archive \
automake \
bison \
flex \
libpng-dev \
rsync \
unzip \
jq \
python-dev \
python-yaml \
pkg-config \
swig
# Install gcc 8
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install -y g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --config gcc
# Needed to find sqlite3, xmltooling, and xml_security_c
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/lib64/pkgconfig:$PKG_CONFIG_PATH
export PATH=$PREFIX/bin:$PATH
install_ninja
install_cmake
# Geo Support
install_gdal
VERS=1_72_0
# http://downloads.sourceforge.net/project/boost/boost/${VERS//_/.}/boost_$VERS.tar.bz2
download ${HTTP_DEPS}/boost_$VERS.tar.bz2
extract boost_$VERS.tar.bz2
pushd boost_$VERS
./bootstrap.sh --prefix=$PREFIX
./b2 cxxflags=-fPIC install --prefix=$PREFIX || true
popd
# Needed for folly to find boost
export LIBRARY_PATH=$PREFIX/lib:$LIBRARY_PATH
# llvm
# (see common-functions.sh)
install_llvm
# install AWS core and s3 sdk
install_awscpp -j $(nproc)
VERS=0.13.0
wget --continue http://apache.claz.org/thrift/$VERS/thrift-$VERS.tar.gz
tar xvf thrift-$VERS.tar.gz
pushd thrift-$VERS
CFLAGS="-fPIC" CXXFLAGS="-fPIC" JAVA_PREFIX=$PREFIX/lib ./configure \
--with-lua=no \
--with-python=no \
--with-php=no \
--with-ruby=no \
--with-qt4=no \
--with-qt5=no \
--with-java=no \
--prefix=$PREFIX \
--with-boost=$PREFIX
make -j $(nproc)
make install
popd
# c-blosc
VERS=1.14.4
wget --continue https://github.com/Blosc/c-blosc/archive/v$VERS.tar.gz
tar xvf 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 \
..
make -j $(nproc)
make install
popd
VERS=2019.04.29.00
download https://github.com/facebook/folly/archive/v$VERS.tar.gz
extract v$VERS.tar.gz
pushd folly-$VERS/build/
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX ..
makej
make install
popd
download_make_install ${HTTP_DEPS}/bisonpp-1.21-45.tar.gz bison++-1.21
# TBB
install_tbb
# Apache Arrow (see common-functions.sh)
ARROW_BOOST_USE_SHARED="ON"
install_arrow
# Go
install_go
# librdkafka
install_rdkafka
VERS=3.0.2
wget --continue https://github.com/cginternals/glbinding/archive/v$VERS.tar.gz
tar xvf v$VERS.tar.gz
mkdir -p glbinding-$VERS/build
pushd glbinding-$VERS/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DOPTION_BUILD_DOCS=OFF \
-DOPTION_BUILD_EXAMPLES=OFF \
-DOPTION_BUILD_TESTS=OFF \
-DOPTION_BUILD_TOOLS=OFF \
-DOPTION_BUILD_WITH_BOOST_THREAD=OFF \
..
make -j $(nproc)
make install
popd
# OpenSAML
VERS=3.2.2
download_make_install ${HTTP_DEPS}/xerces-c-3.2.2.tar.gz
download_make_install ${HTTP_DEPS}/xml-security-c-2.0.2.tar.gz "" "--without-xalan"
download_make_install ${HTTP_DEPS}/xmltooling-3.0.4-nolog4shib.tar.gz "" "--with-boost=$PREFIX"
download_make_install ${HTTP_DEPS}/opensaml-3.0.1-nolog4shib.tar.gz "" "--with-boost=$PREFIX"
cat > $PREFIX/mapd-deps.sh <<EOF
PREFIX=$PREFIX
LD_LIBRARY_PATH=/usr/local/cuda/lib64:\$LD_LIBRARY_PATH
LD_LIBRARY_PATH=\$PREFIX/lib:\$LD_LIBRARY_PATH
LD_LIBRARY_PATH=\$PREFIX/lib64:\$LD_LIBRARY_PATH
PATH=/usr/local/cuda/bin:\$PATH
PATH=\$PREFIX/go/bin:\$PATH
PATH=\$PREFIX/bin:\$PATH
CMAKE_PREFIX_PATH=\$PREFIX:\$CMAKE_PREFIX_PATH
GOROOT=\$PREFIX/go
export LD_LIBRARY_PATH PATH CMAKE_PREFIX_PATH GOROOT
EOF
echo
echo "Done. Be sure to source the 'mapd-deps.sh' file to pick up the required environment variables:"
echo " source $PREFIX/mapd-deps.sh"
if [ "$1" = "--compress" ] ; then
tar acf mapd-deps-ubuntu-$VERSION_ID-$SUFFIX.tar.xz -C $PREFIX .
fi