2021-02-21 15:53:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-24 19:54:11 +00:00
|
|
|
##=============================================================================
|
|
|
|
##
|
|
|
|
## Copyright (c) Kitware, Inc.
|
|
|
|
## All rights reserved.
|
|
|
|
## See LICENSE.txt for details.
|
|
|
|
##
|
|
|
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
## PURPOSE. See the above copyright notice for more information.
|
|
|
|
##
|
|
|
|
##=============================================================================
|
|
|
|
|
2021-02-21 15:53:22 +00:00
|
|
|
set -xe
|
|
|
|
|
2022-01-12 16:21:13 +00:00
|
|
|
readonly version="v1.6.1"
|
2021-02-21 15:53:22 +00:00
|
|
|
readonly tarball="$version.tar.gz"
|
|
|
|
readonly url="https://github.com/google/benchmark/archive/$tarball"
|
2022-01-12 16:21:13 +00:00
|
|
|
readonly sha256sum="6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4"
|
2021-02-21 15:53:22 +00:00
|
|
|
readonly install_dir="$HOME/gbench"
|
|
|
|
|
|
|
|
if ! [[ "$VTKM_SETTINGS" =~ "benchmarks" ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$HOME"
|
|
|
|
|
|
|
|
echo "$sha256sum $tarball" > gbenchs.sha256sum
|
|
|
|
curl --insecure -OL "$url"
|
|
|
|
sha256sum --check gbenchs.sha256sum
|
|
|
|
tar xf "$tarball"
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
mkdir "$install_dir"
|
|
|
|
|
2022-07-05 23:42:16 +00:00
|
|
|
cmake -GNinja -S benchmark* -B build \
|
|
|
|
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON \
|
|
|
|
-DCMAKE_BUILD_TYPE="Release"
|
|
|
|
|
2021-02-21 15:53:22 +00:00
|
|
|
cmake --build build
|
|
|
|
cmake --install build --prefix "$install_dir"
|