def package_compiler_defaults(self, pkg):
    "Facts about packages' compiler prefs."
    packages = spack.config.get('packages')
    pkg_prefs = packages.get(pkg.name)
    if ((not pkg_prefs) or ('compiler' not in pkg_prefs)):
        return
    compiler_list = self.possible_compilers.copy()
    compiler_list = sorted(compiler_list, key=(lambda x: (x.name, x.version)), reverse=True)
    ppk = spack.package_prefs.PackagePrefs(pkg.name, 'compiler', all=False)
    matches = sorted(compiler_list, key=ppk)
    for (i, cspec) in enumerate(reversed(matches)):
        self.gen.fact(fn.node_compiler_preference(pkg.name, cspec.name, cspec.version, ((- i) * 100)))
Facts about packages' compiler prefs.
def package_compiler_defaults(self, pkg):
    
    packages = spack.config.get('packages')
    pkg_prefs = packages.get(pkg.name)
    if ((not pkg_prefs) or ('compiler' not in pkg_prefs)):
        return
    compiler_list = self.possible_compilers.copy()
    compiler_list = sorted(compiler_list, key=(lambda x: (x.name, x.version)), reverse=True)
    ppk = spack.package_prefs.PackagePrefs(pkg.name, 'compiler', all=False)
    matches = sorted(compiler_list, key=ppk)
    for (i, cspec) in enumerate(reversed(matches)):
        self.gen.fact(fn.node_compiler_preference(pkg.name, cspec.name, cspec.version, ((- i) * 100)))