Skip to content

Commit

Permalink
add antlr4
Browse files Browse the repository at this point in the history
  • Loading branch information
duanmeng committed Nov 7, 2023
1 parent fc8a69f commit f2880eb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/setup-centos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ dnf_install curl-devel c-ares-devel

dnf_install conda

# Required for Antlr4
dnf install -y libuuid-devel

# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
set -u
Expand Down Expand Up @@ -86,6 +89,15 @@ wait # For cmake and source downloads to complete.
./b2 "-j$(nproc)" -d0 install threading=multi
)

(
wget https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip &&
mkdir antlr4-cpp-runtime-4.9.3-source &&
cd antlr4-cpp-runtime-4.9.3-source &&
unzip ../antlr4-cpp-runtime-4.9.3-source.zip &&
cmake_install -DBUILD_SHARED_LIBS=ON
ldconfig
)

cmake_install_deps gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64 -DCMAKE_INSTALL_PREFIX:PATH=/usr
cmake_install_deps glog -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr
cmake_install_deps snappy -DSNAPPY_BUILD_TESTS=OFF
Expand Down
12 changes: 12 additions & 0 deletions scripts/setup-circleci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ dnf_install autoconf automake libtool bison flex python3 libsodium-devel

dnf_install conda

# Required for Antlr4
dnf install -y libuuid-devel

# install sphinx for doc gen
pip3 install sphinx sphinx-tabs breathe sphinx_rtd_theme

Expand Down Expand Up @@ -108,6 +111,15 @@ cp -a hadoop /usr/local/
ldconfig
)

(
wget https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip &&
mkdir antlr4-cpp-runtime-4.9.3-source &&
cd antlr4-cpp-runtime-4.9.3-source &&
unzip ../antlr4-cpp-runtime-4.9.3-source.zip &&
cmake_install -DBUILD_SHARED_LIBS=ON
ldconfig
)

cmake_install gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64 -DCMAKE_INSTALL_PREFIX:PATH=/usr
cmake_install glog -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr
cmake_install snappy -DSNAPPY_BUILD_TESTS=OFF
Expand Down
8 changes: 8 additions & 0 deletions scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ function install_re2 {
cmake_install -DRE2_BUILD_TESTING=OFF
}

function install_antlr {
github_checkout antlr/antlr4 "4.9.3"
cd runtime/Cpp
cmake_install -DBUILD_TESTS=OFF
}

function install_velox_deps {
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
run_and_time install_build_prerequisites
Expand All @@ -121,6 +127,8 @@ function install_velox_deps {
run_and_time install_fmt
run_and_time install_double_conversion
run_and_time install_re2
run_and_time install_antlr

}

(return 2> /dev/null) && return # If script was sourced, don't run commands.
Expand Down
13 changes: 13 additions & 0 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,26 @@ function install_conda {
bash Miniconda3-latest-Linux-x86_64.sh -b -p $MINICONDA_PATH
}

function install_antlr4 {
cd "${DEPENDENCY_DIR}"
if [ -d "antlr4-cpp-runtime-4.9.3-source" ]; then
rm -rf antlr4-cpp-runtime-4.9.3-source
fi
wget https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip -O antlr4-cpp-runtime-4.9.3-source.zip
mkdir antlr4-cpp-runtime-4.9.3-source && cd antlr4-cpp-runtime-4.9.3-source
unzip ../antlr4-cpp-runtime-4.9.3-source.zip
mkdir build && mkdir run && cd build
cmake .. && make "-j${NPROC}" install
}

function install_velox_deps {
run_and_time install_fmt
run_and_time install_folly
run_and_time install_fizz
run_and_time install_wangle
run_and_time install_fbthrift
run_and_time install_conda
run_and_time install_antlr4
}

(return 2> /dev/null) && return # If script was sourced, don't run commands.
Expand Down

0 comments on commit f2880eb

Please sign in to comment.