Add spack arch --operating-system and --target flags
This commit is contained in:
parent
febfa60935
commit
4f76e80925
@ -35,11 +35,24 @@ def setup_parser(subparser):
|
|||||||
parts = subparser.add_mutually_exclusive_group()
|
parts = subparser.add_mutually_exclusive_group()
|
||||||
parts.add_argument(
|
parts.add_argument(
|
||||||
'-p', '--platform', action='store_true', default=False,
|
'-p', '--platform', action='store_true', default=False,
|
||||||
help="print only the platform")
|
help='print only the platform')
|
||||||
|
parts.add_argument(
|
||||||
|
'-o', '--operating-system', action='store_true', default=False,
|
||||||
|
help='print only the operating system')
|
||||||
|
parts.add_argument(
|
||||||
|
'-t', '--target', action='store_true', default=False,
|
||||||
|
help='print only the target')
|
||||||
|
|
||||||
|
|
||||||
def arch(parser, args):
|
def arch(parser, args):
|
||||||
|
arch = architecture.Arch(
|
||||||
|
architecture.platform(), 'default_os', 'default_target')
|
||||||
|
|
||||||
if args.platform:
|
if args.platform:
|
||||||
print(architecture.platform())
|
print(arch.platform)
|
||||||
|
elif args.operating_system:
|
||||||
|
print(arch.platform_os)
|
||||||
|
elif args.target:
|
||||||
|
print(arch.target)
|
||||||
else:
|
else:
|
||||||
print(architecture.sys_type())
|
print(arch)
|
||||||
|
@ -59,9 +59,9 @@
|
|||||||
@B{variant=value1,value2,value3} set multi-value <variant> values
|
@B{variant=value1,value2,value3} set multi-value <variant> values
|
||||||
|
|
||||||
architecture variants:
|
architecture variants:
|
||||||
@m{target=target} specific <target> processor
|
|
||||||
@m{os=operating_system} specific <operating_system>
|
|
||||||
@m{platform=platform} linux, darwin, cray, bgq, etc.
|
@m{platform=platform} linux, darwin, cray, bgq, etc.
|
||||||
|
@m{os=operating_system} specific <operating_system>
|
||||||
|
@m{target=target} specific <target> processor
|
||||||
@m{arch=platform-os-target} shortcut for all three above
|
@m{arch=platform-os-target} shortcut for all three above
|
||||||
|
|
||||||
cross-compiling:
|
cross-compiling:
|
||||||
|
@ -29,6 +29,27 @@
|
|||||||
|
|
||||||
|
|
||||||
def test_arch():
|
def test_arch():
|
||||||
"""Sanity check the arch command to make sure it works."""
|
"""Sanity check ``spack arch`` to make sure it works."""
|
||||||
|
|
||||||
arch()
|
arch()
|
||||||
|
|
||||||
|
|
||||||
|
def test_arch_platform():
|
||||||
|
"""Sanity check ``spack arch --platform`` to make sure it works."""
|
||||||
|
|
||||||
|
arch('-p')
|
||||||
|
arch('--platform')
|
||||||
|
|
||||||
|
|
||||||
|
def test_arch_operating_system():
|
||||||
|
"""Sanity check ``spack arch --operating-system`` to make sure it works."""
|
||||||
|
|
||||||
|
arch('-o')
|
||||||
|
arch('--operating-system')
|
||||||
|
|
||||||
|
|
||||||
|
def test_arch_target():
|
||||||
|
"""Sanity check ``spack arch --target`` to make sure it works."""
|
||||||
|
|
||||||
|
arch('-t')
|
||||||
|
arch('--target')
|
||||||
|
Loading…
Reference in New Issue
Block a user