Skip to content

Commit

Permalink
Document build instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Groudas committed Apr 30, 2021
1 parent 3b5fa20 commit f257238
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
13 changes: 13 additions & 0 deletions mcrouter/scripts/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
N.B These scripts *only* support Amazon Linux 2

1. Install compilers and system-provided libraries:

./install_deps_amazon-linux-2.sh

2. Compile mcrouter and dependencies

MY_INSTALL_DIR=path/to/install/dir
TARGET=mcrouter
./get_and_build_by_make $MY_INSTALL_DIR mcrouter

You can substitute individual dependencies as the value of TARGET in order to debug.
15 changes: 8 additions & 7 deletions mcrouter/scripts/get_and_build_by_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

set -ex

MAKE_FILE="$1"
TARGET="$3"
PKG_DIR="${2%/}"/pkgs
INSTALL_DIR="${2%/}"/install
INSTALL_AUX_DIR="${2%/}"/install/aux
TARGET="$2"
PKG_DIR="${1%/}"/pkgs
INSTALL_DIR="${1%/}"/install
INSTALL_AUX_DIR="${1%/}"/install/aux

[ -n "$MAKE_FILE" ] || ( echo "Make file missing"; exit 1 )
[ -n "$TARGET" ] || ( echo "Target missing"; exit 1 )

mkdir -p "$PKG_DIR" "$INSTALL_DIR" "$INSTALL_AUX_DIR"
Expand All @@ -32,7 +30,10 @@ REPO_BASE_DIR="$(cd ../../ && pwd)" || die "Couldn't determine repo top dir"
export REPO_BASE_DIR

export LDFLAGS="-ljemalloc $LDFLAGS"
# Set CC and CXX to unambiguously choose compiler.
export CC=/usr/bin/gcc
export CXX=/usr/bin/c++

make "$TARGET" -j "$(nproc)" -f "$MAKE_FILE" PKG_DIR="$PKG_DIR" INSTALL_DIR="$INSTALL_DIR" INSTALL_AUX_DIR="$INSTALL_AUX_DIR"
make "$TARGET" -j "$(nproc)" -f "Makefile_amazon-linux-2" PKG_DIR="$PKG_DIR" INSTALL_DIR="$INSTALL_DIR" INSTALL_AUX_DIR="$INSTALL_AUX_DIR"

printf "%s\n" "make $TARGET for $MAKE_FILE done"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

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"
Expand Down Expand Up @@ -61,17 +56,11 @@ sudo yum install -y \
# 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
# Link cmake -> cmake3 so the recipes can just refer to cmake.
if [ ! -e /usr/bin/cmake ]; then
sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake
fi

# 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"

0 comments on commit f257238

Please sign in to comment.