slurm: add external find (#29146)

This commit is contained in:
Seth R. Johnson 2022-03-04 04:29:05 -05:00 committed by GitHub
parent 6610c50414
commit 8665ccb661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import re
class Slurm(AutotoolsPackage):
@ -78,6 +78,14 @@ class Slurm(AutotoolsPackage):
depends_on('libyaml', when='+restd')
depends_on('libjwt', when='+restd')
executables = ['^srun$', '^salloc$']
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str).rstrip()
match = re.search(r'slurm\s*([0-9.]+)', output)
return match.group(1) if match else None
def flag_handler(self, name, flags):
wrapper_flags = None