@@ -36,6 +36,8 @@ export CFLAGS=${CXXFLAGS//"-std=c++17"/} # Used by LZO.
36
36
CMAKE_BUILD_TYPE=" ${BUILD_TYPE:- Release} "
37
37
BUILD_DUCKDB=" ${BUILD_DUCKDB:- true} "
38
38
USE_CLANG=" ${USE_CLANG:- false} "
39
+ export INSTALL_PREFIX=${INSTALL_PREFIX:- " /usr/local" }
40
+ DEPENDENCY_DIR=${DEPENDENCY_DIR:- $(pwd)/ deps-download}
39
41
40
42
FB_OS_VERSION=" v2024.05.20.00"
41
43
FMT_VERSION=" 10.1.1"
@@ -85,19 +87,19 @@ function install_gflags {
85
87
# Remove an older version if present.
86
88
dnf remove -y gflags
87
89
wget_and_untar https://github.com/gflags/gflags/archive/v2.2.2.tar.gz gflags
88
- cmake_install gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
90
+ cmake_install_dir gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
89
91
}
90
92
91
93
function install_glog {
92
94
wget_and_untar https://github.com/google/glog/archive/v0.6.0.tar.gz glog
93
- cmake_install glog -DBUILD_SHARED_LIBS=ON
95
+ cmake_install_dir glog -DBUILD_SHARED_LIBS=ON
94
96
}
95
97
96
98
function install_lzo {
97
99
wget_and_untar http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz lzo
98
100
(
99
- cd lzo
100
- ./configure --prefix=/usr --enable-shared --disable-static --docdir=/usr/share/doc/lzo-2.10
101
+ cd ${DEPENDENCY_DIR} / lzo
102
+ ./configure --prefix=${INSTALL_PREFIX} --enable-shared --disable-static --docdir=/usr/share/doc/lzo-2.10
101
103
make " -j$( nproc) "
102
104
make install
103
105
)
@@ -106,36 +108,36 @@ function install_lzo {
106
108
function install_boost {
107
109
wget_and_untar https://github.com/boostorg/boost/releases/download/${BOOST_VERSION} /${BOOST_VERSION} .tar.gz boost
108
110
(
109
- cd boost
111
+ cd ${DEPENDENCY_DIR} / boost
110
112
if [[ ${USE_CLANG} != " false" ]]; then
111
- ./bootstrap.sh --prefix=/usr/local --with-toolset=" clang-15"
113
+ ./bootstrap.sh --prefix=${INSTALL_PREFIX} --with-toolset=" clang-15"
112
114
# Switch the compiler from the clang-15 toolset which doesn't exist (clang-15.jam) to
113
115
# clang of version 15 when toolset clang-15 is used.
114
116
# This reconciles the project-config.jam generation with what the b2 build system allows for customization.
115
117
sed -i ' s/using clang-15/using clang : 15/g' project-config.jam
116
118
${SUDO} ./b2 " -j$( nproc) " -d0 install threading=multi toolset=clang-15 --without-python
117
119
else
118
- ./bootstrap.sh --prefix=/usr/local
120
+ ./bootstrap.sh --prefix=${INSTALL_PREFIX}
119
121
${SUDO} ./b2 " -j$( nproc) " -d0 install threading=multi --without-python
120
122
fi
121
123
)
122
124
}
123
125
124
126
function install_snappy {
125
127
wget_and_untar https://github.com/google/snappy/archive/1.1.8.tar.gz snappy
126
- cmake_install snappy -DSNAPPY_BUILD_TESTS=OFF
128
+ cmake_install_dir snappy -DSNAPPY_BUILD_TESTS=OFF
127
129
}
128
130
129
131
function install_fmt {
130
132
wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION} .tar.gz fmt
131
- cmake_install fmt -DFMT_TEST=OFF
133
+ cmake_install_dir fmt -DFMT_TEST=OFF
132
134
}
133
135
134
136
function install_protobuf {
135
137
wget_and_untar https://github.com/protocolbuffers/protobuf/releases/download/v21.8/protobuf-all-21.8.tar.gz protobuf
136
138
(
137
- cd protobuf
138
- ./configure --prefix=/usr
139
+ cd ${DEPENDENCY_DIR} / protobuf
140
+ ./configure --prefix=${INSTALL_PREFIX}
139
141
make " -j${NPROC} "
140
142
make install
141
143
ldconfig
@@ -144,61 +146,60 @@ function install_protobuf {
144
146
145
147
function install_fizz {
146
148
wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION} .tar.gz fizz
147
- cmake_install fizz/fizz -DBUILD_TESTS=OFF
149
+ cmake_install_dir fizz/fizz -DBUILD_TESTS=OFF
148
150
}
149
151
150
152
function install_folly {
151
153
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION} .tar.gz folly
152
- cmake_install folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
154
+ cmake_install_dir folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
153
155
}
154
156
155
157
function install_wangle {
156
158
wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION} .tar.gz wangle
157
- cmake_install wangle/wangle -DBUILD_TESTS=OFF
159
+ cmake_install_dir wangle/wangle -DBUILD_TESTS=OFF
158
160
}
159
161
160
162
function install_fbthrift {
161
163
wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION} .tar.gz fbthrift
162
- cmake_install fbthrift -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
164
+ cmake_install_dir fbthrift -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
163
165
}
164
166
165
167
function install_mvfst {
166
168
wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION} .tar.gz mvfst
167
- cmake_install mvfst -DBUILD_TESTS=OFF
169
+ cmake_install_dir mvfst -DBUILD_TESTS=OFF
168
170
}
169
171
170
172
function install_duckdb {
171
173
if $BUILD_DUCKDB ; then
172
174
echo ' Building DuckDB'
173
175
wget_and_untar https://github.com/duckdb/duckdb/archive/refs/tags/v0.8.1.tar.gz duckdb
174
- cmake_install duckdb -DBUILD_UNITTESTS=OFF -DENABLE_SANITIZER=OFF -DENABLE_UBSAN=OFF -DBUILD_SHELL=OFF -DEXPORT_DLL_SYMBOLS=OFF -DCMAKE_BUILD_TYPE=Release
176
+ cmake_install_dir duckdb -DBUILD_UNITTESTS=OFF -DENABLE_SANITIZER=OFF -DENABLE_UBSAN=OFF -DBUILD_SHELL=OFF -DEXPORT_DLL_SYMBOLS=OFF -DCMAKE_BUILD_TYPE=Release
175
177
fi
176
178
}
177
179
178
180
function install_arrow {
179
181
wget_and_untar https://archive.apache.org/dist/arrow/arrow-${ARROW_VERSION} /apache-arrow-${ARROW_VERSION} .tar.gz arrow
180
- (
181
- cd arrow/cpp
182
- cmake_install \
183
- -DARROW_PARQUET=OFF \
184
- -DARROW_WITH_THRIFT=ON \
185
- -DARROW_WITH_LZ4=ON \
186
- -DARROW_WITH_SNAPPY=ON \
187
- -DARROW_WITH_ZLIB=ON \
188
- -DARROW_WITH_ZSTD=ON \
189
- -DARROW_JEMALLOC=OFF \
190
- -DARROW_SIMD_LEVEL=NONE \
191
- -DARROW_RUNTIME_SIMD_LEVEL=NONE \
192
- -DARROW_WITH_UTF8PROC=OFF \
193
- -DARROW_TESTING=ON \
194
- -DCMAKE_INSTALL_PREFIX=/usr/local \
195
- -DCMAKE_BUILD_TYPE=Release \
196
- -DARROW_BUILD_STATIC=ON \
197
- -DThrift_SOURCE=BUNDLED
182
+ cmake_install_dir arrow/cpp \
183
+ -DARROW_PARQUET=OFF \
184
+ -DARROW_WITH_THRIFT=ON \
185
+ -DARROW_WITH_LZ4=ON \
186
+ -DARROW_WITH_SNAPPY=ON \
187
+ -DARROW_WITH_ZLIB=ON \
188
+ -DARROW_WITH_ZSTD=ON \
189
+ -DARROW_JEMALLOC=OFF \
190
+ -DARROW_SIMD_LEVEL=NONE \
191
+ -DARROW_RUNTIME_SIMD_LEVEL=NONE \
192
+ -DARROW_WITH_UTF8PROC=OFF \
193
+ -DARROW_TESTING=ON \
194
+ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
195
+ -DCMAKE_BUILD_TYPE=Release \
196
+ -DARROW_BUILD_STATIC=ON \
197
+ -DThrift_SOURCE=BUNDLED
198
198
199
+ (
199
200
# Install thrift.
200
- cd _build/thrift_ep-prefix/src/thrift_ep-build
201
- cmake --install ./ --prefix /usr/local/
201
+ cd ${DEPENDENCY_DIR} /arrow/cpp/ _build/thrift_ep-prefix/src/thrift_ep-build
202
+ cmake --install ./ --prefix ${INSTALL_PREFIX}
202
203
)
203
204
}
204
205
0 commit comments