2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
2019-06-17 14:31:41 -07:00
|
|
|
|
2020-08-28 12:34:25 -07:00
|
|
|
PERF_LIBS_VERSION=v0.19.3
|
2019-09-26 13:36:51 -07:00
|
|
|
VERSION=$PERF_LIBS_VERSION-1
|
2019-06-17 14:31:41 -07:00
|
|
|
|
2018-11-11 08:19:04 -08:00
|
|
|
set -e
|
2019-05-24 09:28:52 -07:00
|
|
|
cd "$(dirname "$0")"
|
2018-06-20 15:11:59 -07:00
|
|
|
|
2020-06-14 12:35:06 -07:00
|
|
|
if [[ $VERSION != "$(cat target/perf-libs/.version 2> /dev/null)" ]]; then
|
2019-05-24 09:28:52 -07:00
|
|
|
if [[ $(uname) != Linux ]]; then
|
2019-09-26 13:36:51 -07:00
|
|
|
echo Note: Performance libraries are only available for Linux
|
|
|
|
exit 0
|
2019-05-24 09:28:52 -07:00
|
|
|
fi
|
2018-06-20 15:11:59 -07:00
|
|
|
|
2019-05-24 09:28:52 -07:00
|
|
|
if [[ $(uname -m) != x86_64 ]]; then
|
2019-09-26 13:36:51 -07:00
|
|
|
echo Note: Performance libraries are only available for x86_64 architecture
|
|
|
|
exit 0
|
2019-05-24 09:28:52 -07:00
|
|
|
fi
|
2018-06-20 15:11:59 -07:00
|
|
|
|
2020-06-14 12:35:06 -07:00
|
|
|
rm -rf target/perf-libs
|
2019-05-24 09:28:52 -07:00
|
|
|
mkdir -p target/perf-libs
|
2018-08-16 18:49:23 -07:00
|
|
|
(
|
|
|
|
set -x
|
2019-05-24 18:06:38 -07:00
|
|
|
cd target/perf-libs
|
2020-04-07 13:13:45 -07:00
|
|
|
|
|
|
|
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
|
2019-06-18 08:24:41 -07:00
|
|
|
tar zxvf solana-perf.tgz
|
2020-04-07 13:13:45 -07:00
|
|
|
|
|
|
|
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
|
2020-06-14 12:35:06 -07:00
|
|
|
echo "$VERSION" > .version
|
2018-08-16 18:49:23 -07:00
|
|
|
)
|
2018-11-12 17:50:16 -08:00
|
|
|
|
2019-09-26 13:36:51 -07:00
|
|
|
# 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
|
2019-06-19 08:29:56 -07:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2019-06-18 21:17:20 -07:00
|
|
|
exit 0
|