sqlite-parquet-vtable/make-linux

96 lines
2.5 KiB
Plaintext
Raw Normal View History

#!/bin/bash
set -euo pipefail
2020-10-19 11:12:15 +00:00
apt install -y sudo lsb-release wget
here=$(dirname "${BASH_SOURCE[0]}")
here=$(readlink -f "$here")
2020-10-27 15:06:01 +00:00
distro="$(lsb_release -s -r)"
setup_directories() {
cd "$here"
mkdir -p build/linux
cp -f build/Makefile.linux build/linux/Makefile
cd build/linux
}
2020-10-27 15:06:01 +00:00
install_prerequisites_amazon_linux() {
# Install Apache Arrow <https://arrow.apache.org/install/> and dependencies.
sudo yum update -y
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y https://apache.bintray.com/arrow/centos/7/apache-arrow-release-latest.rpm
sudo yum install -y --enablerepo=epel parquet-devel
sudo yum install -y lz4-devel thrift-devel libzstd-devel snappy-devel brotli-devel boost-devel boost-static libicu-devel openssl-devel
export CFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
}
install_prerequisites_ubuntu() {
2020-10-19 11:12:15 +00:00
# install Apache Arrow libs
# NOTE: Pinned to Ubuntu Focal
wget https://apache.bintray.com/arrow/ubuntu/apache-arrow-archive-keyring-latest-focal.deb
sudo apt install -y -V ./apache-arrow-archive-keyring-latest-focal.deb
sudo apt update -y
sudo apt install -y -V libparquet-dev liblz4-dev libzstd-dev libthrift-dev \
2020-10-27 14:50:11 +00:00
libsnappy-dev libbrotli-dev libz-dev
2020-10-19 11:12:15 +00:00
# Install prereqs based on https://github.com/apache/parquet-cpp#linux
2020-10-19 11:12:15 +00:00
sudo apt install -y libboost-dev g++ libboost-filesystem-dev \
libboost-program-options-dev libboost-regex-dev \
libboost-system-dev libboost-test-dev \
libssl-dev libtool bison flex pkg-config libreadline-dev libncurses-dev
# Install prereqs based on https://github.com/apache/arrow/tree/master/cpp
2020-10-19 11:12:15 +00:00
sudo apt install -y cmake \
libboost-dev \
libboost-filesystem-dev \
libboost-system-dev
}
build_sqlite() {
if [ ! -e ../../sqlite/sqlite3 ]; then
2018-07-06 03:36:30 +00:00
( cd "../.." && ./build-sqlite )
fi
}
set_icu_version() {
2020-10-27 15:06:01 +00:00
case "$distro" in
14.04)
2020-08-04 23:58:16 +00:00
export ICU_VERSION=52-1
;;
16.04)
2020-08-04 23:58:16 +00:00
export ICU_VERSION=55-1
;;
18.04)
2020-08-04 23:58:16 +00:00
export ICU_VERSION=60-2
;;
2020-10-19 11:12:15 +00:00
20.10)
export ICU_VERSION=67-1
;;
*)
echo "unsure what libicu version to use" >&2
exit 1
esac
2020-08-05 00:23:48 +00:00
export ICU_VERSION_U=${ICU_VERSION//-/_}
}
main() {
2020-10-19 11:12:15 +00:00
set_icu_version
setup_directories
install_prerequisites
build_sqlite
if [ -v PREBUILT ]; then
fetch_prebuilt_libs
fi
2018-07-05 22:47:33 +00:00
optimizations="-O3"
if [ -v COVERAGE ]; then
optimizations="-fprofile-arcs -ftest-coverage"
fi
make ${lib_locs[@]-} "$@" OPTIMIZATIONS="$optimizations"
}
main "$@"