Skip to content
Snippets Groups Projects
Commit 29efd966 authored by Mario Melara's avatar Mario Melara
Browse files

Add crayos version detection

parent f8ef19cf
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
from spack.architecture import OperatingSystem from spack.architecture import OperatingSystem
from spack.util.executable import * from spack.util.executable import *
import spack.spec import spack.spec
import spack.version
from spack.util.multiproc import parmap from spack.util.multiproc import parmap
import spack.compilers import spack.compilers
...@@ -39,13 +40,22 @@ class Cnl(OperatingSystem): ...@@ -39,13 +40,22 @@ class Cnl(OperatingSystem):
updated to indicate that OS has been upgraded (or downgraded) updated to indicate that OS has been upgraded (or downgraded)
""" """
def detect_crayos_version(self):
modulecmd = which("modulecmd")
modulecmd.add_default_arg("python")
output = modulecmd("avail", "PrgEnv-intel", output=str, error=str)
matches = re.findall(r'PrgEnv-intel/(\d+).\d+.\d+', output)
version_set = set(matches) #
recent_version = max(version_set)
return spack.version.Version(recent_version)
def __init__(self): def __init__(self):
name = 'CNL' name = 'cnl'
version = '10' version = self.detect_crayos_version()
super(Cnl, self).__init__(name, version) super(Cnl, self).__init__(name, version)
def __str__(self): def __str__(self):
return self.name return self.name + str(self.version)
def find_compilers(self, *paths): def find_compilers(self, *paths):
types = spack.compilers.all_compiler_types() types = spack.compilers.all_compiler_types()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment