spack arch: add --generic argument (#27061)
The `--generic` argument allows printing the best generic target for the current machine. This can be quite handy when wanting to find the generic architecture to use when building a shared software stack for multiple machines.
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
|
||||
|
||||
def setup_parser(subparser):
|
||||
subparser.add_argument(
|
||||
'-g', '--generic-target', action='store_true',
|
||||
help='show the best generic target'
|
||||
)
|
||||
subparser.add_argument(
|
||||
'--known-targets', action='store_true',
|
||||
help='show a list of all known targets and exit'
|
||||
@@ -74,6 +78,10 @@ def display_target_group(header, target_group):
|
||||
|
||||
|
||||
def arch(parser, args):
|
||||
if args.generic_target:
|
||||
print(archspec.cpu.host().generic)
|
||||
return
|
||||
|
||||
if args.known_targets:
|
||||
display_targets(archspec.cpu.TARGETS)
|
||||
return
|
||||
|
Reference in New Issue
Block a user