-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces "jemalloc" as a library dependency that we build from source. While this library is available from our runtime system's package respository, mcrouter would log an error at startup implying that there is a page size mis-match between the current kernel, and the system on which jemalloc was compiled. As this package available via the EPEL[1] and not Amazon Linux directly, this isn't entirely surprising. Compiling "jemalloc" is very straightforward, but getting all the dependencies to correctly link against it during their builds was a bit challenging. Ultimately I made the following changes: 1. The default value we set for *all* recipes is: LDFLAGS="-L$INSTALL_DIR/lib -ljemalloc - "-ljemalloc" means "link against the 'jemalloc'" library. - "-L$INSTALL_DIR/lib" search "$INSTALL_DIR/lib" when looking for libraries. 2. I removed redundant LDFLAGS from each recipe following the change to the default. 3. Some builds, notable those that produce binary executables (not just shared libraries), also need to include "-Wl,-rpath=$INSTALL_DIR/lib", which embeds metadata about the dynamic libraries' location into the executable. Conceptually, this doesn't make sense to me, as we are expecting users to manage their own library path, but not setting this causes the builds to fail, and I have a limited appetite for debugging and understanding these build tools. [1]: https://fedoraproject.org/wiki/EPEL
- Loading branch information
Paul Groudas
committed
May 3, 2021
1 parent
abbe369
commit 06fc230
Showing
9 changed files
with
45 additions
and
19 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
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
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,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/jemalloc" ]; then | ||
git clone https://github.com/jemalloc/jemalloc | ||
fi | ||
|
||
cd "$PKG_DIR/jemalloc" || die "cd failed" | ||
|
||
# Use a known compatible version | ||
gitEnsureTreeish 5.2.1 | ||
|
||
./autogen.sh --prefix="$INSTALL_DIR" | ||
make -j "$(nproc)" && make 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