-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script to build gperftools/libtcmalloc
- Loading branch information
Michael Yan
committed
May 30, 2022
1 parent
371cbb9
commit 3843734
Showing
3 changed files
with
53 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ============================================================================= | ||
# FILENAME : build_tcmalloc.sh | ||
# AUTHOR : Michael Yan | ||
# CREATION : 2022-05-30 | ||
# Script to build gperftools/libtcmalloc with specified version. | ||
# | ||
# This script will the do the following steps | ||
# 1. Create working directory | ||
# 2. clone the tcmalloc source | ||
# 3. checkout the desired release version | ||
# 4. configure, build and install | ||
# ============================================================================= | ||
set -e | ||
|
||
if [ "$#" -ne 1 ] | ||
then | ||
echo "Usage: $0 <gperftools version>" | ||
echo " For example, \"$0 2.7\"" | ||
echo " Please refer to https://github.com/gperftools/gperftools/releases" | ||
exit 1 | ||
fi | ||
|
||
PROJECT_FOLDER=$(pwd) | ||
release_tag=$1 | ||
echo "Current project folder is $PROJECT_FOLDER" | ||
build_folder=$PROJECT_FOLDER/build | ||
mkdir -p $build_folder | ||
cd $build_folder | ||
scr_dir="gperftools" | ||
if [ ! -d $scr_dir ] | ||
then | ||
echo "cloning gperftools ..." | ||
git clone https://github.com/gperftools/gperftools.git | ||
fi | ||
cd $scr_dir | ||
|
||
echo "checkout $release_tag" | ||
branch_name=gperftools-$release_tag | ||
if [ -n "$(git branch --list ${branch_name})" ] | ||
then | ||
echo "Branch name $branch_name already exists." | ||
else | ||
git checkout tags/$branch_name -b $branch_name | ||
fi | ||
|
||
echo "building..." | ||
./autogen.sh | ||
./configure | ||
make clean && make -j 4 && sudo 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