-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_allocators.sh
executable file
·156 lines (134 loc) · 4.44 KB
/
install_allocators.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
# This scripts downloads and builds the allocators under test
# in the allocators subdirectory
#
# Feel free to adapt this scipts to your needs
ALL_ALLOCATORS="jemalloc llalloc ptmalloc3 tbb tcmalloc streamflow hoard scalloc"
WD=`pwd`
function install_allocator {
ALLOCATOR=$1
if [[ $ALLOCATOR == "jemalloc" ]]; then
# jemalloc
rm -rf jemalloc*
wget http://ftp.de.debian.org/debian/pool/main/j/jemalloc/jemalloc_3.6.0.orig.tar.bz2
tar -xvjf jemalloc_3.6.0.orig.tar.bz2
mv jemalloc-3.6.0 jemalloc
cd jemalloc
./autogen.sh
make -j 2
cd $WD/allocators
ln -s jemalloc/lib/libjemalloc.so.1 libjemalloc.so.1
ln -s jemalloc/lib/libjemalloc.so.1 libjemalloc.so
fi
if [[ $ALLOCATOR == "llalloc" ]]; then
# llalloc
rm -rf lockless_allocator_linux*
wget http://locklessinc.com/downloads/lockless_allocator_linux.tgz
tar -xzf lockless_allocator_linux.tgz
ln -s lockless_allocator_linux/64bit/libllalloc.so.1.4 libllalloc.so.1.4
ln -s lockless_allocator_linux/64bit/libllalloc.so.1.4 libllalloc.so
fi
if [[ $ALLOCATOR == "ptmalloc3" ]]; then
# ptmalloc3
rm -rf ptmalloc*
wget http://www.malloc.de/malloc/ptmalloc3-current.tar.gz
tar -xzf ptmalloc3-current.tar.gz
cd ptmalloc3/
make linux-shared OPT_FLAGS='-O2 -pthread'
cd $WD/allocators
ln -s ptmalloc3/libptmalloc3.so libptmalloc3.so
fi
if [[ $ALLOCATOR == "tbb" ]]; then
# tbb
rm -rf tbb*
rm -rf libtbb*
wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb43_20150209oss_lin.tgz
tar -xzf tbb43_20150209oss_lin.tgz
ln -s tbb43_20150209oss/lib/intel64/gcc4.4/libtbbmalloc.so.2 libtbbmalloc.so.2
ln -s tbb43_20150209oss/lib/intel64/gcc4.4/libtbbmalloc.so.2 libtbbmalloc.so
ln -s tbb43_20150209oss/lib/intel64/gcc4.4/libtbbmalloc_proxy.so.2 libtbbmalloc_proxy.so.2
ln -s tbb43_20150209oss/lib/intel64/gcc4.4/libtbbmalloc_proxy.so.2 libtbbmalloc_proxy.so
fi
if [[ $ALLOCATOR == "tcmalloc" ]]; then
# tcmalloc
rm -rf libtcmalloc*
sudo apt-get install libtcmalloc-minimal4
ln -s /usr/lib/libtcmalloc_minimal.so.4 libtcmalloc.so
fi
if [[ $ALLOCATOR == "michael" ]]; then
sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib
# Re-implementation of Michael's allocator done by the Streamflow authors.
rm -rf michael*
rm -rf libmichael*
wget http://people.cs.vt.edu/~scschnei/streamflow/michael.tar.gz
tar -xzf michael.tar.gz
cd michael
make
cd $WD/allocators
ln -s michael/libmichael.so libmichael.so
fi
if [[ $ALLOCATOR == "streamflow" ]]; then
#streamflow
sudo apt-get install libnuma-dev
rm -rf *streamflow*
git clone git://github.com/scotts/streamflow.git
cd streamflow/
sed -i '1s/^/#include <unistd.h>\n/' malloc_new.cpp
make
cd $WD/allocators
ln -s streamflow/libstreamflow.so libstreamflow.so
fi
if [[ $ALLOCATOR == "hoard" ]]; then
#hoard
rm -rf Hoard
rm -rf libhoard*
git clone https://github.com/emeryberger/Hoard
cd Hoard
#git checkout 604d959
git submodule init
git submodule update
cd src
make Linux-gcc-x86_64
cd $WD/allocators
ln -s Hoard/src/libhoard.so libhoard.so
fi
if [[ $ALLOCATOR == "supermalloc" ]]; then
#hoard
rm -rf SuperMalloc
rm -rf libsupermalloc*
git clone https://github.com/kuszmaul/SuperMalloc.git
cd SuperMalloc/release
make
cd $WD/allocators
ln -s SuperMalloc/release/lib/libsupermalloc_pthread.so libsupermalloc.so
fi
if [[ $ALLOCATOR == "scalloc" ]]; then
#scalloc
if [ -f ../install_scalloc.sh ]; then
../install_scalloc.sh
else
rm -rf scalloc
rm -rf libscalloc.so
git clone https://github.com/cksystemsgroup/scalloc.git
cd scalloc
git checkout 0.9.0
tools/make_deps.sh
build/gyp/gyp --depth=. scalloc.gyp
BUILDTYPE=Release make
cd $WD/allocators
ln -s scalloc/out/Release/lib.target/libscalloc.so libscalloc.so
fi
fi
}
mkdir -p $WD/allocators
cd $WD/allocators
if [[ $# -ge 1 ]]; then
ALL_ALLOCATORS=$@
fi
for ARG in $ALL_ALLOCATORS; do
cd $WD/allocators
echo "Installing $ARG..."
install_allocator $ARG
done
#done
cd $WD