diff options
Diffstat (limited to 'src/pmdk/utils/docker/images/install-valgrind.sh')
-rwxr-xr-x | src/pmdk/utils/docker/images/install-valgrind.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/pmdk/utils/docker/images/install-valgrind.sh b/src/pmdk/utils/docker/images/install-valgrind.sh new file mode 100755 index 000000000..97babcb67 --- /dev/null +++ b/src/pmdk/utils/docker/images/install-valgrind.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2016-2020, Intel Corporation + +# +# install-valgrind.sh - installs valgrind for persistent memory +# + +set -e + +OS=$1 + +install_upstream_from_distro() { + case "$OS" in + fedora) dnf install -y valgrind ;; + ubuntu) apt-get install -y --no-install-recommends valgrind ;; + *) return 1 ;; + esac +} + +install_upstream_3_16_1() { + git clone git://sourceware.org/git/valgrind.git + cd valgrind + # valgrind v3.16.1 upstream + git checkout VALGRIND_3_16_BRANCH + ./autogen.sh + ./configure + make -j$(nproc) + make -j$(nproc) install + cd .. + rm -rf valgrind +} + +install_custom-pmem_from_source() { + git clone https://github.com/pmem/valgrind.git + cd valgrind + # valgrind v3.15 with pmemcheck + # 2020.04.01 Merge pull request #78 from marcinslusarz/opt3 + git checkout 759686fd66cc0105df8311cfe676b0b2f9e89196 + ./autogen.sh + ./configure + make -j$(nproc) + make -j$(nproc) install + cd .. + rm -rf valgrind +} + +ARCH=$(uname -m) +case "$ARCH" in + ppc64le) install_upstream_3_16_1 ;; + *) install_custom-pmem_from_source ;; +esac |