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:
parent
9d3d7c68fb
commit
1e26e25bc8
@ -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
|
||||
|
@ -382,7 +382,7 @@ _spack_analyze_run() {
|
||||
}
|
||||
|
||||
_spack_arch() {
|
||||
SPACK_COMPREPLY="-h --help --known-targets -p --platform -o --operating-system -t --target -f --frontend -b --backend"
|
||||
SPACK_COMPREPLY="-h --help -g --generic-target --known-targets -p --platform -o --operating-system -t --target -f --frontend -b --backend"
|
||||
}
|
||||
|
||||
_spack_audit() {
|
||||
|
Loading…
Reference in New Issue
Block a user