Skip to content

Commit

Permalink
Updating makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
virgofx committed Sep 30, 2021
1 parent a9db3dd commit cfb5953
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 31 deletions.
58 changes: 35 additions & 23 deletions mcrouter/scripts/Makefile_amazon-linux-2
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@
# LICENSE file in the root directory of this source tree.

RECIPES_DIR := ./recipes
MCROUTER_ARCHIVE := mcrouter.$(shell git rev-parse --short=12 HEAD).$(shell uname -m).tar.gz

all: deps mcrouter

deps: .jemalloc-done .boost-done .zstd-done .fmt-done .gflags-done .folly-done .fizz-done .wangle-done .fbthrift-done
# .fbthrift-done .folly-done .fizz-done .wangle-done .fmt-done .zstd-done .glog-done .gflags-done
touch $@

all: mcrouter
mcrouter:
${RECIPES_DIR}/mcrouter.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

$(MCROUTER_ARCHIVE): mcrouter
./slim-archive.sh $(INSTALL_DIR) $@

archive: $(MCROUTER_ARCHIVE)

# jemalloc is available from the package repositories, but then we get this warning at mcrouter startup:
# <jemalloc>: Error in munmap(): Invalid argument which corresponds to https://github.com/jemalloc/jemalloc/issues/467
# As we build on the same system we deploy to (our amazon linux AMI), I hope that this results with consistent
# page sizes and no error.
.jemalloc-done:
# We set "LDFLAGS" in the "get_and_build_by_make.sh" script that tells all
# projects to link against jemalloc. We unset that when we actually compile jemalloc.
# projects to link against jemalloc. We unset that when we actually compile jemalloc.
LDFLAGS="" ${RECIPES_DIR}/jemalloc.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

Expand All @@ -23,6 +37,10 @@ all: mcrouter
${RECIPES_DIR}/boost.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.zstd-done: .jemalloc-done
${RECIPES_DIR}/zstd.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 .jemalloc-done
${RECIPES_DIR}/fmtlib.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
Expand All @@ -33,43 +51,37 @@ all: mcrouter
${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 .jemalloc-done
${RECIPES_DIR}/glog.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.zstd-done: .jemalloc-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 .jemalloc-done
.folly-done: .boost-done .jemalloc-done .fmt-done
### # .zstd-done .glog-done .gflags-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 .jemalloc-done
.fizz-done: .boost-done .jemalloc-done .folly-done .gflags-done
### .glog-done .gflags-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 .jemalloc-done
# Wangle explicity depends on Fizz. Keep these versions aligned
${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 .jemalloc-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 .jemalloc-done
touch $@

mcrouter: .fbthrift-done .folly-done .fizz-done .wangle-done .fmt-done .zstd-done .glog-done .gflags-done .boost-done .jemalloc-done
${RECIPES_DIR}/mcrouter.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)


# 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 .jemalloc-done
${RECIPES_DIR}/glog.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

MCROUTER_ARCHIVE := mcrouter.$(shell git rev-parse --short=12 HEAD).$(shell uname -m).tar.gz

$(MCROUTER_ARCHIVE): mcrouter
./slim-archive.sh $(INSTALL_DIR) $@

archive: $(MCROUTER_ARCHIVE)



6 changes: 3 additions & 3 deletions mcrouter/scripts/recipes/boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
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
wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz
tar xzf boost_1_77_0.tar.gz
mv boost_1_77_0 boost
rm -f boost*.tar.gz
fi

Expand Down
3 changes: 2 additions & 1 deletion mcrouter/scripts/recipes/fbthrift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fi
cd "$PKG_DIR/fbthrift" || die "cd fail"

# Use a known compatible version
gitEnsureTreeish v2021.04.26.00
# v2020.08.24.00 - Published stable release - CMake linking errors
gitEnsureTreeish v2021.09.27.00

cd "$PKG_DIR/fbthrift/build" || die "cd fbthrift failed"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/fizz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/fizz" || die "cd fail"

# Use a known compatible version
gitEnsureTreeish v2021.04.26.00
gitEnsureTreeish v2021.09.27.00

cd "$PKG_DIR/fizz/fizz/" || die "cd fail"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/folly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/folly" || die "cd fail"

# Use a known compatible version
gitEnsureTreeish v2021.04.26.00
gitEnsureTreeish v2021.09.27.00

# There is an issue when compiling folly on aarch64 when libunwind is available.
# The build configuration does expose a direct way to avoid using libunwind, and we
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/wangle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/wangle" || die "cd fail"

# Use a known compatible version
gitEnsureTreeish v2021.04.26.00
gitEnsureTreeish v2021.09.27.00

cd "$PKG_DIR/wangle/wangle/" || die "cd fail"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/zstd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/zstd" || die "cd fail"

# Use a known compatible version
gitEnsureTreeish v1.4.9
gitEnsureTreeish v1.5.0

cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" build/cmake/
make -j "$(nproc)" && make install

0 comments on commit cfb5953

Please sign in to comment.