forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch-perf-libs.sh
executable file
·51 lines (41 loc) · 1.32 KB
/
fetch-perf-libs.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
#!/usr/bin/env bash
PERF_LIBS_VERSION=v0.19.1
VERSION=$PERF_LIBS_VERSION-1
set -e
cd "$(dirname "$0")"
if [[ $VERSION != "$(cat target/perf-libs/.version 2> /dev/null)" ]]; then
if [[ $(uname) != Linux ]]; then
echo Note: Performance libraries are only available for Linux
exit 0
fi
if [[ $(uname -m) != x86_64 ]]; then
echo Note: Performance libraries are only available for x86_64 architecture
exit 0
fi
rm -rf target/perf-libs
mkdir -p target/perf-libs
(
set -x
cd target/perf-libs
if [[ -r ~/.cache/solana-perf-$PERF_LIBS_VERSION.tgz ]]; then
cp ~/.cache/solana-perf-$PERF_LIBS_VERSION.tgz solana-perf.tgz
else
curl -L --retry 5 --retry-delay 2 --retry-connrefused -o solana-perf.tgz \
https://github.com/solana-labs/solana-perf-libs/releases/download/$PERF_LIBS_VERSION/solana-perf.tgz
fi
tar zxvf solana-perf.tgz
if [[ ! -r ~/.cache/solana-perf-$PERF_LIBS_VERSION.tgz ]]; then
# Save it for next time
mkdir -p ~/.cache
mv solana-perf.tgz ~/.cache/solana-perf-$PERF_LIBS_VERSION.tgz
fi
echo "$VERSION" > .version
)
# Setup symlinks so the perf-libs/ can be found from all binaries run out of
# target/
for dir in target/{debug,release}/{,deps/}; do
mkdir -p $dir
ln -sfT ../perf-libs ${dir}perf-libs
done
fi
exit 0