-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- "Install_amazon-linux-2.sh" will install required build tools and development libraries. - Adds "Makefile_amazon-linux-2" to describe the required dependency compilation order. - Updates individual recipes for compiling each dependency to generally be more consistent. - Fixes all dependencies to a specific version.
- Loading branch information
Paul Groudas
committed
Apr 30, 2021
1 parent
5c4f50e
commit 065f705
Showing
14 changed files
with
266 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
RECIPES_DIR := ./recipes | ||
|
||
all: mcrouter | ||
|
||
# Boost available from Amazon Linux is not recent enough. | ||
# There *are* more recent versions available via EPEL, but they introduce python dependency conflicts. | ||
.boost-done: | ||
${RECIPES_DIR}/boost.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
# The version of fmt from the package repositories is insufficient to satisfy the "folly" build. | ||
.fmt-done: .boost-done | ||
${RECIPES_DIR}/fmtlib.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
# The version of gflags in the repo is insufficient for compiling mcrouter | ||
.gflags-done: .boost-done | ||
${RECIPES_DIR}/gflags.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
# The version of glog in the repo is insufficient for compiling folly. | ||
# Additionally, the most recent (HEAD / v0.5.0.rc2) revision from upstream is incompatible for compiling mcrouter. | ||
# Fortunately, v0.4.0 works for both, so we just check out that revision. | ||
.glog-done: .gflags-done .boost-done | ||
${RECIPES_DIR}/glog.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
.zstd-done: | ||
${RECIPES_DIR}/zstd.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
.folly-done: .zstd-done .glog-done .gflags-done .boost-done .fmt-done | ||
${RECIPES_DIR}/folly.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
.fizz-done: .folly-done .glog-done .gflags-done .boost-done | ||
${RECIPES_DIR}/fizz.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
.wangle-done: .folly-done .fizz-done .glog-done .gflags-done .boost-done | ||
${RECIPES_DIR}/wangle.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
.fbthrift-done: .folly-done .fizz-done .wangle-done .fmt-done .glog-done .gflags-done .boost-done | ||
${RECIPES_DIR}/fbthrift.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ | ||
|
||
deps: .fbthrift-done .folly-done .fizz-done .wangle-done .fmt-done .zstd-done .glog-done .gflags-done .boost-done | ||
touch $@ | ||
|
||
mcrouter: deps | ||
${RECIPES_DIR}/mcrouter.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR) | ||
touch $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -ex | ||
|
||
BASE_DIR="$1" | ||
TARGET="${2:-all}" | ||
|
||
[ -n "$BASE_DIR" ] || ( echo "Base dir missing"; exit 1 ) | ||
|
||
sudo yum install -y epel-release | ||
|
||
sudo yum groupinstall -y "Development Tools" | ||
sudo yum install -y \ | ||
autoconf \ | ||
binutils-devel \ | ||
bison \ | ||
bzip2-devel \ | ||
cmake3 \ | ||
double-conversion-devel \ | ||
flex \ | ||
gcc-c++\ | ||
git \ | ||
gtest-devel \ | ||
jemalloc-devel \ | ||
libevent-devel \ | ||
libsodium-devel \ | ||
libtool \ | ||
libunwind-devel \ | ||
lz4-devel \ | ||
make \ | ||
openssl-devel \ | ||
python-devel \ | ||
ragel \ | ||
snappy-devel \ | ||
xz-devel \ | ||
zlib-devel | ||
|
||
# The above dependencies provide the build time requirements | ||
# for compiling "mcrouter" as well as a number of other dependencies. | ||
# | ||
# In order to package and deploy the resulting artifact, we need to ship | ||
# mcrouter along with the compiled dynamic library dependencies. | ||
# In addition, we need to install into the system the non development | ||
# version of some libraries. This comment is here to provide an example | ||
# for what is necessary to provide a runtime environment. | ||
|
||
#sudo yum install -y \ | ||
# bzip2 \ | ||
# double-conversion \ | ||
# jemalloc \ | ||
# libevent \ | ||
# libsodium \ | ||
# libunwind \ | ||
# lz4 \ | ||
# snappy \ | ||
# openssl \ | ||
# xz-libz \ | ||
# zlib \ | ||
|
||
|
||
# Set CC and CXX to unambiguously choose compiler. | ||
export CC=/usr/bin/gcc | ||
export CXX=/usr/bin/c++ | ||
|
||
sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake | ||
|
||
# Automake available by default is 1.13 and unsupported for mcrouter. | ||
# Install automake-1.15 from Fedora | ||
yum info automake-1.15-4.fc23 || sudo yum install -y "http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Everything/x86_64/os/Packages/a/automake-1.15-4.fc23.noarch.rpm" | ||
|
||
cd "$(dirname "$0")" || ( echo "cd fail"; exit 1 ) | ||
|
||
./get_and_build_by_make.sh "Makefile_amazon-linux-2" "$BASE_DIR" "$TARGET" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
source common.sh | ||
|
||
if [ ! -d "$PKG_DIR/boost" ]; then | ||
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz | ||
tar xzf boost_1_76_0.tar.gz | ||
mv boost_1_76_0 boost | ||
rm -f boost*.tar.gz | ||
fi | ||
|
||
cd "$PKG_DIR/boost" || die "cd fail" | ||
|
||
./bootstrap.sh --prefix="$INSTALL_DIR" | ||
./b2 -j "$(nproc)" --prefix="$INSTALL_DIR" install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
source common.sh | ||
|
||
if [ ! -d "$PKG_DIR/gflags" ]; then | ||
git clone https://github.com/gflags/gflags.git | ||
fi | ||
|
||
cd "$PKG_DIR/gflags" || die "cd fail" | ||
|
||
# Use a known compatible version | ||
# There hasn't been a release in years, this is just the (currently) most | ||
# recent commit. | ||
git checkout 827c769e5fc98e0f2a34c47cef953cc6328abced | ||
|
||
LDFLAGS="-Wl,-rpath=$INSTALL_DIR/lib,--enable-new-dtags -L$INSTALL_DIR/lib $LDFLAGS" \ | ||
CPPFLAGS="-I$INSTALL_DIR/include -DGOOGLE_GLOG_DLL_DECL='' $CPPFLAGS" \ | ||
cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DBUILD_SHARED_LIBS=YES -S . -B build -G "Unix Makefiles" | ||
|
||
cmake --build build --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.