From 5d8f36d6675a7c48049fb84e710e6f18a23fb294 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 27 Mar 2024 22:25:54 -0600 Subject: Legion: add Rust-based profiler to install (#43408) * legion: add missing license * legion: add rust-based profiler to install --- var/spack/repos/builtin/packages/legion/package.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index 2437a8c1f0..b6dd29a5cf 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -25,6 +25,8 @@ class Legion(CMakePackage, ROCmPackage): homepage = "https://legion.stanford.edu/" git = "https://github.com/StanfordLegion/legion.git" + license("Apache-2.0") + maintainers("pmccormick", "streichler", "elliottslaughter") tags = ["e4s"] version("24.03.0", tag="legion-24.03.0", commit="c61071541218747e35767317f6f89b83f374f264") @@ -277,6 +279,9 @@ class Legion(CMakePackage, ROCmPackage): default=1024, description="Maximum number of nodes supported by Legion.", ) + variant("prof", default=False, description="Install Rust Legion prof") + + depends_on("rust@1.74:", type="build", when="+prof") def cmake_args(self): spec = self.spec @@ -438,6 +443,19 @@ class Legion(CMakePackage, ROCmPackage): options.append("-DBUILD_MARCH:STRING=") return options + def build(self, spec, prefix): + super().build(spec, prefix) + if spec.satisfies("+prof"): + with working_dir(join_path(self.stage.source_path, "tools", "legion_prof_rs")): + cargo = which("cargo") + cargo("install", "--root", "out", "--path", ".", "--all-features", "--locked") + + def install(self, spec, prefix): + super().install(spec, prefix) + if spec.satisfies("+prof"): + with working_dir(join_path(self.stage.source_path, "tools", "legion_prof_rs")): + install_tree("out", prefix) + @run_after("install") def cache_test_sources(self): """Copy the example source files after the package is installed to an -- cgit v1.2.3-70-g09d2