Legion: add Rust-based profiler to install (#43408)

* legion: add missing license
* legion: add rust-based profiler to install
This commit is contained in:
Richard Berger 2024-03-27 22:25:54 -06:00 committed by GitHub
parent 6c3fed351f
commit 5d8f36d667
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 @@ def validate_gasnet_root(value):
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 @@ def cmake_args(self):
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