Skip to content

Commit

Permalink
Fix failure
Browse files Browse the repository at this point in the history
  • Loading branch information
majetideepak committed Sep 12, 2024
1 parent ef42bec commit d02c3df
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
42 changes: 29 additions & 13 deletions scripts/setup-adapters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
CMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}"
MACHINE=$(uname -m)

if [[ "$OSTYPE" == darwin* ]]; then
export INSTALL_PREFIX=${INSTALL_PREFIX:-"$(pwd)/deps-install"}
fi

function install_aws_deps {
local AWS_REPO_NAME="aws/aws-sdk-cpp"
local AWS_SDK_VERSION="1.11.321"
Expand All @@ -40,14 +44,16 @@ function install_aws_deps {
MINIO_ARCH="amd64"
fi
local MINIO_BINARY="minio-2022-05-26"
local MINIO_OS="linux"
if [[ "$OSTYPE" == darwin* ]]; then
# minio will have to approved under the Privacy & Security on MacOS on first use.
MINIO_OS="darwin"
if [[! -f /usr/local/bin/${MINIO_BINARY} ]]; then
local MINIO_OS="linux"
if [[ "$OSTYPE" == darwin* ]]; then
# minio will have to approved under the Privacy & Security on MacOS on first use.
MINIO_OS="darwin"
fi
wget https://dl.min.io/server/minio/release/${MINIO_OS}-${MINIO_ARCH}/archive/minio.RELEASE.2022-05-26T05-48-41Z -O ${MINIO_BINARY}
chmod +x ./${MINIO_BINARY}
mv ./${MINIO_BINARY} /usr/local/bin/
fi
wget https://dl.min.io/server/minio/release/${MINIO_OS}-${MINIO_ARCH}/archive/minio.RELEASE.2022-05-26T05-48-41Z -O ${MINIO_BINARY}
chmod +x ./${MINIO_BINARY}
mv ./${MINIO_BINARY} /usr/local/bin/
}

function install_gcs-sdk-cpp {
Expand Down Expand Up @@ -117,16 +123,26 @@ function install_azure-storage-sdk-cpp {
sed -i "s/\"version-string\"/\"builtin-baseline\": \"$vcpkg_commit_id\",\"version-string\"/" $azure_core_dir/vcpkg.json
sed -i "s/\"version-string\"/\"overrides\": [{ \"name\": \"openssl\", \"version-string\": \"$openssl_version\" }],\"version-string\"/" $azure_core_dir/vcpkg.json
fi
cmake_install_dir $azure_core_dir -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF

(
cd $azure_core_dir
cmake_install -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
)
# install azure-storage-common
cmake_install_dir sdk/storage/azure-storage-common -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
(
cd sdk/storage/azure-storage-common
cmake_install -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
)

# install azure-storage-blobs
cmake_install_dir sdk/storage/azure-storage-blobs -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF

(
cd sdk/storage/azure-storage-blobs
cmake_install -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
)
# install azure-storage-files-datalake
cmake_install_dir sdk/storage/azure-storage-files-datalake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
(
cd sdk/storage/azure-storage-files-datalake
cmake_install -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
)
}

function install_hdfs_deps {
Expand Down
13 changes: 7 additions & 6 deletions scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export CFLAGS=${CXXFLAGS//"-std=c++17"/} # Used by LZO.
CMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}"
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
USE_CLANG="${USE_CLANG:-false}"
export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"}
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}

FB_OS_VERSION="v2024.05.20.00"
Expand Down Expand Up @@ -98,7 +99,7 @@ function install_lzo {
wget_and_untar http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz lzo
(
cd ${DEPENDENCY_DIR}/lzo
./configure --prefix=/usr --enable-shared --disable-static --docdir=/usr/share/doc/lzo-2.10
./configure --prefix=${INSTALL_PREFIX} --enable-shared --disable-static --docdir=/usr/share/doc/lzo-2.10
make "-j$(nproc)"
make install
)
Expand All @@ -109,14 +110,14 @@ function install_boost {
(
cd ${DEPENDENCY_DIR}/boost
if [[ ${USE_CLANG} != "false" ]]; then
./bootstrap.sh --prefix=/usr/local --with-toolset="clang-15"
./bootstrap.sh --prefix=${INSTALL_PREFIX} --with-toolset="clang-15"
# Switch the compiler from the clang-15 toolset which doesn't exist (clang-15.jam) to
# clang of version 15 when toolset clang-15 is used.
# This reconciles the project-config.jam generation with what the b2 build system allows for customization.
sed -i 's/using clang-15/using clang : 15/g' project-config.jam
${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi toolset=clang-15 --without-python
else
./bootstrap.sh --prefix=/usr/local
./bootstrap.sh --prefix=${INSTALL_PREFIX}
${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi --without-python
fi
)
Expand All @@ -136,7 +137,7 @@ function install_protobuf {
wget_and_untar https://github.com/protocolbuffers/protobuf/releases/download/v21.8/protobuf-all-21.8.tar.gz protobuf
(
cd ${DEPENDENCY_DIR}/protobuf
./configure --prefix=/usr
./configure --prefix=${INSTALL_PREFIX}
make "-j${NPROC}"
make install
ldconfig
Expand Down Expand Up @@ -190,15 +191,15 @@ function install_arrow {
-DARROW_RUNTIME_SIMD_LEVEL=NONE \
-DARROW_WITH_UTF8PROC=OFF \
-DARROW_TESTING=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DARROW_BUILD_STATIC=ON \
-DThrift_SOURCE=BUNDLED

(
# Install thrift.
cd ${DEPENDENCY_DIR}/arrow/cpp/_build/thrift_ep-prefix/src/thrift_ep-build
cmake --install ./ --prefix /usr/local/
cmake --install ./ --prefix ${INSTALL_PREFIX}
)
}

Expand Down
15 changes: 7 additions & 8 deletions scripts/setup-helper-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,25 +180,24 @@ function wget_and_untar {

function cmake_install_dir {
pushd "${DEPENDENCY_DIR}/$1"
# remove the directory argument
shift
cmake_install $@
popd
}

function cmake_install {
local NAME=$(basename "$(pwd)")
local BINARY_DIR=_build
SUDO="${SUDO:-""}"
if [ -d "${BINARY_DIR}" ]; then
if prompt "Do you want to rebuild ${NAME}?"; then
${SUDO} rm -rf "${BINARY_DIR}"
else
popd
return
fi
fi
# remove the directory argument
shift
cmake_install $@
popd
}

function cmake_install {
local BINARY_DIR=_build
mkdir -p "${BINARY_DIR}"
COMPILER_FLAGS=$(get_cxx_flags)
# Add platform specific CXX flags if any
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ function install_velox_deps {
)

echo 'To add cmake-format bin to your $PATH, consider adding this to your ~/.profile:'
echo 'export PATH=$HOME/bin:$HOME/Library/Python/3.7/bin:$PATH'
echo 'Please add $INSTALL_PREFIX to your ~/.zshrc'
9 changes: 5 additions & 4 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
export CMAKE_BUILD_TYPE=Release
SUDO="${SUDO:-"sudo --preserve-env"}"
USE_CLANG="${USE_CLANG:-false}"
export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"}
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}

function install_clang15 {
Expand Down Expand Up @@ -120,14 +121,14 @@ function install_boost {
(
cd ${DEPENDENCY_DIR}/boost
if [[ ${USE_CLANG} != "false" ]]; then
./bootstrap.sh --prefix=/usr/local --with-toolset="clang-15"
./bootstrap.sh --prefix=${INSTALL_PREFIX} --with-toolset="clang-15"
# Switch the compiler from the clang-15 toolset which doesn't exist (clang-15.jam) to
# clang of version 15 when toolset clang-15 is used.
# This reconciles the project-config.jam generation with what the b2 build system allows for customization.
sed -i 's/using clang-15/using clang : 15/g' project-config.jam
${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi toolset=clang-15 --without-python
else
./bootstrap.sh --prefix=/usr/local
./bootstrap.sh --prefix=${INSTALL_PREFIX}
${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi --without-python
fi
)
Expand Down Expand Up @@ -198,15 +199,15 @@ function install_arrow {
-DARROW_RUNTIME_SIMD_LEVEL=NONE \
-DARROW_WITH_UTF8PROC=OFF \
-DARROW_TESTING=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DARROW_BUILD_STATIC=ON \
-DThrift_SOURCE=BUNDLED

(
# Install thrift.
cd ${DEPENDENCY_DIR}/arrow/cpp/_build/thrift_ep-prefix/src/thrift_ep-build
$SUDO cmake --install ./ --prefix /usr/local/
$SUDO cmake --install ./ --prefix ${INSTALL_PREFIX}
)
}

Expand Down

0 comments on commit d02c3df

Please sign in to comment.