summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Hahn <hahnse@ornl.gov>2024-02-22 01:29:49 -0500
committerGitHub <noreply@github.com>2024-02-22 07:29:49 +0100
commit02f222f6a3e70664850909580ccf7706855732bc (patch)
tree8ff7cf63e9f828e742f423031ab50bd2d1b07d6f
parent8345c6fb852210bc438d3f4881d965f0dc673b76 (diff)
downloadspack-02f222f6a3e70664850909580ccf7706855732bc.tar.gz
spack-02f222f6a3e70664850909580ccf7706855732bc.tar.bz2
spack-02f222f6a3e70664850909580ccf7706855732bc.tar.xz
spack-02f222f6a3e70664850909580ccf7706855732bc.zip
google benchmark: Add variant with libpfm4 (#42620)
Signed-off-by: Steven Hahn <hahnse@ornl.gov>
-rw-r--r--var/spack/repos/builtin/packages/benchmark/package.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/benchmark/package.py b/var/spack/repos/builtin/packages/benchmark/package.py
index 31b0ee915b..0e8fe59019 100644
--- a/var/spack/repos/builtin/packages/benchmark/package.py
+++ b/var/spack/repos/builtin/packages/benchmark/package.py
@@ -44,14 +44,24 @@ class Benchmark(CMakePackage):
description="The build type to build",
values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel", "Coverage"),
)
+ variant(
+ "performance_counters",
+ default=True,
+ when="@1.5.4:",
+ description="Enable performance counters provided by libpfm",
+ )
depends_on("cmake@2.8.11:", type="build", when="@:1.1.0")
depends_on("cmake@2.8.12:", type="build", when="@1.2.0:1.4")
depends_on("cmake@3.5.1:", type="build", when="@1.5.0:")
+ depends_on("libpfm4", type=("build", "link"), when="+performance_counters")
def cmake_args(self):
# No need for testing for the install
- args = ["-DBENCHMARK_ENABLE_TESTING=OFF"]
+ args = [
+ self.define("BENCHMARK_ENABLE_TESTING", False),
+ self.define_from_variant("BENCHMARK_ENABLE_LIBPFM", "performance_counters"),
+ ]
return args
def patch(self):