Skip to content

Commit

Permalink
Add cd in cmake_install
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Apr 3, 2024
1 parent 1d2065f commit 1c4cda9
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 120 deletions.
34 changes: 14 additions & 20 deletions scripts/setup-adapters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,50 +91,44 @@ function install_azure-storage-sdk-cpp {
github_checkout azure/azure-sdk-for-cpp azure-storage-files-datalake_12.8.0
sed -i "s/set(VCPKG_COMMIT_STRING .*)/set(VCPKG_COMMIT_STRING $vcpkg_commit_id)/" cmake-modules/AzureVcpkg.cmake

cd sdk/core/azure-core
if ! grep -q "baseline" vcpkg.json; then
azure_core_dir="sdk/core/azure-core"
if ! grep -q "baseline" $azure_core_dir/vcpkg.json; then
# build and install azure-core with the version compatible with system pre-installed openssl
openssl_version=$(openssl version -v | awk '{print $2}')
if [[ "$openssl_version" == 1.1.1* ]]; then
openssl_version="1.1.1n"
fi
sed -i "s/\"version-string\"/\"builtin-baseline\": \"$vcpkg_commit_id\",\"version-string\"/" vcpkg.json
sed -i "s/\"version-string\"/\"overrides\": [{ \"name\": \"openssl\", \"version-string\": \"$openssl_version\" }],\"version-string\"/" vcpkg.json
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 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF
cmake_install $azure_core_dir -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF

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

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

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

function install_hdfs_deps {
github_checkout apache/hawq master
cd $DEPENDENCY_DIR/hawq/depends/libhdfs3
libhdfs3_dir=$DEPENDENCY_DIR/hawq/depends/libhdfs3
if [[ "$OSTYPE" == darwin* ]]; then
sed -i '' -e "/FIND_PACKAGE(GoogleTest REQUIRED)/d" ./CMakeLists.txt
sed -i '' -e "s/dumpversion/dumpfullversion/" ./CMakeLists.txt
sed -i '' -e "/FIND_PACKAGE(GoogleTest REQUIRED)/d" $libhdfs3_dir/CMakeLists.txt
sed -i '' -e "s/dumpversion/dumpfullversion/" $libhdfs3_dir/CMakeLists.txt
fi

if [[ "$OSTYPE" == linux-gnu* ]]; then
sed -i "/FIND_PACKAGE(GoogleTest REQUIRED)/d" ./CMakeLists.txt
sed -i "s/dumpversion/dumpfullversion/" ./CMake/Platform.cmake
sed -i "/FIND_PACKAGE(GoogleTest REQUIRED)/d" $libhdfs3_dir/CMakeLists.txt
sed -i "s/dumpversion/dumpfullversion/" $libhdfs3_dir/CMake/Platform.cmake
# Dependencies for Hadoop testing
wget_and_untar https://archive.apache.org/dist/hadoop/common/hadoop-2.10.1/hadoop-2.10.1.tar.gz hadoop
cp -a hadoop /usr/local/
fi
cmake_install
cmake_install $libhdfs3_dir
}

cd "${DEPENDENCY_DIR}" || exit
Expand Down
50 changes: 10 additions & 40 deletions scripts/setup-centos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,12 @@ function install_gflags {
# Remove an older version if present.
dnf remove -y gflags
wget_and_untar https://github.com/gflags/gflags/archive/v2.2.2.tar.gz gflags
(
cd gflags
cmake_install -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
)
cmake_install gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
}

function install_glog {
wget_and_untar https://github.com/google/glog/archive/v0.6.0.tar.gz glog
(
cd glog
cmake_install -DBUILD_SHARED_LIBS=ON
)
cmake_install glog -DBUILD_SHARED_LIBS=ON
}

function install_lzo {
Expand All @@ -111,18 +105,12 @@ function install_boost {

function install_snappy {
wget_and_untar https://github.com/google/snappy/archive/1.1.8.tar.gz snappy
(
cd snappy
cmake_install -DSNAPPY_BUILD_TESTS=OFF
)
cmake_install snappy -DSNAPPY_BUILD_TESTS=OFF
}

function install_fmt {
wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt
(
cd fmt
cmake_install -DFMT_TEST=OFF
)
cmake_install fmt -DFMT_TEST=OFF
}

function install_protobuf {
Expand All @@ -138,52 +126,34 @@ function install_protobuf {

function install_fizz {
wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz
(
cd fizz/fizz
cmake_install -DBUILD_TESTS=OFF
)
cmake_install fizz/fizz -DBUILD_TESTS=OFF
}

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
(
cd folly
cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
)
cmake_install folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
}

function install_wangle {
wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz wangle
(
cd wangle/wangle
cmake_install -DBUILD_TESTS=OFF
)
cmake_install wangle/wangle -DBUILD_TESTS=OFF
}

function install_fbthrift {
wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION}.tar.gz fbthrift
(
cd fbthrift
cmake_install -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
)
cmake_install fbthrift -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
}

function install_mvfst {
wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION}.tar.gz mvfst
(
cd mvfst
cmake_install -DBUILD_TESTS=OFF
)
cmake_install mvfst -DBUILD_TESTS=OFF
}

function install_duckdb {
if $BUILD_DUCKDB ; then
echo 'Building DuckDB'
wget_and_untar https://github.com/duckdb/duckdb/archive/refs/tags/v0.8.1.tar.gz duckdb
(
cd duckdb
cmake_install -DBUILD_UNITTESTS=OFF -DENABLE_SANITIZER=OFF -DENABLE_UBSAN=OFF -DBUILD_SHELL=OFF -DEXPORT_DLL_SYMBOLS=OFF -DCMAKE_BUILD_TYPE=Release
)
cmake_install duckdb -DBUILD_UNITTESTS=OFF -DENABLE_SANITIZER=OFF -DENABLE_UBSAN=OFF -DBUILD_SHELL=OFF -DEXPORT_DLL_SYMBOLS=OFF -DCMAKE_BUILD_TYPE=Release
fi
}

Expand Down
7 changes: 7 additions & 0 deletions scripts/setup-helper-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@ function wget_and_untar {
}

function cmake_install {
if [ -n "$1" ]; then
DIR="$1"
shift
else
DIR=$(pwd)
fi
local NAME=$(basename "$(pwd)")
local BINARY_DIR=_build
SUDO="${SUDO:-""}"
cd "${DIR}"
if [ -d "${BINARY_DIR}" ] && prompt "Do you want to rebuild ${NAME}?"; then
${SUDO} rm -rf "${BINARY_DIR}"
fi
Expand Down
45 changes: 9 additions & 36 deletions scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,74 +83,47 @@ function install_velox_deps_from_brew {

function install_fmt {
wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt
(
cd fmt
cmake_install -DFMT_TEST=OFF
)
cmake_install fmt -DFMT_TEST=OFF
}

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
(
cd folly
cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
)
cmake_install folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
}

function install_fizz {
wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz
(
cd fizz/fizz
cmake_install -DBUILD_TESTS=OFF
)
cmake_install fizz/fizz -DBUILD_TESTS=OFF
}

function install_wangle {
wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz wangle
(
cd wangle/wangle
cmake_install -DBUILD_TESTS=OFF
)
cmake_install wangle/wangle -DBUILD_TESTS=OFF
}

function install_mvfst {
wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION}.tar.gz mvfst
(
cd mvfst
cmake_install -DBUILD_TESTS=OFF
)
cmake_install mvfst -DBUILD_TESTS=OFF
}

function install_fbthrift {
wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION}.tar.gz fbthrift
(
cd fbthrift
cmake_install -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
)
cmake_install fbthrift -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
}

function install_double_conversion {
wget_and_untar https://github.com/google/double-conversion/archive/refs/tags/v3.1.5.tar.gz double-conversion
(
cd double-conversion
cmake_install -DBUILD_TESTING=OFF
)
cmake_install double-conversion -DBUILD_TESTING=OFF
}

function install_ranges_v3 {
wget_and_untar https://github.com/ericniebler/range-v3/archive/refs/tags/0.12.0.tar.gz ranges_v3
(
cd ranges_v3
cmake_install -DRANGES_ENABLE_WERROR=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF
)
cmake_install ranges_v3 -DRANGES_ENABLE_WERROR=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF
}

function install_re2 {
wget_and_untar https://github.com/google/re2/archive/refs/tags/2021-04-01.tar.gz re2
(
cd re2
cmake_install -DRE2_BUILD_TESTING=OFF
)
cmake_install re2 -DRE2_BUILD_TESTING=OFF
}

function install_velox_deps {
Expand Down
30 changes: 6 additions & 24 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ function install_velox_deps_from_apt {

function install_fmt {
wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt
(
cd fmt
cmake_install -DFMT_TEST=OFF
)
cmake_install fmt -DFMT_TEST=OFF
}

function install_boost {
Expand All @@ -109,42 +106,27 @@ function install_boost {

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
(
cd folly
cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
)
cmake_install folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
}

function install_fizz {
wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz
(
cd fizz/fizz
cmake_install -DBUILD_TESTS=OFF
)
cmake_install fizz/fizz -DBUILD_TESTS=OFF
}

function install_wangle {
wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz wangle
(
cd wangle/wangle
cmake_install -DBUILD_TESTS=OFF
)
cmake_install wangle/wangle -DBUILD_TESTS=OFF
}

function install_mvfst {
wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION}.tar.gz mvfst
(
cd mvfst
cmake_install -DBUILD_TESTS=OFF
)
cmake_install mvfst -DBUILD_TESTS=OFF
}

function install_fbthrift {
wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION}.tar.gz fbthrift
(
cd fbthrift
cmake_install -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
)
cmake_install fbthrift -Denable_tests=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
}

function install_conda {
Expand Down

0 comments on commit 1c4cda9

Please sign in to comment.