Compare commits
15 Commits
hs/fix/spe
...
hs/rocm-op
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eff56cd845 | ||
|
|
9747978c7f | ||
|
|
f043455ccc | ||
|
|
fb9d6427e6 | ||
|
|
76e83e10c1 | ||
|
|
af89bdf632 | ||
|
|
46f5b192ef | ||
|
|
18cd922aab | ||
|
|
5518ad9611 | ||
|
|
57a1807443 | ||
|
|
3909308d5c | ||
|
|
54210270c8 | ||
|
|
1a71bb046e | ||
|
|
dbd6857d32 | ||
|
|
025bc24996 |
@@ -63,3 +63,7 @@ concretizer:
|
||||
# Setting this to false yields unreproducible results, so we advise to use that value only
|
||||
# for debugging purposes (e.g. check which constraints can help Spack concretize faster).
|
||||
error_on_timeout: true
|
||||
|
||||
# Static analysis may reduce the concretization time by generating smaller ASP problems, in
|
||||
# cases where there are requirements that prevent part of the search space to be explored.
|
||||
static_analysis: false
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
import spack.cmd
|
||||
import spack.environment as ev
|
||||
import spack.package_base
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
from spack.solver.input_analysis import create_graph_analyzer
|
||||
|
||||
description = "show dependencies of a package"
|
||||
section = "basic"
|
||||
@@ -68,15 +68,17 @@ def dependencies(parser, args):
|
||||
|
||||
else:
|
||||
spec = specs[0]
|
||||
dependencies = spack.package_base.possible_dependencies(
|
||||
dependencies, virtuals, _ = create_graph_analyzer().possible_dependencies(
|
||||
spec,
|
||||
transitive=args.transitive,
|
||||
expand_virtuals=args.expand_virtuals,
|
||||
depflag=args.deptype,
|
||||
allowed_deps=args.deptype,
|
||||
)
|
||||
if not args.expand_virtuals:
|
||||
dependencies.update(virtuals)
|
||||
|
||||
if spec.name in dependencies:
|
||||
del dependencies[spec.name]
|
||||
dependencies.remove(spec.name)
|
||||
|
||||
if dependencies:
|
||||
colify(sorted(dependencies))
|
||||
|
||||
@@ -125,7 +125,7 @@ def develop(parser, args):
|
||||
version = spec.versions.concrete_range_as_version
|
||||
if not version:
|
||||
# look up the maximum version so infintiy versions are preferred for develop
|
||||
version = max(spec.package_class.versions.keys())
|
||||
version = max(spack.repo.PATH.get_pkg_class(spec.fullname).versions.keys())
|
||||
tty.msg(f"Defaulting to highest version: {spec.name}@{version}")
|
||||
spec.versions = spack.version.VersionList([version])
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ def _not_license_excluded(self, x):
|
||||
package does not explicitly forbid redistributing source."""
|
||||
if self.private:
|
||||
return True
|
||||
elif x.package_class.redistribute_source(x):
|
||||
elif spack.repo.PATH.get_pkg_class(x.fullname).redistribute_source(x):
|
||||
return True
|
||||
else:
|
||||
tty.debug(
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.config
|
||||
import spack.error
|
||||
import spack.repo
|
||||
import spack.util.path
|
||||
from spack.cmd.common import arguments
|
||||
@@ -130,7 +129,7 @@ def repo_remove(args):
|
||||
spack.config.set("repos", repos, args.scope)
|
||||
tty.msg("Removed repository %s with namespace '%s'." % (repo.root, repo.namespace))
|
||||
return
|
||||
except spack.error.RepoError:
|
||||
except spack.repo.RepoError:
|
||||
continue
|
||||
|
||||
tty.die("No repository with path or namespace: %s" % namespace_or_path)
|
||||
@@ -143,7 +142,7 @@ def repo_list(args):
|
||||
for r in roots:
|
||||
try:
|
||||
repos.append(spack.repo.from_path(r))
|
||||
except spack.error.RepoError:
|
||||
except spack.repo.RepoError:
|
||||
continue
|
||||
|
||||
if sys.stdout.isatty():
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from itertools import zip_longest
|
||||
from itertools import islice, zip_longest
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import llnl.util.tty as tty
|
||||
@@ -423,7 +423,8 @@ def _run_import_check(
|
||||
continue
|
||||
|
||||
for m in is_abs_import.finditer(contents):
|
||||
if contents.count(m.group(1)) == 1:
|
||||
# Find at most two occurences: the first is the import itself, the second is its usage.
|
||||
if len(list(islice(re.finditer(rf"{re.escape(m.group(1))}(?!\w)", contents), 2))) == 1:
|
||||
to_remove.append(m.group(0))
|
||||
exit_code = 1
|
||||
print(f"{pretty_path}: redundant import: {m.group(1)}", file=out)
|
||||
@@ -438,7 +439,7 @@ def _run_import_check(
|
||||
module = _module_part(root, m.group(0))
|
||||
if not module or module in to_add:
|
||||
continue
|
||||
if re.search(rf"import {re.escape(module)}\b(?!\.)", contents):
|
||||
if re.search(rf"import {re.escape(module)}(?!\w|\.)", contents):
|
||||
continue
|
||||
to_add.add(module)
|
||||
exit_code = 1
|
||||
|
||||
@@ -252,7 +252,9 @@ def has_test_and_tags(pkg_class):
|
||||
hashes = env.all_hashes() if env else None
|
||||
|
||||
specs = spack.store.STORE.db.query(hashes=hashes)
|
||||
specs = list(filter(lambda s: has_test_and_tags(s.package_class), specs))
|
||||
specs = list(
|
||||
filter(lambda s: has_test_and_tags(spack.repo.PATH.get_pkg_class(s.fullname)), specs)
|
||||
)
|
||||
|
||||
spack.cmd.display_specs(specs, long=True)
|
||||
|
||||
|
||||
@@ -202,11 +202,3 @@ class MirrorError(SpackError):
|
||||
|
||||
def __init__(self, msg, long_msg=None):
|
||||
super().__init__(msg, long_msg)
|
||||
|
||||
|
||||
class RepoError(SpackError):
|
||||
"""Superclass for repository-related errors."""
|
||||
|
||||
|
||||
class UnknownEntityError(RepoError):
|
||||
"""Raised when we encounter a package spack doesn't have."""
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
import llnl.util.tty.color
|
||||
|
||||
import spack.deptypes as dt
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.tengine
|
||||
import spack.traverse
|
||||
from spack.solver.input_analysis import create_graph_analyzer
|
||||
|
||||
|
||||
def find(seq, predicate):
|
||||
@@ -537,10 +537,11 @@ def edge_entry(self, edge):
|
||||
|
||||
def _static_edges(specs, depflag):
|
||||
for spec in specs:
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(spec.name)
|
||||
possible = pkg_cls.possible_dependencies(expand_virtuals=True, depflag=depflag)
|
||||
*_, edges = create_graph_analyzer().possible_dependencies(
|
||||
spec.name, expand_virtuals=True, allowed_deps=depflag
|
||||
)
|
||||
|
||||
for parent_name, dependencies in possible.items():
|
||||
for parent_name, dependencies in edges.items():
|
||||
for dependency_name in dependencies:
|
||||
yield spack.spec.DependencySpec(
|
||||
spack.spec.Spec(parent_name),
|
||||
|
||||
@@ -566,7 +566,7 @@ def copy_test_files(pkg: Pb, test_spec: spack.spec.Spec):
|
||||
|
||||
# copy test data into test stage data dir
|
||||
try:
|
||||
pkg_cls = test_spec.package_class
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(test_spec.fullname)
|
||||
except spack.repo.UnknownPackageError:
|
||||
tty.debug(f"{test_spec.name}: skipping test data copy since no package class found")
|
||||
return
|
||||
@@ -623,7 +623,7 @@ def test_functions(
|
||||
vpkgs = virtuals(pkg)
|
||||
for vname in vpkgs:
|
||||
try:
|
||||
classes.append((Spec(vname)).package_class)
|
||||
classes.append(spack.repo.PATH.get_pkg_class(vname))
|
||||
except spack.repo.UnknownPackageError:
|
||||
tty.debug(f"{vname}: virtual does not appear to have a package file")
|
||||
|
||||
@@ -668,7 +668,7 @@ def process_test_parts(pkg: Pb, test_specs: List[spack.spec.Spec], verbose: bool
|
||||
|
||||
# grab test functions associated with the spec, which may be virtual
|
||||
try:
|
||||
tests = test_functions(spec.package_class)
|
||||
tests = test_functions(spack.repo.PATH.get_pkg_class(spec.fullname))
|
||||
except spack.repo.UnknownPackageError:
|
||||
# Some virtuals don't have a package so we don't want to report
|
||||
# them as not having tests when that isn't appropriate.
|
||||
|
||||
@@ -560,7 +560,7 @@ def dump_packages(spec: "spack.spec.Spec", path: str) -> None:
|
||||
try:
|
||||
source_repo = spack.repo.from_path(source_repo_root)
|
||||
source_pkg_dir = source_repo.dirname_for_package_name(node.name)
|
||||
except spack.error.RepoError as err:
|
||||
except spack.repo.RepoError as err:
|
||||
tty.debug(f"Failed to create source repo for {node.name}: {str(err)}")
|
||||
source_pkg_dir = None
|
||||
tty.warn(f"Warning: Couldn't copy in provenance for {node.name}")
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import textwrap
|
||||
import time
|
||||
import traceback
|
||||
import typing
|
||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union
|
||||
|
||||
from typing_extensions import Literal
|
||||
@@ -710,19 +709,6 @@ class PackageBase(WindowsRPath, PackageViewMixin, metaclass=PackageMeta):
|
||||
#: Do not include @ here in order not to unnecessarily ping the users.
|
||||
maintainers: List[str] = []
|
||||
|
||||
#: List of attributes to be excluded from a package's hash.
|
||||
metadata_attrs = [
|
||||
"homepage",
|
||||
"url",
|
||||
"urls",
|
||||
"list_url",
|
||||
"extendable",
|
||||
"parallel",
|
||||
"make_jobs",
|
||||
"maintainers",
|
||||
"tags",
|
||||
]
|
||||
|
||||
#: Set to ``True`` to indicate the stand-alone test requires a compiler.
|
||||
#: It is used to ensure a compiler and build dependencies like 'cmake'
|
||||
#: are available to build a custom test code.
|
||||
@@ -822,104 +808,6 @@ def get_variant(self, name: str) -> spack.variant.Variant:
|
||||
except StopIteration:
|
||||
raise ValueError(f"No variant '{name}' on spec: {self.spec}")
|
||||
|
||||
@classmethod
|
||||
def possible_dependencies(
|
||||
cls,
|
||||
transitive: bool = True,
|
||||
expand_virtuals: bool = True,
|
||||
depflag: dt.DepFlag = dt.ALL,
|
||||
visited: Optional[dict] = None,
|
||||
missing: Optional[dict] = None,
|
||||
virtuals: Optional[set] = None,
|
||||
) -> Dict[str, Set[str]]:
|
||||
"""Return dict of possible dependencies of this package.
|
||||
|
||||
Args:
|
||||
transitive (bool or None): return all transitive dependencies if
|
||||
True, only direct dependencies if False (default True)..
|
||||
expand_virtuals (bool or None): expand virtual dependencies into
|
||||
all possible implementations (default True)
|
||||
depflag: dependency types to consider
|
||||
visited (dict or None): dict of names of dependencies visited so
|
||||
far, mapped to their immediate dependencies' names.
|
||||
missing (dict or None): dict to populate with packages and their
|
||||
*missing* dependencies.
|
||||
virtuals (set): if provided, populate with virtuals seen so far.
|
||||
|
||||
Returns:
|
||||
(dict): dictionary mapping dependency names to *their*
|
||||
immediate dependencies
|
||||
|
||||
Each item in the returned dictionary maps a (potentially
|
||||
transitive) dependency of this package to its possible
|
||||
*immediate* dependencies. If ``expand_virtuals`` is ``False``,
|
||||
virtual package names wil be inserted as keys mapped to empty
|
||||
sets of dependencies. Virtuals, if not expanded, are treated as
|
||||
though they have no immediate dependencies.
|
||||
|
||||
Missing dependencies by default are ignored, but if a
|
||||
missing dict is provided, it will be populated with package names
|
||||
mapped to any dependencies they have that are in no
|
||||
repositories. This is only populated if transitive is True.
|
||||
|
||||
Note: the returned dict *includes* the package itself.
|
||||
|
||||
"""
|
||||
visited = {} if visited is None else visited
|
||||
missing = {} if missing is None else missing
|
||||
|
||||
visited.setdefault(cls.name, set())
|
||||
|
||||
for name, conditions in cls.dependencies_by_name(when=True).items():
|
||||
# check whether this dependency could be of the type asked for
|
||||
depflag_union = 0
|
||||
for deplist in conditions.values():
|
||||
for dep in deplist:
|
||||
depflag_union |= dep.depflag
|
||||
if not (depflag & depflag_union):
|
||||
continue
|
||||
|
||||
# expand virtuals if enabled, otherwise just stop at virtuals
|
||||
if spack.repo.PATH.is_virtual(name):
|
||||
if virtuals is not None:
|
||||
virtuals.add(name)
|
||||
if expand_virtuals:
|
||||
providers = spack.repo.PATH.providers_for(name)
|
||||
dep_names = [spec.name for spec in providers]
|
||||
else:
|
||||
visited.setdefault(cls.name, set()).add(name)
|
||||
visited.setdefault(name, set())
|
||||
continue
|
||||
else:
|
||||
dep_names = [name]
|
||||
|
||||
# add the dependency names to the visited dict
|
||||
visited.setdefault(cls.name, set()).update(set(dep_names))
|
||||
|
||||
# recursively traverse dependencies
|
||||
for dep_name in dep_names:
|
||||
if dep_name in visited:
|
||||
continue
|
||||
|
||||
visited.setdefault(dep_name, set())
|
||||
|
||||
# skip the rest if not transitive
|
||||
if not transitive:
|
||||
continue
|
||||
|
||||
try:
|
||||
dep_cls = spack.repo.PATH.get_pkg_class(dep_name)
|
||||
except spack.repo.UnknownPackageError:
|
||||
# log unknown packages
|
||||
missing.setdefault(cls.name, set()).add(dep_name)
|
||||
continue
|
||||
|
||||
dep_cls.possible_dependencies(
|
||||
transitive, expand_virtuals, depflag, visited, missing, virtuals
|
||||
)
|
||||
|
||||
return visited
|
||||
|
||||
@classproperty
|
||||
def package_dir(cls):
|
||||
"""Directory where the package.py file lives."""
|
||||
@@ -2109,7 +1997,7 @@ def uninstall_by_spec(spec, force=False, deprecator=None):
|
||||
# Try to get the package for the spec
|
||||
try:
|
||||
pkg = spec.package
|
||||
except spack.error.UnknownEntityError:
|
||||
except spack.repo.UnknownEntityError:
|
||||
pkg = None
|
||||
|
||||
# Pre-uninstall hook runs first.
|
||||
@@ -2284,47 +2172,6 @@ def rpath_args(self):
|
||||
build_system_flags = PackageBase.build_system_flags
|
||||
|
||||
|
||||
def possible_dependencies(
|
||||
*pkg_or_spec: Union[str, spack.spec.Spec, typing.Type[PackageBase]],
|
||||
transitive: bool = True,
|
||||
expand_virtuals: bool = True,
|
||||
depflag: dt.DepFlag = dt.ALL,
|
||||
missing: Optional[dict] = None,
|
||||
virtuals: Optional[set] = None,
|
||||
) -> Dict[str, Set[str]]:
|
||||
"""Get the possible dependencies of a number of packages.
|
||||
|
||||
See ``PackageBase.possible_dependencies`` for details.
|
||||
"""
|
||||
packages = []
|
||||
for pos in pkg_or_spec:
|
||||
if isinstance(pos, PackageMeta) and issubclass(pos, PackageBase):
|
||||
packages.append(pos)
|
||||
continue
|
||||
|
||||
if not isinstance(pos, spack.spec.Spec):
|
||||
pos = spack.spec.Spec(pos)
|
||||
|
||||
if spack.repo.PATH.is_virtual(pos.name):
|
||||
packages.extend(p.package_class for p in spack.repo.PATH.providers_for(pos.name))
|
||||
continue
|
||||
else:
|
||||
packages.append(pos.package_class)
|
||||
|
||||
visited: Dict[str, Set[str]] = {}
|
||||
for pkg in packages:
|
||||
pkg.possible_dependencies(
|
||||
visited=visited,
|
||||
transitive=transitive,
|
||||
expand_virtuals=expand_virtuals,
|
||||
depflag=depflag,
|
||||
missing=missing,
|
||||
virtuals=virtuals,
|
||||
)
|
||||
|
||||
return visited
|
||||
|
||||
|
||||
def deprecated_version(pkg: PackageBase, version: Union[str, StandardVersion]) -> bool:
|
||||
"""Return True iff the version is deprecated.
|
||||
|
||||
|
||||
@@ -663,7 +663,7 @@ def __init__(
|
||||
repo = Repo(repo, cache=cache, overrides=overrides)
|
||||
repo.finder(self)
|
||||
self.put_last(repo)
|
||||
except spack.error.RepoError as e:
|
||||
except RepoError as e:
|
||||
tty.warn(
|
||||
f"Failed to initialize repository: '{repo}'.",
|
||||
e.message,
|
||||
@@ -1241,7 +1241,7 @@ def get_pkg_class(self, pkg_name: str) -> Type["spack.package_base.PackageBase"]
|
||||
raise UnknownPackageError(fullname)
|
||||
except Exception as e:
|
||||
msg = f"cannot load package '{pkg_name}' from the '{self.namespace}' repository: {e}"
|
||||
raise spack.error.RepoError(msg) from e
|
||||
raise RepoError(msg) from e
|
||||
|
||||
cls = getattr(module, class_name)
|
||||
if not isinstance(cls, type):
|
||||
@@ -1501,19 +1501,27 @@ def recipe_filename(self, name):
|
||||
return os.path.join(self.root, "packages", name, "package.py")
|
||||
|
||||
|
||||
class NoRepoConfiguredError(spack.error.RepoError):
|
||||
class RepoError(spack.error.SpackError):
|
||||
"""Superclass for repository-related errors."""
|
||||
|
||||
|
||||
class NoRepoConfiguredError(RepoError):
|
||||
"""Raised when there are no repositories configured."""
|
||||
|
||||
|
||||
class InvalidNamespaceError(spack.error.RepoError):
|
||||
class InvalidNamespaceError(RepoError):
|
||||
"""Raised when an invalid namespace is encountered."""
|
||||
|
||||
|
||||
class BadRepoError(spack.error.RepoError):
|
||||
class BadRepoError(RepoError):
|
||||
"""Raised when repo layout is invalid."""
|
||||
|
||||
|
||||
class UnknownPackageError(spack.error.UnknownEntityError):
|
||||
class UnknownEntityError(RepoError):
|
||||
"""Raised when we encounter a package spack doesn't have."""
|
||||
|
||||
|
||||
class UnknownPackageError(UnknownEntityError):
|
||||
"""Raised when we encounter a package spack doesn't have."""
|
||||
|
||||
def __init__(self, name, repo=None):
|
||||
@@ -1550,7 +1558,7 @@ def __init__(self, name, repo=None):
|
||||
self.name = name
|
||||
|
||||
|
||||
class UnknownNamespaceError(spack.error.UnknownEntityError):
|
||||
class UnknownNamespaceError(UnknownEntityError):
|
||||
"""Raised when we encounter an unknown namespace"""
|
||||
|
||||
def __init__(self, namespace, name=None):
|
||||
@@ -1560,7 +1568,7 @@ def __init__(self, namespace, name=None):
|
||||
super().__init__(msg, long_msg)
|
||||
|
||||
|
||||
class FailedConstructorError(spack.error.RepoError):
|
||||
class FailedConstructorError(RepoError):
|
||||
"""Raised when a package's class constructor fails."""
|
||||
|
||||
def __init__(self, name, exc_type, exc_obj, exc_tb):
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
"strategy": {"type": "string", "enum": ["none", "minimal", "full"]}
|
||||
},
|
||||
},
|
||||
"static_analysis": {"type": "boolean"},
|
||||
"timeout": {"type": "integer", "minimum": 0},
|
||||
"error_on_timeout": {"type": "boolean"},
|
||||
"os_compatible": {"type": "object", "additionalProperties": {"type": "array"}},
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
parse_files,
|
||||
parse_term,
|
||||
)
|
||||
from .counter import FullDuplicatesCounter, MinimalDuplicatesCounter, NoDuplicatesCounter
|
||||
from .input_analysis import create_counter, create_graph_analyzer
|
||||
from .requirements import RequirementKind, RequirementParser, RequirementRule
|
||||
from .version_order import concretization_version_order
|
||||
|
||||
@@ -271,15 +271,6 @@ def remove_node(spec: spack.spec.Spec, facts: List[AspFunction]) -> List[AspFunc
|
||||
return list(filter(lambda x: x.args[0] not in ("node", "virtual_node"), facts))
|
||||
|
||||
|
||||
def _create_counter(specs: List[spack.spec.Spec], tests: bool):
|
||||
strategy = spack.config.CONFIG.get("concretizer:duplicates:strategy", "none")
|
||||
if strategy == "full":
|
||||
return FullDuplicatesCounter(specs, tests=tests)
|
||||
if strategy == "minimal":
|
||||
return MinimalDuplicatesCounter(specs, tests=tests)
|
||||
return NoDuplicatesCounter(specs, tests=tests)
|
||||
|
||||
|
||||
def all_libcs() -> Set[spack.spec.Spec]:
|
||||
"""Return a set of all libc specs targeted by any configured compiler. If none, fall back to
|
||||
libc determined from the current Python process if dynamically linked."""
|
||||
@@ -1121,6 +1112,8 @@ class SpackSolverSetup:
|
||||
"""Class to set up and run a Spack concretization solve."""
|
||||
|
||||
def __init__(self, tests: bool = False):
|
||||
self.possible_graph = create_graph_analyzer()
|
||||
|
||||
# these are all initialized in setup()
|
||||
self.gen: "ProblemInstanceBuilder" = ProblemInstanceBuilder()
|
||||
self.requirement_parser = RequirementParser(spack.config.CONFIG)
|
||||
@@ -2397,38 +2390,20 @@ def keyfun(os):
|
||||
|
||||
def target_defaults(self, specs):
|
||||
"""Add facts about targets and target compatibility."""
|
||||
self.gen.h2("Default target")
|
||||
|
||||
platform = spack.platforms.host()
|
||||
uarch = archspec.cpu.TARGETS.get(platform.default)
|
||||
|
||||
self.gen.h2("Target compatibility")
|
||||
|
||||
# Construct the list of targets which are compatible with the host
|
||||
candidate_targets = [uarch] + uarch.ancestors
|
||||
|
||||
# Get configuration options
|
||||
granularity = spack.config.get("concretizer:targets:granularity")
|
||||
host_compatible = spack.config.get("concretizer:targets:host_compatible")
|
||||
|
||||
# Add targets which are not compatible with the current host
|
||||
if not host_compatible:
|
||||
additional_targets_in_family = sorted(
|
||||
[
|
||||
t
|
||||
for t in archspec.cpu.TARGETS.values()
|
||||
if (t.family.name == uarch.family.name and t not in candidate_targets)
|
||||
],
|
||||
key=lambda x: len(x.ancestors),
|
||||
reverse=True,
|
||||
)
|
||||
candidate_targets += additional_targets_in_family
|
||||
|
||||
# Check if we want only generic architecture
|
||||
if granularity == "generic":
|
||||
candidate_targets = [t for t in candidate_targets if t.vendor == "generic"]
|
||||
|
||||
# Add targets explicitly requested from specs
|
||||
candidate_targets = []
|
||||
for x in self.possible_graph.candidate_targets():
|
||||
if all(
|
||||
self.possible_graph.unreachable(pkg_name=pkg_name, when_spec=f"target={x}")
|
||||
for pkg_name in self.pkgs
|
||||
):
|
||||
tty.debug(f"[{__name__}] excluding target={x}, cause no package can use it")
|
||||
continue
|
||||
candidate_targets.append(x)
|
||||
|
||||
host_compatible = spack.config.CONFIG.get("concretizer:targets:host_compatible")
|
||||
for spec in specs:
|
||||
if not spec.architecture or not spec.architecture.target:
|
||||
continue
|
||||
@@ -2444,6 +2419,8 @@ def target_defaults(self, specs):
|
||||
if ancestor not in candidate_targets:
|
||||
candidate_targets.append(ancestor)
|
||||
|
||||
platform = spack.platforms.host()
|
||||
uarch = archspec.cpu.TARGETS.get(platform.default)
|
||||
best_targets = {uarch.family.name}
|
||||
for compiler_id, known_compiler in enumerate(self.possible_compilers):
|
||||
if not known_compiler.available:
|
||||
@@ -2501,7 +2478,6 @@ def target_defaults(self, specs):
|
||||
self.gen.newline()
|
||||
|
||||
self.default_targets = list(sorted(set(self.default_targets)))
|
||||
|
||||
self.target_preferences()
|
||||
|
||||
def virtual_providers(self):
|
||||
@@ -2605,7 +2581,14 @@ def define_variant_values(self):
|
||||
# Tell the concretizer about possible values from specs seen in spec_clauses().
|
||||
# We might want to order these facts by pkg and name if we are debugging.
|
||||
for pkg_name, variant_def_id, value in self.variant_values_from_specs:
|
||||
vid = self.variant_ids_by_def_id[variant_def_id]
|
||||
try:
|
||||
vid = self.variant_ids_by_def_id[variant_def_id]
|
||||
except KeyError:
|
||||
tty.debug(
|
||||
f"[{__name__}] cannot retrieve id of the {value} variant from {pkg_name}"
|
||||
)
|
||||
continue
|
||||
|
||||
self.gen.fact(fn.pkg_fact(pkg_name, fn.variant_possible_value(vid, value)))
|
||||
|
||||
def register_concrete_spec(self, spec, possible):
|
||||
@@ -2676,7 +2659,7 @@ def setup(
|
||||
"""
|
||||
check_packages_exist(specs)
|
||||
|
||||
node_counter = _create_counter(specs, tests=self.tests)
|
||||
node_counter = create_counter(specs, tests=self.tests, possible_graph=self.possible_graph)
|
||||
self.possible_virtuals = node_counter.possible_virtuals()
|
||||
self.pkgs = node_counter.possible_dependencies()
|
||||
self.libcs = sorted(all_libcs()) # type: ignore[type-var]
|
||||
@@ -3489,7 +3472,7 @@ def external_spec_selected(self, node, idx):
|
||||
self._specs[node].extra_attributes = spec_info.get("extra_attributes", {})
|
||||
|
||||
# If this is an extension, update the dependencies to include the extendee
|
||||
package = self._specs[node].package_class(self._specs[node])
|
||||
package = spack.repo.PATH.get_pkg_class(self._specs[node].fullname)(self._specs[node])
|
||||
extendee_spec = package.extendee_spec
|
||||
|
||||
if extendee_spec:
|
||||
@@ -3831,7 +3814,7 @@ def _is_reusable(spec: spack.spec.Spec, packages, local: bool) -> bool:
|
||||
|
||||
try:
|
||||
provided = spack.repo.PATH.get(spec).provided_virtual_names()
|
||||
except spack.error.RepoError:
|
||||
except spack.repo.RepoError:
|
||||
provided = []
|
||||
|
||||
for name in {spec.name, *provided}:
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import collections
|
||||
from typing import List, Set
|
||||
|
||||
from llnl.util import lang
|
||||
|
||||
import spack.deptypes as dt
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
|
||||
PossibleDependencies = Set[str]
|
||||
|
||||
|
||||
class Counter:
|
||||
"""Computes the possible packages and the maximum number of duplicates
|
||||
allowed for each of them.
|
||||
|
||||
Args:
|
||||
specs: abstract specs to concretize
|
||||
tests: if True, add test dependencies to the list of possible packages
|
||||
"""
|
||||
|
||||
def __init__(self, specs: List["spack.spec.Spec"], tests: bool) -> None:
|
||||
runtime_pkgs = spack.repo.PATH.packages_with_tags("runtime")
|
||||
runtime_virtuals = set()
|
||||
for x in runtime_pkgs:
|
||||
pkg_class = spack.repo.PATH.get_pkg_class(x)
|
||||
runtime_virtuals.update(pkg_class.provided_virtual_names())
|
||||
|
||||
self.specs = specs + [spack.spec.Spec(x) for x in runtime_pkgs]
|
||||
|
||||
self.link_run_types: dt.DepFlag = dt.LINK | dt.RUN | dt.TEST
|
||||
self.all_types: dt.DepFlag = dt.ALL
|
||||
if not tests:
|
||||
self.link_run_types = dt.LINK | dt.RUN
|
||||
self.all_types = dt.LINK | dt.RUN | dt.BUILD
|
||||
|
||||
self._possible_dependencies: PossibleDependencies = set()
|
||||
self._possible_virtuals: Set[str] = (
|
||||
set(x.name for x in specs if x.virtual) | runtime_virtuals
|
||||
)
|
||||
|
||||
def possible_dependencies(self) -> PossibleDependencies:
|
||||
"""Returns the list of possible dependencies"""
|
||||
self.ensure_cache_values()
|
||||
return self._possible_dependencies
|
||||
|
||||
def possible_virtuals(self) -> Set[str]:
|
||||
"""Returns the list of possible virtuals"""
|
||||
self.ensure_cache_values()
|
||||
return self._possible_virtuals
|
||||
|
||||
def ensure_cache_values(self) -> None:
|
||||
"""Ensure the cache values have been computed"""
|
||||
if self._possible_dependencies:
|
||||
return
|
||||
self._compute_cache_values()
|
||||
|
||||
def possible_packages_facts(self, gen: "spack.solver.asp.PyclingoDriver", fn) -> None:
|
||||
"""Emit facts associated with the possible packages"""
|
||||
raise NotImplementedError("must be implemented by derived classes")
|
||||
|
||||
def _compute_cache_values(self):
|
||||
raise NotImplementedError("must be implemented by derived classes")
|
||||
|
||||
|
||||
class NoDuplicatesCounter(Counter):
|
||||
def _compute_cache_values(self):
|
||||
result = spack.package_base.possible_dependencies(
|
||||
*self.specs, virtuals=self._possible_virtuals, depflag=self.all_types
|
||||
)
|
||||
self._possible_dependencies = set(result)
|
||||
|
||||
def possible_packages_facts(self, gen, fn):
|
||||
gen.h2("Maximum number of nodes (packages)")
|
||||
for package_name in sorted(self.possible_dependencies()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
gen.h2("Maximum number of nodes (virtual packages)")
|
||||
for package_name in sorted(self.possible_virtuals()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self.possible_dependencies()):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
|
||||
class MinimalDuplicatesCounter(NoDuplicatesCounter):
|
||||
def __init__(self, specs, tests):
|
||||
super().__init__(specs, tests)
|
||||
self._link_run: PossibleDependencies = set()
|
||||
self._direct_build: PossibleDependencies = set()
|
||||
self._total_build: PossibleDependencies = set()
|
||||
self._link_run_virtuals: Set[str] = set()
|
||||
|
||||
def _compute_cache_values(self):
|
||||
self._link_run = set(
|
||||
spack.package_base.possible_dependencies(
|
||||
*self.specs, virtuals=self._possible_virtuals, depflag=self.link_run_types
|
||||
)
|
||||
)
|
||||
self._link_run_virtuals.update(self._possible_virtuals)
|
||||
for x in self._link_run:
|
||||
build_dependencies = spack.repo.PATH.get_pkg_class(x).dependencies_of_type(dt.BUILD)
|
||||
virtuals, reals = lang.stable_partition(
|
||||
build_dependencies, spack.repo.PATH.is_virtual_safe
|
||||
)
|
||||
|
||||
self._possible_virtuals.update(virtuals)
|
||||
for virtual_dep in virtuals:
|
||||
providers = spack.repo.PATH.providers_for(virtual_dep)
|
||||
self._direct_build.update(str(x) for x in providers)
|
||||
|
||||
self._direct_build.update(reals)
|
||||
|
||||
self._total_build = set(
|
||||
spack.package_base.possible_dependencies(
|
||||
*self._direct_build, virtuals=self._possible_virtuals, depflag=self.all_types
|
||||
)
|
||||
)
|
||||
self._possible_dependencies = set(self._link_run) | set(self._total_build)
|
||||
|
||||
def possible_packages_facts(self, gen, fn):
|
||||
build_tools = spack.repo.PATH.packages_with_tags("build-tools")
|
||||
gen.h2("Packages with at most a single node")
|
||||
for package_name in sorted(self.possible_dependencies() - build_tools):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Packages with at multiple possible nodes (build-tools)")
|
||||
for package_name in sorted(self.possible_dependencies() & build_tools):
|
||||
gen.fact(fn.max_dupes(package_name, 2))
|
||||
gen.fact(fn.multiple_unification_sets(package_name))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Maximum number of nodes (virtual packages)")
|
||||
for package_name in sorted(self.possible_virtuals()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self._link_run):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
|
||||
class FullDuplicatesCounter(MinimalDuplicatesCounter):
|
||||
def possible_packages_facts(self, gen, fn):
|
||||
build_tools = spack.repo.PATH.packages_with_tags("build-tools")
|
||||
counter = collections.Counter(
|
||||
list(self._link_run) + list(self._total_build) + list(self._direct_build)
|
||||
)
|
||||
gen.h2("Maximum number of nodes")
|
||||
for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])):
|
||||
count = min(count, 2)
|
||||
gen.fact(fn.max_dupes(pkg, count))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Build unification sets ")
|
||||
for name in sorted(self.possible_dependencies() & build_tools):
|
||||
gen.fact(fn.multiple_unification_sets(name))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self._link_run):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
counter = collections.Counter(
|
||||
list(self._link_run_virtuals) + list(self._possible_virtuals)
|
||||
)
|
||||
gen.h2("Maximum number of virtual nodes")
|
||||
for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])):
|
||||
gen.fact(fn.max_dupes(pkg, count))
|
||||
gen.newline()
|
||||
524
lib/spack/spack/solver/input_analysis.py
Normal file
524
lib/spack/spack/solver/input_analysis.py
Normal file
@@ -0,0 +1,524 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
"""Classes to analyze the input of a solve, and provide information to set up the ASP problem"""
|
||||
import collections
|
||||
from typing import Dict, List, NamedTuple, Set, Tuple, Union
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
from llnl.util import lang, tty
|
||||
|
||||
import spack.binary_distribution
|
||||
import spack.config
|
||||
import spack.deptypes as dt
|
||||
import spack.platforms
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.store
|
||||
from spack.error import SpackError
|
||||
|
||||
RUNTIME_TAG = "runtime"
|
||||
|
||||
|
||||
class PossibleGraph(NamedTuple):
|
||||
real_pkgs: Set[str]
|
||||
virtuals: Set[str]
|
||||
edges: Dict[str, Set[str]]
|
||||
|
||||
|
||||
class PossibleDependencyGraph:
|
||||
"""Returns information needed to set up an ASP problem"""
|
||||
|
||||
def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool:
|
||||
"""Returns true if the context can determine that the condition cannot ever
|
||||
be met on pkg_name.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]:
|
||||
"""Returns a list of targets that are candidate for concretization"""
|
||||
raise NotImplementedError
|
||||
|
||||
def possible_dependencies(
|
||||
self,
|
||||
*specs: Union[spack.spec.Spec, str],
|
||||
allowed_deps: dt.DepFlag,
|
||||
transitive: bool = True,
|
||||
strict_depflag: bool = False,
|
||||
expand_virtuals: bool = True,
|
||||
) -> PossibleGraph:
|
||||
"""Returns the set of possible dependencies, and the set of possible virtuals.
|
||||
|
||||
Both sets always include runtime packages, which may be injected by compilers.
|
||||
|
||||
Args:
|
||||
transitive: return transitive dependencies if True, only direct dependencies if False
|
||||
allowed_deps: dependency types to consider
|
||||
strict_depflag: if True, only the specific dep type is considered, if False any
|
||||
deptype that intersects with allowed deptype is considered
|
||||
expand_virtuals: expand virtual dependencies into all possible implementations
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class NoStaticAnalysis(PossibleDependencyGraph):
|
||||
"""Implementation that tries to minimize the setup time (i.e. defaults to give fast
|
||||
answers), rather than trying to reduce the ASP problem size with more complex analysis.
|
||||
"""
|
||||
|
||||
def __init__(self, *, configuration: spack.config.Configuration, repo: spack.repo.RepoPath):
|
||||
self.configuration = configuration
|
||||
self.repo = repo
|
||||
self.runtime_pkgs = set(self.repo.packages_with_tags(RUNTIME_TAG))
|
||||
self.runtime_virtuals = set()
|
||||
self._platform_condition = spack.spec.Spec(
|
||||
f"platform={spack.platforms.host()} target={archspec.cpu.host().family}:"
|
||||
)
|
||||
for x in self.runtime_pkgs:
|
||||
pkg_class = self.repo.get_pkg_class(x)
|
||||
self.runtime_virtuals.update(pkg_class.provided_virtual_names())
|
||||
|
||||
try:
|
||||
self.libc_pkgs = [x.name for x in self.providers_for("libc")]
|
||||
except spack.repo.UnknownPackageError:
|
||||
self.libc_pkgs = []
|
||||
|
||||
def is_virtual(self, name: str) -> bool:
|
||||
return self.repo.is_virtual(name)
|
||||
|
||||
@lang.memoized
|
||||
def is_allowed_on_this_platform(self, *, pkg_name: str) -> bool:
|
||||
"""Returns true if a package is allowed on the current host"""
|
||||
pkg_cls = self.repo.get_pkg_class(pkg_name)
|
||||
for when_spec, conditions in pkg_cls.requirements.items():
|
||||
if not when_spec.intersects(self._platform_condition):
|
||||
continue
|
||||
for requirements, _, _ in conditions:
|
||||
if not any(x.intersects(self._platform_condition) for x in requirements):
|
||||
tty.debug(f"[{__name__}] {pkg_name} is not for this platform")
|
||||
return False
|
||||
return True
|
||||
|
||||
def providers_for(self, virtual_str: str) -> List[spack.spec.Spec]:
|
||||
"""Returns a list of possible providers for the virtual string in input."""
|
||||
return self.repo.providers_for(virtual_str)
|
||||
|
||||
def can_be_installed(self, *, pkg_name) -> bool:
|
||||
"""Returns True if a package can be installed, False otherwise."""
|
||||
return True
|
||||
|
||||
def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool:
|
||||
"""Returns true if the context can determine that the condition cannot ever
|
||||
be met on pkg_name.
|
||||
"""
|
||||
return False
|
||||
|
||||
def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]:
|
||||
"""Returns a list of targets that are candidate for concretization"""
|
||||
platform = spack.platforms.host()
|
||||
default_target = archspec.cpu.TARGETS[platform.default]
|
||||
|
||||
# Construct the list of targets which are compatible with the host
|
||||
candidate_targets = [default_target] + default_target.ancestors
|
||||
granularity = self.configuration.get("concretizer:targets:granularity")
|
||||
host_compatible = self.configuration.get("concretizer:targets:host_compatible")
|
||||
|
||||
# Add targets which are not compatible with the current host
|
||||
if not host_compatible:
|
||||
additional_targets_in_family = sorted(
|
||||
[
|
||||
t
|
||||
for t in archspec.cpu.TARGETS.values()
|
||||
if (t.family.name == default_target.family.name and t not in candidate_targets)
|
||||
],
|
||||
key=lambda x: len(x.ancestors),
|
||||
reverse=True,
|
||||
)
|
||||
candidate_targets += additional_targets_in_family
|
||||
|
||||
# Check if we want only generic architecture
|
||||
if granularity == "generic":
|
||||
candidate_targets = [t for t in candidate_targets if t.vendor == "generic"]
|
||||
|
||||
return candidate_targets
|
||||
|
||||
def possible_dependencies(
|
||||
self,
|
||||
*specs: Union[spack.spec.Spec, str],
|
||||
allowed_deps: dt.DepFlag,
|
||||
transitive: bool = True,
|
||||
strict_depflag: bool = False,
|
||||
expand_virtuals: bool = True,
|
||||
) -> PossibleGraph:
|
||||
stack = [x for x in self._package_list(specs)]
|
||||
virtuals: Set[str] = set()
|
||||
edges: Dict[str, Set[str]] = {}
|
||||
|
||||
while stack:
|
||||
pkg_name = stack.pop()
|
||||
|
||||
if pkg_name in edges:
|
||||
continue
|
||||
|
||||
edges[pkg_name] = set()
|
||||
|
||||
# Since libc is not buildable, there is no need to extend the
|
||||
# search space with libc dependencies.
|
||||
if pkg_name in self.libc_pkgs:
|
||||
continue
|
||||
|
||||
pkg_cls = self.repo.get_pkg_class(pkg_name=pkg_name)
|
||||
for name, conditions in pkg_cls.dependencies_by_name(when=True).items():
|
||||
if all(self.unreachable(pkg_name=pkg_name, when_spec=x) for x in conditions):
|
||||
tty.debug(
|
||||
f"[{__name__}] Not adding {name} as a dep of {pkg_name}, because "
|
||||
f"conditions cannot be met"
|
||||
)
|
||||
continue
|
||||
|
||||
if not self._has_deptypes(
|
||||
conditions, allowed_deps=allowed_deps, strict=strict_depflag
|
||||
):
|
||||
continue
|
||||
|
||||
if name in virtuals:
|
||||
continue
|
||||
|
||||
dep_names = set()
|
||||
if self.is_virtual(name):
|
||||
virtuals.add(name)
|
||||
if expand_virtuals:
|
||||
providers = self.providers_for(name)
|
||||
dep_names = {spec.name for spec in providers}
|
||||
else:
|
||||
dep_names = {name}
|
||||
|
||||
edges[pkg_name].update(dep_names)
|
||||
|
||||
if not transitive:
|
||||
continue
|
||||
|
||||
for dep_name in dep_names:
|
||||
if dep_name in edges:
|
||||
continue
|
||||
|
||||
if not self._is_possible(pkg_name=dep_name):
|
||||
continue
|
||||
|
||||
stack.append(dep_name)
|
||||
|
||||
real_packages = set(edges)
|
||||
if not transitive:
|
||||
# We exit early, so add children from the edges information
|
||||
for root, children in edges.items():
|
||||
real_packages.update(x for x in children if self._is_possible(pkg_name=x))
|
||||
|
||||
virtuals.update(self.runtime_virtuals)
|
||||
real_packages = real_packages | self.runtime_pkgs
|
||||
return PossibleGraph(real_pkgs=real_packages, virtuals=virtuals, edges=edges)
|
||||
|
||||
def _package_list(self, specs: Tuple[Union[spack.spec.Spec, str], ...]) -> List[str]:
|
||||
stack = []
|
||||
for current_spec in specs:
|
||||
if isinstance(current_spec, str):
|
||||
current_spec = spack.spec.Spec(current_spec)
|
||||
|
||||
if self.repo.is_virtual(current_spec.name):
|
||||
stack.extend([p.name for p in self.providers_for(current_spec.name)])
|
||||
continue
|
||||
|
||||
stack.append(current_spec.name)
|
||||
return sorted(set(stack))
|
||||
|
||||
def _has_deptypes(self, dependencies, *, allowed_deps: dt.DepFlag, strict: bool) -> bool:
|
||||
if strict is True:
|
||||
return any(
|
||||
dep.depflag == allowed_deps for deplist in dependencies.values() for dep in deplist
|
||||
)
|
||||
return any(
|
||||
dep.depflag & allowed_deps for deplist in dependencies.values() for dep in deplist
|
||||
)
|
||||
|
||||
def _is_possible(self, *, pkg_name):
|
||||
try:
|
||||
return self.is_allowed_on_this_platform(pkg_name=pkg_name) and self.can_be_installed(
|
||||
pkg_name=pkg_name
|
||||
)
|
||||
except spack.repo.UnknownPackageError:
|
||||
return False
|
||||
|
||||
|
||||
class StaticAnalysis(NoStaticAnalysis):
|
||||
"""Performs some static analysis of the configuration, store, etc. to provide more precise
|
||||
answers on whether some packages can be installed, or used as a provider.
|
||||
|
||||
It increases the setup time, but might decrease the grounding and solve time considerably,
|
||||
especially when requirements restrict the possible choices for providers.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
configuration: spack.config.Configuration,
|
||||
repo: spack.repo.RepoPath,
|
||||
store: spack.store.Store,
|
||||
binary_index: spack.binary_distribution.BinaryCacheIndex,
|
||||
):
|
||||
super().__init__(configuration=configuration, repo=repo)
|
||||
self.store = store
|
||||
self.binary_index = binary_index
|
||||
|
||||
@lang.memoized
|
||||
def providers_for(self, virtual_str: str) -> List[spack.spec.Spec]:
|
||||
candidates = super().providers_for(virtual_str)
|
||||
result = []
|
||||
for spec in candidates:
|
||||
if not self._is_provider_candidate(pkg_name=spec.name, virtual=virtual_str):
|
||||
continue
|
||||
result.append(spec)
|
||||
return result
|
||||
|
||||
@lang.memoized
|
||||
def buildcache_specs(self) -> List[spack.spec.Spec]:
|
||||
self.binary_index.update()
|
||||
return self.binary_index.get_all_built_specs()
|
||||
|
||||
@lang.memoized
|
||||
def can_be_installed(self, *, pkg_name) -> bool:
|
||||
if self.configuration.get(f"packages:{pkg_name}:buildable", True):
|
||||
return True
|
||||
|
||||
if self.configuration.get(f"packages:{pkg_name}:externals", []):
|
||||
return True
|
||||
|
||||
reuse = self.configuration.get("concretizer:reuse")
|
||||
if reuse is not False and self.store.db.query(pkg_name):
|
||||
return True
|
||||
|
||||
if reuse is not False and any(x.name == pkg_name for x in self.buildcache_specs()):
|
||||
return True
|
||||
|
||||
tty.debug(f"[{__name__}] {pkg_name} cannot be installed")
|
||||
return False
|
||||
|
||||
@lang.memoized
|
||||
def _is_provider_candidate(self, *, pkg_name: str, virtual: str) -> bool:
|
||||
if not self.is_allowed_on_this_platform(pkg_name=pkg_name):
|
||||
return False
|
||||
|
||||
if not self.can_be_installed(pkg_name=pkg_name):
|
||||
return False
|
||||
|
||||
virtual_spec = spack.spec.Spec(virtual)
|
||||
if self.unreachable(pkg_name=virtual_spec.name, when_spec=pkg_name):
|
||||
tty.debug(f"[{__name__}] {pkg_name} cannot be a provider for {virtual}")
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@lang.memoized
|
||||
def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool:
|
||||
"""Returns true if the context can determine that the condition cannot ever
|
||||
be met on pkg_name.
|
||||
"""
|
||||
candidates = self.configuration.get(f"packages:{pkg_name}:require", [])
|
||||
if not candidates and pkg_name != "all":
|
||||
return self.unreachable(pkg_name="all", when_spec=when_spec)
|
||||
|
||||
if not candidates:
|
||||
return False
|
||||
|
||||
if isinstance(candidates, str):
|
||||
candidates = [candidates]
|
||||
|
||||
union_requirement = spack.spec.Spec()
|
||||
for c in candidates:
|
||||
if not isinstance(c, str):
|
||||
continue
|
||||
try:
|
||||
union_requirement.constrain(c)
|
||||
except SpackError:
|
||||
# Less optimized, but shouldn't fail
|
||||
pass
|
||||
|
||||
if not union_requirement.intersects(when_spec):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def create_graph_analyzer() -> PossibleDependencyGraph:
|
||||
static_analysis = spack.config.CONFIG.get("concretizer:static_analysis", False)
|
||||
if static_analysis:
|
||||
return StaticAnalysis(
|
||||
configuration=spack.config.CONFIG,
|
||||
repo=spack.repo.PATH,
|
||||
store=spack.store.STORE,
|
||||
binary_index=spack.binary_distribution.BINARY_INDEX,
|
||||
)
|
||||
return NoStaticAnalysis(configuration=spack.config.CONFIG, repo=spack.repo.PATH)
|
||||
|
||||
|
||||
class Counter:
|
||||
"""Computes the possible packages and the maximum number of duplicates
|
||||
allowed for each of them.
|
||||
|
||||
Args:
|
||||
specs: abstract specs to concretize
|
||||
tests: if True, add test dependencies to the list of possible packages
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, specs: List["spack.spec.Spec"], tests: bool, possible_graph: PossibleDependencyGraph
|
||||
) -> None:
|
||||
self.possible_graph = possible_graph
|
||||
self.specs = specs
|
||||
self.link_run_types: dt.DepFlag = dt.LINK | dt.RUN | dt.TEST
|
||||
self.all_types: dt.DepFlag = dt.ALL
|
||||
if not tests:
|
||||
self.link_run_types = dt.LINK | dt.RUN
|
||||
self.all_types = dt.LINK | dt.RUN | dt.BUILD
|
||||
|
||||
self._possible_dependencies: Set[str] = set()
|
||||
self._possible_virtuals: Set[str] = set(x.name for x in specs if x.virtual)
|
||||
|
||||
def possible_dependencies(self) -> Set[str]:
|
||||
"""Returns the list of possible dependencies"""
|
||||
self.ensure_cache_values()
|
||||
return self._possible_dependencies
|
||||
|
||||
def possible_virtuals(self) -> Set[str]:
|
||||
"""Returns the list of possible virtuals"""
|
||||
self.ensure_cache_values()
|
||||
return self._possible_virtuals
|
||||
|
||||
def ensure_cache_values(self) -> None:
|
||||
"""Ensure the cache values have been computed"""
|
||||
if self._possible_dependencies:
|
||||
return
|
||||
self._compute_cache_values()
|
||||
|
||||
def possible_packages_facts(self, gen: "spack.solver.asp.ProblemInstanceBuilder", fn) -> None:
|
||||
"""Emit facts associated with the possible packages"""
|
||||
raise NotImplementedError("must be implemented by derived classes")
|
||||
|
||||
def _compute_cache_values(self) -> None:
|
||||
raise NotImplementedError("must be implemented by derived classes")
|
||||
|
||||
|
||||
class NoDuplicatesCounter(Counter):
|
||||
def _compute_cache_values(self) -> None:
|
||||
self._possible_dependencies, virtuals, _ = self.possible_graph.possible_dependencies(
|
||||
*self.specs, allowed_deps=self.all_types
|
||||
)
|
||||
self._possible_virtuals.update(virtuals)
|
||||
|
||||
def possible_packages_facts(self, gen: "spack.solver.asp.ProblemInstanceBuilder", fn) -> None:
|
||||
gen.h2("Maximum number of nodes (packages)")
|
||||
for package_name in sorted(self.possible_dependencies()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
gen.h2("Maximum number of nodes (virtual packages)")
|
||||
for package_name in sorted(self.possible_virtuals()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self.possible_dependencies()):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
|
||||
class MinimalDuplicatesCounter(NoDuplicatesCounter):
|
||||
def __init__(
|
||||
self, specs: List["spack.spec.Spec"], tests: bool, possible_graph: PossibleDependencyGraph
|
||||
) -> None:
|
||||
super().__init__(specs, tests, possible_graph)
|
||||
self._link_run: Set[str] = set()
|
||||
self._direct_build: Set[str] = set()
|
||||
self._total_build: Set[str] = set()
|
||||
self._link_run_virtuals: Set[str] = set()
|
||||
|
||||
def _compute_cache_values(self) -> None:
|
||||
self._link_run, virtuals, _ = self.possible_graph.possible_dependencies(
|
||||
*self.specs, allowed_deps=self.link_run_types
|
||||
)
|
||||
self._possible_virtuals.update(virtuals)
|
||||
self._link_run_virtuals.update(virtuals)
|
||||
for x in self._link_run:
|
||||
reals, virtuals, _ = self.possible_graph.possible_dependencies(
|
||||
x, allowed_deps=dt.BUILD, transitive=False, strict_depflag=True
|
||||
)
|
||||
self._possible_virtuals.update(virtuals)
|
||||
self._direct_build.update(reals)
|
||||
|
||||
self._total_build, virtuals, _ = self.possible_graph.possible_dependencies(
|
||||
*self._direct_build, allowed_deps=self.all_types
|
||||
)
|
||||
self._possible_virtuals.update(virtuals)
|
||||
self._possible_dependencies = set(self._link_run) | set(self._total_build)
|
||||
|
||||
def possible_packages_facts(self, gen, fn):
|
||||
build_tools = spack.repo.PATH.packages_with_tags("build-tools")
|
||||
gen.h2("Packages with at most a single node")
|
||||
for package_name in sorted(self.possible_dependencies() - build_tools):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Packages with at multiple possible nodes (build-tools)")
|
||||
for package_name in sorted(self.possible_dependencies() & build_tools):
|
||||
gen.fact(fn.max_dupes(package_name, 2))
|
||||
gen.fact(fn.multiple_unification_sets(package_name))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Maximum number of nodes (virtual packages)")
|
||||
for package_name in sorted(self.possible_virtuals()):
|
||||
gen.fact(fn.max_dupes(package_name, 1))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self._link_run):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
|
||||
class FullDuplicatesCounter(MinimalDuplicatesCounter):
|
||||
def possible_packages_facts(self, gen, fn):
|
||||
build_tools = spack.repo.PATH.packages_with_tags("build-tools")
|
||||
counter = collections.Counter(
|
||||
list(self._link_run) + list(self._total_build) + list(self._direct_build)
|
||||
)
|
||||
gen.h2("Maximum number of nodes")
|
||||
for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])):
|
||||
count = min(count, 2)
|
||||
gen.fact(fn.max_dupes(pkg, count))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Build unification sets ")
|
||||
for name in sorted(self.possible_dependencies() & build_tools):
|
||||
gen.fact(fn.multiple_unification_sets(name))
|
||||
gen.newline()
|
||||
|
||||
gen.h2("Possible package in link-run subDAG")
|
||||
for name in sorted(self._link_run):
|
||||
gen.fact(fn.possible_in_link_run(name))
|
||||
gen.newline()
|
||||
|
||||
counter = collections.Counter(
|
||||
list(self._link_run_virtuals) + list(self._possible_virtuals)
|
||||
)
|
||||
gen.h2("Maximum number of virtual nodes")
|
||||
for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])):
|
||||
gen.fact(fn.max_dupes(pkg, count))
|
||||
gen.newline()
|
||||
|
||||
|
||||
def create_counter(
|
||||
specs: List[spack.spec.Spec], tests: bool, possible_graph: PossibleDependencyGraph
|
||||
) -> Counter:
|
||||
strategy = spack.config.CONFIG.get("concretizer:duplicates:strategy", "none")
|
||||
if strategy == "full":
|
||||
return FullDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph)
|
||||
if strategy == "minimal":
|
||||
return MinimalDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph)
|
||||
return NoDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph)
|
||||
@@ -91,6 +91,7 @@
|
||||
import spack.hash_types as ht
|
||||
import spack.paths
|
||||
import spack.platforms
|
||||
import spack.provider_index
|
||||
import spack.repo
|
||||
import spack.spec_parser
|
||||
import spack.store
|
||||
@@ -1892,7 +1893,9 @@ def root(self):
|
||||
|
||||
@property
|
||||
def package(self):
|
||||
assert self.concrete, f"{self.name}: Spec.package can only be called on concrete specs"
|
||||
assert self.concrete, "{0}: Spec.package can only be called on concrete specs".format(
|
||||
self.name
|
||||
)
|
||||
if not self._package:
|
||||
self._package = spack.repo.PATH.get(self)
|
||||
return self._package
|
||||
@@ -1902,6 +1905,12 @@ def package_class(self):
|
||||
"""Internal package call gets only the class object for a package.
|
||||
Use this to just get package metadata.
|
||||
"""
|
||||
warnings.warn(
|
||||
"`Spec.package_class` is deprecated and will be removed in version 1.0.0. Use "
|
||||
"`spack.repo.PATH.get_pkg_class(spec.fullname) instead.",
|
||||
category=spack.error.SpackAPIWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return spack.repo.PATH.get_pkg_class(self.fullname)
|
||||
|
||||
@property
|
||||
@@ -2861,7 +2870,7 @@ def inject_patches_variant(root):
|
||||
|
||||
# Add any patches from the package to the spec.
|
||||
patches = set()
|
||||
for cond, patch_list in s.package_class.patches.items():
|
||||
for cond, patch_list in spack.repo.PATH.get_pkg_class(s.fullname).patches.items():
|
||||
if s.satisfies(cond):
|
||||
for patch in patch_list:
|
||||
patches.add(patch)
|
||||
@@ -2874,7 +2883,7 @@ def inject_patches_variant(root):
|
||||
if dspec.spec.concrete:
|
||||
continue
|
||||
|
||||
pkg_deps = dspec.parent.package_class.dependencies
|
||||
pkg_deps = spack.repo.PATH.get_pkg_class(dspec.parent.fullname).dependencies
|
||||
|
||||
patches = []
|
||||
for cond, deps_by_name in pkg_deps.items():
|
||||
@@ -3108,7 +3117,7 @@ def ensure_valid_variants(spec):
|
||||
if spec.concrete:
|
||||
return
|
||||
|
||||
pkg_cls = spec.package_class
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(spec.fullname)
|
||||
pkg_variants = pkg_cls.variant_names()
|
||||
# reserved names are variants that may be set on any package
|
||||
# but are not necessarily recorded by the package's class
|
||||
@@ -3264,7 +3273,7 @@ def _constrain_dependencies(self, other):
|
||||
|
||||
def common_dependencies(self, other):
|
||||
"""Return names of dependencies that self an other have in common."""
|
||||
common = {s.name for s in self.traverse(root=False)}
|
||||
common = set(s.name for s in self.traverse(root=False))
|
||||
common.intersection_update(s.name for s in other.traverse(root=False))
|
||||
return common
|
||||
|
||||
@@ -3312,7 +3321,7 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
elif other.concrete:
|
||||
return other.satisfies(self)
|
||||
|
||||
# From here we know both self and other are abstract
|
||||
# From here we know both self and other are not concrete
|
||||
self_hash = self.abstract_hash
|
||||
other_hash = other.abstract_hash
|
||||
|
||||
@@ -3323,8 +3332,32 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
):
|
||||
return False
|
||||
|
||||
# We do not consider virtuals for two abstract specs, since no package is associated
|
||||
# If the names are different, we need to consider virtuals
|
||||
if self.name != other.name and self.name and other.name:
|
||||
if self.virtual and other.virtual:
|
||||
# Two virtual specs intersect only if there are providers for both
|
||||
lhs = spack.repo.PATH.providers_for(str(self))
|
||||
rhs = spack.repo.PATH.providers_for(str(other))
|
||||
intersection = [s for s in lhs if any(s.intersects(z) for z in rhs)]
|
||||
return bool(intersection)
|
||||
|
||||
# A provider can satisfy a virtual dependency.
|
||||
elif self.virtual or other.virtual:
|
||||
virtual_spec, non_virtual_spec = (self, other) if self.virtual else (other, self)
|
||||
try:
|
||||
# Here we might get an abstract spec
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(non_virtual_spec.fullname)
|
||||
pkg = pkg_cls(non_virtual_spec)
|
||||
except spack.repo.UnknownEntityError:
|
||||
# If we can't get package info on this spec, don't treat
|
||||
# it as a provider of this vdep.
|
||||
return False
|
||||
|
||||
if pkg.provides(virtual_spec.name):
|
||||
for when_spec, provided in pkg.provided.items():
|
||||
if non_virtual_spec.intersects(when_spec, deps=False):
|
||||
if any(vpkg.intersects(virtual_spec) for vpkg in provided):
|
||||
return True
|
||||
return False
|
||||
|
||||
# namespaces either match, or other doesn't require one.
|
||||
@@ -3354,16 +3387,40 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
return False
|
||||
|
||||
# If we need to descend into dependencies, do it, otherwise we're done.
|
||||
if not deps or not self._dependencies or not other._dependencies:
|
||||
if deps:
|
||||
return self._intersects_dependencies(other)
|
||||
|
||||
return True
|
||||
|
||||
def _intersects_dependencies(self, other):
|
||||
if not other._dependencies or not self._dependencies:
|
||||
# one spec *could* eventually satisfy the other
|
||||
return True
|
||||
|
||||
return self._intersects_dependencies(other)
|
||||
|
||||
def _intersects_dependencies(self, other: "Spec") -> bool:
|
||||
# Handle first-order constraints directly
|
||||
for name in self.common_dependencies(other):
|
||||
if not self[name].intersects(other[name], deps=False):
|
||||
return False
|
||||
|
||||
# For virtual dependencies, we need to dig a little deeper.
|
||||
self_index = spack.provider_index.ProviderIndex(
|
||||
repository=spack.repo.PATH, specs=self.traverse(), restrict=True
|
||||
)
|
||||
other_index = spack.provider_index.ProviderIndex(
|
||||
repository=spack.repo.PATH, specs=other.traverse(), restrict=True
|
||||
)
|
||||
|
||||
# These two loops handle cases where there is an overly restrictive
|
||||
# vpkg in one spec for a provider in the other (e.g., mpi@3: is not
|
||||
# compatible with mpich2)
|
||||
for spec in self.virtual_dependencies():
|
||||
if spec.name in other_index and not other_index.providers_for(spec):
|
||||
return False
|
||||
|
||||
for spec in other.virtual_dependencies():
|
||||
if spec.name in self_index and not self_index.providers_for(spec):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
@@ -3388,22 +3445,24 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
if not compare_hash or not compare_hash.startswith(other.abstract_hash):
|
||||
return False
|
||||
|
||||
# If the names are different, we need to consider virtuals. We return false for two
|
||||
# abstract specs with different names because no package is associated with them.
|
||||
if other.name and self.name != other.name:
|
||||
try:
|
||||
pkg = self.package
|
||||
except (AssertionError, spack.error.RepoError):
|
||||
# If we can't get package info on this spec, don't treat it as a provider of this
|
||||
# vdep.
|
||||
return False
|
||||
|
||||
if pkg.provides(other.name):
|
||||
for when, provided in pkg.provided.items():
|
||||
if self.satisfies(when, deps=False):
|
||||
if any(p.intersects(other) for p in provided):
|
||||
return True
|
||||
# If the names are different, we need to consider virtuals
|
||||
if self.name != other.name and self.name and other.name:
|
||||
# A concrete provider can satisfy a virtual dependency.
|
||||
if not self.virtual and other.virtual:
|
||||
try:
|
||||
# Here we might get an abstract spec
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(self.fullname)
|
||||
pkg = pkg_cls(self)
|
||||
except spack.repo.UnknownEntityError:
|
||||
# If we can't get package info on this spec, don't treat
|
||||
# it as a provider of this vdep.
|
||||
return False
|
||||
|
||||
if pkg.provides(other.name):
|
||||
for when_spec, provided in pkg.provided.items():
|
||||
if self.satisfies(when_spec, deps=False):
|
||||
if any(vpkg.intersects(other) for vpkg in provided):
|
||||
return True
|
||||
return False
|
||||
|
||||
# namespaces either match, or other doesn't require one.
|
||||
@@ -3456,6 +3515,10 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
# will be verified later.
|
||||
lhs_edges: Dict[str, Set[DependencySpec]] = collections.defaultdict(set)
|
||||
for rhs_edge in other.traverse_edges(root=False, cover="edges"):
|
||||
# If we are checking for ^mpi we need to verify if there is any edge
|
||||
if rhs_edge.spec.virtual:
|
||||
rhs_edge.update_virtuals(virtuals=(rhs_edge.spec.name,))
|
||||
|
||||
if not rhs_edge.virtuals:
|
||||
continue
|
||||
|
||||
@@ -3497,6 +3560,10 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
for rhs in other.traverse(root=False)
|
||||
)
|
||||
|
||||
def virtual_dependencies(self):
|
||||
"""Return list of any virtual deps in this spec."""
|
||||
return [spec for spec in self.traverse() if spec.virtual]
|
||||
|
||||
@property # type: ignore[misc] # decorated prop not supported in mypy
|
||||
def patches(self):
|
||||
"""Return patch objects for any patch sha256 sums on this Spec.
|
||||
@@ -4644,7 +4711,7 @@ def concrete(self):
|
||||
bool: True or False
|
||||
"""
|
||||
return self.spec._concrete or all(
|
||||
v in self for v in self.spec.package_class.variant_names()
|
||||
v in self for v in spack.repo.PATH.get_pkg_class(self.spec.fullname).variant_names()
|
||||
)
|
||||
|
||||
def copy(self) -> "VariantMap":
|
||||
@@ -4704,14 +4771,14 @@ def substitute_abstract_variants(spec: Spec):
|
||||
elif name in vt.reserved_names:
|
||||
continue
|
||||
|
||||
variant_defs = spec.package_class.variant_definitions(name)
|
||||
variant_defs = spack.repo.PATH.get_pkg_class(spec.fullname).variant_definitions(name)
|
||||
valid_defs = []
|
||||
for when, vdef in variant_defs:
|
||||
if when.intersects(spec):
|
||||
valid_defs.append(vdef)
|
||||
|
||||
if not valid_defs:
|
||||
if name not in spec.package_class.variant_names():
|
||||
if name not in spack.repo.PATH.get_pkg_class(spec.fullname).variant_names():
|
||||
unknown.append(name)
|
||||
else:
|
||||
whens = [str(when) for when, _ in variant_defs]
|
||||
|
||||
@@ -24,32 +24,24 @@
|
||||
mpi_deps = ["fake"]
|
||||
|
||||
|
||||
def test_direct_dependencies(mock_packages):
|
||||
out = dependencies("mpileaks")
|
||||
actual = set(re.split(r"\s+", out.strip()))
|
||||
expected = set(["callpath"] + mpis)
|
||||
assert expected == actual
|
||||
|
||||
|
||||
def test_transitive_dependencies(mock_packages):
|
||||
out = dependencies("--transitive", "mpileaks")
|
||||
actual = set(re.split(r"\s+", out.strip()))
|
||||
expected = set(["callpath", "dyninst", "libdwarf", "libelf"] + mpis + mpi_deps)
|
||||
assert expected == actual
|
||||
|
||||
|
||||
def test_transitive_dependencies_with_deptypes(mock_packages):
|
||||
out = dependencies("--transitive", "--deptype=link,run", "dtbuild1")
|
||||
deps = set(re.split(r"\s+", out.strip()))
|
||||
assert set(["dtlink2", "dtrun2"]) == deps
|
||||
|
||||
out = dependencies("--transitive", "--deptype=build", "dtbuild1")
|
||||
deps = set(re.split(r"\s+", out.strip()))
|
||||
assert set(["dtbuild2", "dtlink2"]) == deps
|
||||
|
||||
out = dependencies("--transitive", "--deptype=link", "dtbuild1")
|
||||
deps = set(re.split(r"\s+", out.strip()))
|
||||
assert set(["dtlink2"]) == deps
|
||||
@pytest.mark.parametrize(
|
||||
"cli_args,expected",
|
||||
[
|
||||
(["mpileaks"], set(["callpath"] + mpis)),
|
||||
(
|
||||
["--transitive", "mpileaks"],
|
||||
set(["callpath", "dyninst", "libdwarf", "libelf"] + mpis + mpi_deps),
|
||||
),
|
||||
(["--transitive", "--deptype=link,run", "dtbuild1"], {"dtlink2", "dtrun2"}),
|
||||
(["--transitive", "--deptype=build", "dtbuild1"], {"dtbuild2", "dtlink2"}),
|
||||
(["--transitive", "--deptype=link", "dtbuild1"], {"dtlink2"}),
|
||||
],
|
||||
)
|
||||
def test_direct_dependencies(cli_args, expected, mock_runtimes):
|
||||
out = dependencies(*cli_args)
|
||||
result = set(re.split(r"\s+", out.strip()))
|
||||
expected.update(mock_runtimes)
|
||||
assert expected == result
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
|
||||
@@ -304,6 +304,8 @@ def test_run_import_check(tmp_path: pathlib.Path):
|
||||
contents = '''
|
||||
import spack.cmd
|
||||
import spack.config # do not drop this import because of this comment
|
||||
import spack.repo
|
||||
import spack.repo_utils
|
||||
|
||||
# this comment about spack.error should not be removed
|
||||
class Example(spack.build_systems.autotools.AutotoolsPackage):
|
||||
@@ -314,6 +316,7 @@ def foo(config: "spack.error.SpackError"):
|
||||
# the type hint is quoted, so it should not be removed
|
||||
spack.util.executable.Executable("example")
|
||||
print(spack.__version__)
|
||||
print(spack.repo_utils.__file__)
|
||||
'''
|
||||
file.write_text(contents)
|
||||
root = str(tmp_path)
|
||||
@@ -329,6 +332,7 @@ def foo(config: "spack.error.SpackError"):
|
||||
output = output_buf.getvalue()
|
||||
|
||||
assert "issues.py: redundant import: spack.cmd" in output
|
||||
assert "issues.py: redundant import: spack.repo" in output
|
||||
assert "issues.py: redundant import: spack.config" not in output # comment prevents removal
|
||||
assert "issues.py: missing import: spack" in output # used by spack.__version__
|
||||
assert "issues.py: missing import: spack.build_systems.autotools" in output
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
@@ -200,11 +199,11 @@ def test_requirement_adds_version_satisfies(
|
||||
|
||||
@pytest.mark.parametrize("require_checksum", (True, False))
|
||||
def test_requirement_adds_git_hash_version(
|
||||
require_checksum, concretize_scope, test_repo, mock_git_version_info, monkeypatch, working_env
|
||||
require_checksum, concretize_scope, test_repo, mock_git_version_info, monkeypatch
|
||||
):
|
||||
# A full commit sha is a checksummed version, so this test should pass in both cases
|
||||
if require_checksum:
|
||||
os.environ["SPACK_CONCRETIZER_REQUIRE_CHECKSUM"] = "yes"
|
||||
monkeypatch.setenv("SPACK_CONCRETIZER_REQUIRE_CHECKSUM", "yes")
|
||||
|
||||
repo_path, filename, commits = mock_git_version_info
|
||||
monkeypatch.setattr(
|
||||
|
||||
@@ -2171,3 +2171,8 @@ def getcode(self):
|
||||
|
||||
def info(self):
|
||||
return self.headers
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def mock_runtimes(config, mock_packages):
|
||||
return mock_packages.packages_with_tags("runtime")
|
||||
|
||||
@@ -206,7 +206,7 @@ def test_repo(_create_test_repo, monkeypatch, mock_stage):
|
||||
)
|
||||
def test_redistribute_directive(test_repo, spec_str, distribute_src, distribute_bin):
|
||||
spec = spack.spec.Spec(spec_str)
|
||||
assert spec.package_class.redistribute_source(spec) == distribute_src
|
||||
assert spack.repo.PATH.get_pkg_class(spec.fullname).redistribute_source(spec) == distribute_src
|
||||
concretized_spec = spack.concretize.concretize_one(spec)
|
||||
assert concretized_spec.package.redistribute_binary == distribute_bin
|
||||
|
||||
|
||||
@@ -457,7 +457,7 @@ def bpp_path(spec):
|
||||
|
||||
def _repoerr(repo, name):
|
||||
if name == "cmake":
|
||||
raise spack.error.RepoError(repo_err_msg)
|
||||
raise spack.repo.RepoError(repo_err_msg)
|
||||
else:
|
||||
return orig_dirname(repo, name)
|
||||
|
||||
@@ -476,7 +476,7 @@ def _repoerr(repo, name):
|
||||
# Now try the error path, which requires the mock directory structure
|
||||
# above
|
||||
monkeypatch.setattr(spack.repo.Repo, "dirname_for_package_name", _repoerr)
|
||||
with pytest.raises(spack.error.RepoError, match=repo_err_msg):
|
||||
with pytest.raises(spack.repo.RepoError, match=repo_err_msg):
|
||||
inst.dump_packages(spec, path)
|
||||
|
||||
out = str(capsys.readouterr()[1])
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
"""Test class methods on Package objects.
|
||||
|
||||
This doesn't include methods on package *instances* (like do_patch(),
|
||||
@@ -16,6 +15,7 @@
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
|
||||
import spack.binary_distribution
|
||||
import spack.compilers
|
||||
import spack.concretize
|
||||
import spack.deptypes as dt
|
||||
@@ -23,15 +23,11 @@
|
||||
import spack.install_test
|
||||
import spack.package
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.store
|
||||
from spack.build_systems.generic import Package
|
||||
from spack.error import InstallError
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def mpi_names(mock_repo_path):
|
||||
return [spec.name for spec in mock_repo_path.providers_for("mpi")]
|
||||
from spack.solver.input_analysis import NoStaticAnalysis, StaticAnalysis
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@@ -53,78 +49,94 @@ def mpileaks_possible_deps(mock_packages, mpi_names):
|
||||
return possible
|
||||
|
||||
|
||||
def test_possible_dependencies(mock_packages, mpileaks_possible_deps):
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class("mpileaks")
|
||||
expanded_possible_deps = pkg_cls.possible_dependencies(expand_virtuals=True)
|
||||
assert mpileaks_possible_deps == expanded_possible_deps
|
||||
assert {
|
||||
"callpath": {"dyninst", "mpi"},
|
||||
"dyninst": {"libdwarf", "libelf"},
|
||||
"libdwarf": {"libelf"},
|
||||
"libelf": set(),
|
||||
"mpi": set(),
|
||||
"mpileaks": {"callpath", "mpi"},
|
||||
} == pkg_cls.possible_dependencies(expand_virtuals=False)
|
||||
|
||||
|
||||
def test_possible_direct_dependencies(mock_packages, mpileaks_possible_deps):
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class("mpileaks")
|
||||
deps = pkg_cls.possible_dependencies(transitive=False, expand_virtuals=False)
|
||||
assert {"callpath": set(), "mpi": set(), "mpileaks": {"callpath", "mpi"}} == deps
|
||||
|
||||
|
||||
def test_possible_dependencies_virtual(mock_packages, mpi_names):
|
||||
expected = dict(
|
||||
(name, set(dep for dep in spack.repo.PATH.get_pkg_class(name).dependencies_by_name()))
|
||||
for name in mpi_names
|
||||
)
|
||||
|
||||
# only one mock MPI has a dependency
|
||||
expected["fake"] = set()
|
||||
|
||||
assert expected == spack.package_base.possible_dependencies("mpi", transitive=False)
|
||||
|
||||
|
||||
def test_possible_dependencies_missing(mock_packages):
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class("missing-dependency")
|
||||
missing = {}
|
||||
pkg_cls.possible_dependencies(transitive=True, missing=missing)
|
||||
assert {"this-is-a-missing-dependency"} == missing["missing-dependency"]
|
||||
|
||||
|
||||
def test_possible_dependencies_with_deptypes(mock_packages):
|
||||
dtbuild1 = spack.repo.PATH.get_pkg_class("dtbuild1")
|
||||
|
||||
assert {
|
||||
"dtbuild1": {"dtrun2", "dtlink2"},
|
||||
"dtlink2": set(),
|
||||
"dtrun2": set(),
|
||||
} == dtbuild1.possible_dependencies(depflag=dt.LINK | dt.RUN)
|
||||
|
||||
assert {
|
||||
"dtbuild1": {"dtbuild2", "dtlink2"},
|
||||
"dtbuild2": set(),
|
||||
"dtlink2": set(),
|
||||
} == dtbuild1.possible_dependencies(depflag=dt.BUILD)
|
||||
|
||||
assert {"dtbuild1": {"dtlink2"}, "dtlink2": set()} == dtbuild1.possible_dependencies(
|
||||
depflag=dt.LINK
|
||||
@pytest.fixture(params=[NoStaticAnalysis, StaticAnalysis])
|
||||
def mock_inspector(config, mock_packages, request):
|
||||
inspector_cls = request.param
|
||||
if inspector_cls is NoStaticAnalysis:
|
||||
return inspector_cls(configuration=config, repo=mock_packages)
|
||||
return inspector_cls(
|
||||
configuration=config,
|
||||
repo=mock_packages,
|
||||
store=spack.store.STORE,
|
||||
binary_index=spack.binary_distribution.BINARY_INDEX,
|
||||
)
|
||||
|
||||
|
||||
def test_possible_dependencies_with_multiple_classes(mock_packages, mpileaks_possible_deps):
|
||||
@pytest.fixture
|
||||
def mpi_names(mock_inspector):
|
||||
return [spec.name for spec in mock_inspector.providers_for("mpi")]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"pkg_name,fn_kwargs,expected",
|
||||
[
|
||||
(
|
||||
"mpileaks",
|
||||
{"expand_virtuals": True, "allowed_deps": dt.ALL},
|
||||
{
|
||||
"fake",
|
||||
"mpileaks",
|
||||
"multi-provider-mpi",
|
||||
"callpath",
|
||||
"dyninst",
|
||||
"mpich2",
|
||||
"libdwarf",
|
||||
"zmpi",
|
||||
"low-priority-provider",
|
||||
"intel-parallel-studio",
|
||||
"mpich",
|
||||
"libelf",
|
||||
},
|
||||
),
|
||||
(
|
||||
"mpileaks",
|
||||
{"expand_virtuals": False, "allowed_deps": dt.ALL},
|
||||
{"callpath", "dyninst", "libdwarf", "libelf", "mpileaks"},
|
||||
),
|
||||
(
|
||||
"mpileaks",
|
||||
{"expand_virtuals": False, "allowed_deps": dt.ALL, "transitive": False},
|
||||
{"callpath", "mpileaks"},
|
||||
),
|
||||
("dtbuild1", {"allowed_deps": dt.LINK | dt.RUN}, {"dtbuild1", "dtrun2", "dtlink2"}),
|
||||
("dtbuild1", {"allowed_deps": dt.BUILD}, {"dtbuild1", "dtbuild2", "dtlink2"}),
|
||||
("dtbuild1", {"allowed_deps": dt.LINK}, {"dtbuild1", "dtlink2"}),
|
||||
],
|
||||
)
|
||||
def test_possible_dependencies(pkg_name, fn_kwargs, expected, mock_runtimes, mock_inspector):
|
||||
"""Tests possible nodes of mpileaks, under different scenarios."""
|
||||
expected.update(mock_runtimes)
|
||||
result, *_ = mock_inspector.possible_dependencies(pkg_name, **fn_kwargs)
|
||||
assert expected == result
|
||||
|
||||
|
||||
def test_possible_dependencies_virtual(mock_inspector, mock_packages, mock_runtimes, mpi_names):
|
||||
expected = set(mpi_names)
|
||||
for name in mpi_names:
|
||||
expected.update(dep for dep in mock_packages.get_pkg_class(name).dependencies_by_name())
|
||||
expected.update(mock_runtimes)
|
||||
|
||||
real_pkgs, *_ = mock_inspector.possible_dependencies(
|
||||
"mpi", transitive=False, allowed_deps=dt.ALL
|
||||
)
|
||||
assert expected == real_pkgs
|
||||
|
||||
|
||||
def test_possible_dependencies_missing(mock_inspector):
|
||||
result, *_ = mock_inspector.possible_dependencies("missing-dependency", allowed_deps=dt.ALL)
|
||||
assert "this-is-a-missing-dependency" not in result
|
||||
|
||||
|
||||
def test_possible_dependencies_with_multiple_classes(
|
||||
mock_inspector, mock_packages, mpileaks_possible_deps
|
||||
):
|
||||
pkgs = ["dt-diamond", "mpileaks"]
|
||||
expected = mpileaks_possible_deps.copy()
|
||||
expected.update(
|
||||
{
|
||||
"dt-diamond": set(["dt-diamond-left", "dt-diamond-right"]),
|
||||
"dt-diamond-left": set(["dt-diamond-bottom"]),
|
||||
"dt-diamond-right": set(["dt-diamond-bottom"]),
|
||||
"dt-diamond-bottom": set(),
|
||||
}
|
||||
)
|
||||
expected = set(mpileaks_possible_deps)
|
||||
expected.update({"dt-diamond", "dt-diamond-left", "dt-diamond-right", "dt-diamond-bottom"})
|
||||
expected.update(mock_packages.packages_with_tags("runtime"))
|
||||
|
||||
assert expected == spack.package_base.possible_dependencies(*pkgs)
|
||||
real_pkgs, *_ = mock_inspector.possible_dependencies(*pkgs, allowed_deps=dt.ALL)
|
||||
assert set(expected) == real_pkgs
|
||||
|
||||
|
||||
def setup_install_test(source_paths, test_root):
|
||||
|
||||
@@ -472,6 +472,9 @@ def test_concrete_specs_which_satisfies_abstract(self, lhs, rhs, default_mock_co
|
||||
("mpileaks^mpich@2.0^callpath@1.7", "^mpich@1:3^callpath@1.4:1.6"),
|
||||
("mpileaks^mpich@4.0^callpath@1.7", "^mpich@1:3^callpath@1.4:1.6"),
|
||||
("mpileaks^mpi@3", "^mpi@1.2:1.6"),
|
||||
("mpileaks^mpi@3:", "^mpich2@1.4"),
|
||||
("mpileaks^mpi@3:", "^mpich2"),
|
||||
("mpileaks^mpi@3:", "^mpich@1.0"),
|
||||
("mpich~foo", "mpich+foo"),
|
||||
("mpich+foo", "mpich~foo"),
|
||||
("mpich foo=True", "mpich foo=False"),
|
||||
@@ -702,9 +705,9 @@ def test_copy_satisfies_transitive(self):
|
||||
assert copy[s.name].satisfies(s)
|
||||
|
||||
def test_intersects_virtual(self):
|
||||
assert spack.concretize.concretize_one("mpich").intersects("mpi")
|
||||
assert spack.concretize.concretize_one("mpich2").intersects("mpi")
|
||||
assert spack.concretize.concretize_one("zmpi").intersects("mpi")
|
||||
assert Spec("mpich").intersects(Spec("mpi"))
|
||||
assert Spec("mpich2").intersects(Spec("mpi"))
|
||||
assert Spec("zmpi").intersects(Spec("mpi"))
|
||||
|
||||
def test_intersects_virtual_providers(self):
|
||||
"""Tests that we can always intersect virtual providers from abstract specs.
|
||||
@@ -1826,6 +1829,9 @@ def test_abstract_contains_semantic(lhs, rhs, expected, mock_packages):
|
||||
(Spec, "cppflags=-foo", "cflags=-foo", (True, False, False)),
|
||||
# Versions
|
||||
(Spec, "@0.94h", "@:0.94i", (True, True, False)),
|
||||
# Different virtuals intersect if there is at least package providing both
|
||||
(Spec, "mpi", "lapack", (True, False, False)),
|
||||
(Spec, "mpi", "pkgconfig", (False, False, False)),
|
||||
# Intersection among target ranges for different architectures
|
||||
(Spec, "target=x86_64:", "target=ppc64le:", (False, False, False)),
|
||||
(Spec, "target=x86_64:", "target=:power9", (False, False, False)),
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
import spack.binary_distribution
|
||||
import spack.cmd
|
||||
import spack.concretize
|
||||
import spack.error
|
||||
import spack.platforms.test
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
@@ -1140,7 +1139,7 @@ def test_parse_filename_missing_slash_as_spec(specfile_for, tmpdir, filename):
|
||||
|
||||
# Check that if we concretize this spec, we get a good error
|
||||
# message that mentions we might've meant a file.
|
||||
with pytest.raises(spack.error.UnknownEntityError) as exc_info:
|
||||
with pytest.raises(spack.repo.UnknownEntityError) as exc_info:
|
||||
spack.concretize.concretize_one(spec)
|
||||
assert exc_info.value.long_message
|
||||
assert (
|
||||
|
||||
@@ -201,3 +201,15 @@ def test_drop_redundant_rpath(tmpdir, binary_with_rpaths):
|
||||
new_rpaths = elf.get_rpaths(binary)
|
||||
assert set(existing_dirs).issubset(new_rpaths)
|
||||
assert set(non_existing_dirs).isdisjoint(new_rpaths)
|
||||
|
||||
|
||||
def test_elf_invalid_e_shnum(tmp_path):
|
||||
# from llvm/test/Object/Inputs/invalid-e_shnum.elf
|
||||
path = tmp_path / "invalid-e_shnum.elf"
|
||||
with open(path, "wb") as file:
|
||||
file.write(
|
||||
b"\x7fELF\x02\x010000000000\x03\x00>\x0000000000000000000000"
|
||||
b"\x00\x00\x00\x00\x00\x00\x00\x000000000000@\x000000"
|
||||
)
|
||||
with open(path, "rb") as file, pytest.raises(elf.ElfParsingError):
|
||||
elf.parse_elf(file)
|
||||
|
||||
@@ -195,7 +195,10 @@ def parse_program_headers(f: BinaryIO, elf: ElfFile) -> None:
|
||||
elf: ELF file parser data
|
||||
"""
|
||||
# Forward to the program header
|
||||
f.seek(elf.elf_hdr.e_phoff)
|
||||
try:
|
||||
f.seek(elf.elf_hdr.e_phoff)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to program header")
|
||||
|
||||
# Here we have to make a mapping from virtual address to offset in the file.
|
||||
ph_fmt = elf.byte_order + ("LLQQQQQQ" if elf.is_64_bit else "LLLLLLLL")
|
||||
@@ -245,7 +248,10 @@ def parse_pt_interp(f: BinaryIO, elf: ElfFile) -> None:
|
||||
f: file handle
|
||||
elf: ELF file parser data
|
||||
"""
|
||||
f.seek(elf.pt_interp_p_offset)
|
||||
try:
|
||||
f.seek(elf.pt_interp_p_offset)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to PT_INTERP entry")
|
||||
data = read_exactly(f, elf.pt_interp_p_filesz, "Malformed PT_INTERP entry")
|
||||
elf.pt_interp_str = parse_c_string(data)
|
||||
|
||||
@@ -264,7 +270,10 @@ def find_strtab_size_at_offset(f: BinaryIO, elf: ElfFile, offset: int) -> int:
|
||||
"""
|
||||
section_hdr_fmt = elf.byte_order + ("LLQQQQLLQQ" if elf.is_64_bit else "LLLLLLLLLL")
|
||||
section_hdr_size = calcsize(section_hdr_fmt)
|
||||
f.seek(elf.elf_hdr.e_shoff)
|
||||
try:
|
||||
f.seek(elf.elf_hdr.e_shoff)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to section header table")
|
||||
for _ in range(elf.elf_hdr.e_shnum):
|
||||
data = read_exactly(f, section_hdr_size, "Malformed section header")
|
||||
sh = SectionHeader(*unpack(section_hdr_fmt, data))
|
||||
@@ -286,7 +295,10 @@ def retrieve_strtab(f: BinaryIO, elf: ElfFile, offset: int) -> bytes:
|
||||
Returns: file offset
|
||||
"""
|
||||
size = find_strtab_size_at_offset(f, elf, offset)
|
||||
f.seek(offset)
|
||||
try:
|
||||
f.seek(offset)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to string table")
|
||||
return read_exactly(f, size, "Could not read string table")
|
||||
|
||||
|
||||
@@ -319,7 +331,10 @@ def parse_pt_dynamic(f: BinaryIO, elf: ElfFile) -> None:
|
||||
count_runpath = 0
|
||||
count_strtab = 0
|
||||
|
||||
f.seek(elf.pt_dynamic_p_offset)
|
||||
try:
|
||||
f.seek(elf.pt_dynamic_p_offset)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to PT_DYNAMIC entry")
|
||||
|
||||
# In case of broken ELF files, don't read beyond the advertized size.
|
||||
for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size):
|
||||
@@ -478,7 +493,10 @@ def get_interpreter(path: str) -> Optional[str]:
|
||||
def _delete_dynamic_array_entry(
|
||||
f: BinaryIO, elf: ElfFile, should_delete: Callable[[int, int], bool]
|
||||
) -> None:
|
||||
f.seek(elf.pt_dynamic_p_offset)
|
||||
try:
|
||||
f.seek(elf.pt_dynamic_p_offset)
|
||||
except OSError:
|
||||
raise ElfParsingError("Could not seek to PT_DYNAMIC entry")
|
||||
dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL")
|
||||
dynamic_array_size = calcsize(dynamic_array_fmt)
|
||||
new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import spack.directives_meta
|
||||
import spack.error
|
||||
import spack.fetch_strategy
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.util.hash
|
||||
@@ -61,10 +60,18 @@ class RemoveDirectives(ast.NodeTransformer):
|
||||
"""
|
||||
|
||||
def __init__(self, spec):
|
||||
# list of URL attributes and metadata attributes
|
||||
# these will be removed from packages.
|
||||
self.metadata_attrs = [s.url_attr for s in spack.fetch_strategy.all_strategies]
|
||||
self.metadata_attrs += spack.package_base.PackageBase.metadata_attrs
|
||||
#: List of attributes to be excluded from a package's hash.
|
||||
self.metadata_attrs = [s.url_attr for s in spack.fetch_strategy.all_strategies] + [
|
||||
"homepage",
|
||||
"url",
|
||||
"urls",
|
||||
"list_url",
|
||||
"extendable",
|
||||
"parallel",
|
||||
"make_jobs",
|
||||
"maintainers",
|
||||
"tags",
|
||||
]
|
||||
|
||||
self.spec = spec
|
||||
self.in_classdef = False # used to avoid nested classdefs
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
from llnl.util.filesystem import mkdirp, working_dir
|
||||
|
||||
import spack.caches
|
||||
import spack.error
|
||||
import spack.fetch_strategy
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
@@ -79,7 +78,7 @@ def pkg(self):
|
||||
try:
|
||||
pkg = spack.repo.PATH.get_pkg_class(self.pkg_name)
|
||||
pkg.git
|
||||
except (spack.error.RepoError, AttributeError) as e:
|
||||
except (spack.repo.RepoError, AttributeError) as e:
|
||||
raise VersionLookupError(f"Couldn't get the git repo for {self.pkg_name}") from e
|
||||
self._pkg = pkg
|
||||
return self._pkg
|
||||
|
||||
@@ -2,10 +2,16 @@ spack:
|
||||
view: false
|
||||
packages:
|
||||
all:
|
||||
require: target=x86_64_v3
|
||||
require:
|
||||
- target=x86_64_v3
|
||||
- ~cuda
|
||||
- ~rocm
|
||||
|
||||
concretizer:
|
||||
unify: true
|
||||
reuse: false
|
||||
static_analysis: true
|
||||
|
||||
definitions:
|
||||
- default_specs:
|
||||
# editors
|
||||
|
||||
@@ -4,16 +4,32 @@ spack:
|
||||
concretizer:
|
||||
reuse: false
|
||||
unify: false
|
||||
static_analysis: true
|
||||
|
||||
packages:
|
||||
all:
|
||||
require: '%gcc target=x86_64_v3'
|
||||
providers:
|
||||
blas: [openblas]
|
||||
mpi: [mpich]
|
||||
require:
|
||||
- '%gcc target=x86_64_v3'
|
||||
variants: +mpi
|
||||
mpi:
|
||||
require:
|
||||
- mpich
|
||||
blas:
|
||||
require:
|
||||
- openblas
|
||||
lapack:
|
||||
require:
|
||||
- openblas
|
||||
binutils:
|
||||
variants: +ld +gold +headers +libiberty ~nls
|
||||
cmake:
|
||||
require:
|
||||
- "~qtgui"
|
||||
- '%gcc target=x86_64_v3'
|
||||
gmake:
|
||||
require:
|
||||
- "~guile"
|
||||
- '%gcc target=x86_64_v3'
|
||||
hdf5:
|
||||
variants: +fortran +hl +shared
|
||||
libfabric:
|
||||
@@ -27,19 +43,25 @@ spack:
|
||||
+ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu
|
||||
+nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos
|
||||
+teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long
|
||||
mpi:
|
||||
require: mpich
|
||||
mpich:
|
||||
require: '~wrapperrpath ~hwloc target=x86_64_v3'
|
||||
require:
|
||||
- '~wrapperrpath ~hwloc'
|
||||
- '%gcc target=x86_64_v3'
|
||||
tbb:
|
||||
require: intel-tbb
|
||||
require:
|
||||
- intel-tbb
|
||||
vtk-m:
|
||||
require: "+examples target=x86_64_v3"
|
||||
require:
|
||||
- "+examples"
|
||||
- '%gcc target=x86_64_v3'
|
||||
visit:
|
||||
require: "~gui target=x86_64_v3"
|
||||
require:
|
||||
- "~gui target=x86_64_v3"
|
||||
paraview:
|
||||
# Don't build GUI support or GLX rendering for HPC/container deployments
|
||||
require: "+examples ~qt ^[virtuals=gl] osmesa target=x86_64_v3"
|
||||
require:
|
||||
- "+examples ~qt ^[virtuals=gl] osmesa target=x86_64_v3"
|
||||
- '%gcc target=x86_64_v3'
|
||||
|
||||
specs:
|
||||
# CPU
|
||||
|
||||
@@ -19,6 +19,8 @@ spack:
|
||||
require: +geant4 +hepmc3 +root +shared cxxstd=20
|
||||
hip:
|
||||
require: '@5.7.1 +rocm'
|
||||
rivet:
|
||||
require: hepmc=3
|
||||
root:
|
||||
require: +davix +dcache +examples +fftw +fits +fortran +gdml +graphviz +gsl +http +math +minuit +mlp +mysql +opengl +postgres +pythia8 +python +r +roofit +root7 +rpath ~shadow +spectrum +sqlite +ssl +tbb +threads +tmva +tmva-cpu +unuran +vc +vdt +veccore +webgui +x +xml +xrootd # cxxstd=20
|
||||
# note: root cxxstd=20 not concretizable within sherpa
|
||||
@@ -93,7 +95,7 @@ spack:
|
||||
- py-uproot +lz4 +xrootd +zstd
|
||||
- py-vector
|
||||
- pythia8 +evtgen +fastjet +hdf5 +hepmc +hepmc3 +lhapdf ~madgraph5amc +python +rivet ~root # pythia8 and root circularly depend
|
||||
- rivet hepmc=3
|
||||
- rivet
|
||||
- root ~cuda
|
||||
- sherpa +analysis ~blackhat +gzip +hepmc3 +hepmc3root +lhapdf +lhole +openloops +pythia ~python ~recola ~rivet +root +ufo cxxstd=20
|
||||
- tauola +hepmc3 +lhapdf cxxstd=20
|
||||
|
||||
@@ -12,6 +12,13 @@ spack:
|
||||
require: ~cuda
|
||||
mpi:
|
||||
require: openmpi
|
||||
py-torch:
|
||||
require:
|
||||
- target=aarch64
|
||||
- ~rocm
|
||||
- +cuda
|
||||
- cuda_arch=80
|
||||
- ~flash_attention
|
||||
|
||||
specs:
|
||||
# Horovod
|
||||
|
||||
@@ -12,6 +12,13 @@ spack:
|
||||
require: ~cuda
|
||||
mpi:
|
||||
require: openmpi
|
||||
py-torch:
|
||||
require:
|
||||
- target=x86_64_v3
|
||||
- ~rocm
|
||||
- +cuda
|
||||
- cuda_arch=80
|
||||
- ~flash_attention
|
||||
|
||||
specs:
|
||||
# Horovod
|
||||
|
||||
@@ -11,6 +11,13 @@ spack:
|
||||
require: "osmesa"
|
||||
mpi:
|
||||
require: openmpi
|
||||
py-torch:
|
||||
require:
|
||||
- target=x86_64_v3
|
||||
- ~cuda
|
||||
- +rocm
|
||||
- amdgpu_target=gfx90a
|
||||
- ~flash_attention
|
||||
|
||||
specs:
|
||||
# Horovod
|
||||
|
||||
@@ -19,6 +19,7 @@ class Amdsmi(CMakePackage):
|
||||
libraries = ["libamd_smi"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="1ed452eedfe51ac6e615d7bfe0bd7a0614f21113874ae3cbea7df72343cc2d13")
|
||||
version("6.3.1", sha256="a3a5a711052e813b9be9304d5e818351d3797f668ec2a455e61253a73429c355")
|
||||
version("6.3.0", sha256="7234c46648938239385cd5db57516ed53985b8c09d2f0828ae8f446386d8bd1e")
|
||||
version("6.2.4", sha256="5ebe8d0f176bf4a73b0e7000d9c47cb7f65ecca47011d3f9b08b93047dcf7ac5")
|
||||
|
||||
@@ -8,6 +8,20 @@
|
||||
from spack.package import *
|
||||
|
||||
_versions = {
|
||||
"6.3.2": {
|
||||
"apt": (
|
||||
"bef302bf344c9297f9fb64a4a93f360721a467185bc4fefbeecb307dd956c504",
|
||||
"https://repo.radeon.com/rocm/apt/6.3.2/pool/main/h/hsa-amd-aqlprofile/hsa-amd-aqlprofile_1.0.0.60302-66~20.04_amd64.deb",
|
||||
),
|
||||
"yum": (
|
||||
"1e01de060073cb72a97fcddf0f3b637b48cf89a08b34f2447d010031abc0e099",
|
||||
"https://repo.radeon.com/rocm/rhel8/6.3.2/main/hsa-amd-aqlprofile-1.0.0.60302-66.el8.x86_64.rpm",
|
||||
),
|
||||
"zyp": (
|
||||
"408fb29e09ba59a9e83e8f7d703ba53e1ef3b3acbae1103b2a82d4f87f321752",
|
||||
"https://repo.radeon.com/rocm/zyp/6.3.2/main/hsa-amd-aqlprofile-1.0.0.60302-sles155.66.x86_64.rpm",
|
||||
),
|
||||
},
|
||||
"6.3.1": {
|
||||
"apt": (
|
||||
"76b129345a1a7caa04859fd738e0ba5bfa6f7bc1ad11171f1a7b2d46e0c0b158",
|
||||
@@ -275,6 +289,7 @@ class Aqlprofile(Package):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -110,22 +110,15 @@ class Arborx(CMakePackage, CudaPackage, ROCmPackage):
|
||||
conflicts("~serial", when="+trilinos")
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
|
||||
if "+trilinos" in spec:
|
||||
kokkos_spec = spec["trilinos"]
|
||||
else:
|
||||
kokkos_spec = spec["kokkos"]
|
||||
|
||||
kokkos_pkg = self["trilinos"] if self.spec.satisfies("+trilinos") else self["kokkos"]
|
||||
options = [
|
||||
f"-DKokkos_ROOT={kokkos_spec.prefix}",
|
||||
self.define("Kokkos_ROOT", kokkos_pkg.prefix),
|
||||
self.define_from_variant("ARBORX_ENABLE_MPI", "mpi"),
|
||||
]
|
||||
|
||||
if spec.satisfies("+cuda"):
|
||||
options.append(f"-DCMAKE_CXX_COMPILER={kokkos_spec.kokkos_cxx}")
|
||||
if spec.satisfies("+rocm"):
|
||||
options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc)
|
||||
if self.spec.satisfies("+cuda"):
|
||||
options.append(self.define("CMAKE_CXX_COMPILER", kokkos_pkg.kokkos_cxx))
|
||||
if self.spec.satisfies("+rocm"):
|
||||
options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc))
|
||||
|
||||
return options
|
||||
|
||||
|
||||
@@ -125,9 +125,9 @@ class Cmake(Package):
|
||||
patch("mr-9623.patch", when="@3.22.0:3.30")
|
||||
|
||||
depends_on("ninja", when="platform=windows")
|
||||
depends_on("gmake", when="platform=linux")
|
||||
depends_on("gmake", when="platform=darwin")
|
||||
depends_on("gmake", when="platform=freebsd")
|
||||
depends_on("gmake", type=("build", "run"), when="platform=linux")
|
||||
depends_on("gmake", type=("build", "run"), when="platform=darwin")
|
||||
depends_on("gmake", type=("build", "run"), when="platform=freebsd")
|
||||
|
||||
depends_on("qt", when="+qtgui")
|
||||
# Qt depends on libmng, which is a CMake package;
|
||||
|
||||
@@ -29,6 +29,7 @@ def url_for_version(self, version):
|
||||
license("NCSA")
|
||||
|
||||
version("master", branch="amd-stg-open")
|
||||
version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827")
|
||||
version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c")
|
||||
version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c")
|
||||
version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528")
|
||||
@@ -88,6 +89,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
# llvm libs are linked statically, so this *could* be a build dep
|
||||
@@ -115,6 +117,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ def cmake_args(self):
|
||||
[
|
||||
"-DKokkosCore_PREFIX={0}".format(kokkos.prefix),
|
||||
"-DKokkosKernels_PREFIX={0}".format(kokkos_kernels.prefix),
|
||||
"-DCMAKE_CXX_COMPILER:STRING={0}".format(spec["kokkos"].kokkos_cxx),
|
||||
"-DCMAKE_CXX_COMPILER:STRING={0}".format(self["kokkos"].kokkos_cxx),
|
||||
# Compadre_USE_PYTHON is OFF by default
|
||||
"-DCompadre_USE_PYTHON=OFF",
|
||||
]
|
||||
|
||||
@@ -18,6 +18,7 @@ class ComposableKernel(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="develop")
|
||||
version("6.3.2", sha256="875237fe493ff040f8f63b827cddf2ff30a8d3aa18864f87d0e35323c7d62a2d")
|
||||
version("6.3.1", sha256="3e8c8c832ca3f9ceb99ab90f654b93b7db876f08d90eda87a70bc629c854052a")
|
||||
version("6.3.0", sha256="274f87fc27ec2584c76b5bc7ebdbe172923166b6b93e66a24f98475b44be272d")
|
||||
version("6.2.4", sha256="5598aea4bce57dc95b60f2029831edfdade80b30a56e635412cc02b2a6729aa6")
|
||||
@@ -60,6 +61,7 @@ class ComposableKernel(CMakePackage):
|
||||
|
||||
for ver in [
|
||||
"master",
|
||||
"6.3.2",
|
||||
"6.3.1",
|
||||
"6.3.0",
|
||||
"6.2.4",
|
||||
|
||||
@@ -552,7 +552,7 @@ def cmake_args(self):
|
||||
)
|
||||
# Make sure we use the same compiler that Trilinos uses
|
||||
if spec.satisfies("+trilinos"):
|
||||
options.extend([self.define("CMAKE_CXX_COMPILER", spec["trilinos"].kokkos_cxx)])
|
||||
options.extend([self.define("CMAKE_CXX_COMPILER", self["trilinos"].kokkos_cxx)])
|
||||
|
||||
# Complex support
|
||||
options.append(self.define_from_variant("DEAL_II_WITH_COMPLEX_VALUES", "complex"))
|
||||
|
||||
@@ -121,9 +121,9 @@ def setup_build_environment(self, env):
|
||||
# Manually turn off device self.defines to solve Kokkos issues in Nalu-Wind headers
|
||||
env.append_flags("CXXFLAGS", "-U__HIP_DEVICE_COMPILE__ -DDESUL_HIP_RDC")
|
||||
if self.spec.satisfies("+cuda"):
|
||||
env.set("OMPI_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICH_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICXX_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("OMPI_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICH_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICXX_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
if self.spec.satisfies("+rocm"):
|
||||
env.set("OMPI_CXX", self.spec["hip"].hipcc)
|
||||
env.set("MPICH_CXX", self.spec["hip"].hipcc)
|
||||
|
||||
@@ -147,7 +147,7 @@ def cmake_args(self):
|
||||
# CMake pulled in via find_package(Legion) won't work without this
|
||||
options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix)))
|
||||
elif self.spec.satisfies("^kokkos"):
|
||||
options.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx))
|
||||
options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
|
||||
else:
|
||||
# kept for supporing version prior to 2.2
|
||||
options = [
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
import spack.compiler
|
||||
import spack.platforms
|
||||
import spack.repo
|
||||
import spack.util.libc
|
||||
from spack.operating_systems.mac_os import macos_sdk_path, macos_version
|
||||
from spack.package import *
|
||||
@@ -1217,7 +1218,7 @@ def _post_buildcache_install_hook(self):
|
||||
)
|
||||
if header_dir and all(
|
||||
os.path.exists(os.path.join(header_dir, h))
|
||||
for h in libc.package_class.representative_headers
|
||||
for h in spack.repo.PATH.get_pkg_class(libc.fullname).representative_headers
|
||||
):
|
||||
relocation_args.append(f"-idirafter {header_dir}")
|
||||
else:
|
||||
|
||||
@@ -99,3 +99,11 @@ def setup_dependent_package(self, module, dspec):
|
||||
self.spec.prefix.bin.make,
|
||||
jobs=determine_number_of_jobs(parallel=dspec.package.parallel),
|
||||
)
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
return LibraryList([])
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
return HeaderList([])
|
||||
|
||||
@@ -16,6 +16,7 @@ class HipTensor(CMakePackage, ROCmPackage):
|
||||
maintainers("srekolam", "afzpatel")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="094db6d759eb32e9d15c36fce7f5b5d46ba81416953a8d9435b2fb9c161d8c83")
|
||||
version("6.3.1", sha256="142401331526e6da3fa172cce283f1c053056cb59cf431264443da76cee2f168")
|
||||
version("6.3.0", sha256="9a4acef722e838ec702c6b111ebc1fff9d5686ae5c79a9f5a82e5fac2a5e406a")
|
||||
version("6.2.4", sha256="54c378b440ede7a07c93b5ed8d16989cc56283a56ea35e41f3666bb05b6bc984")
|
||||
@@ -45,12 +46,13 @@ class HipTensor(CMakePackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"composable-kernel@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rocm-cmake@{ver}", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hipcc@{ver}", when=f"@{ver}")
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
|
||||
@@ -25,6 +25,7 @@ class Hip(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="2832e21d75369f87beee767949177a93ac113710afae6b73da5548c0047962ec")
|
||||
version("6.3.1", sha256="ebde9fa80ad1f4ba3fbe04fd36d90548492ebe5828ac459995b5f9d384a29783")
|
||||
version("6.3.0", sha256="d8dba8cdf05463afb7879de2833983cafa6a006ba719815a35b96d9b92fc7fc4")
|
||||
version("6.2.4", sha256="76e4583ae3d31786270fd92abbb2e3dc5e665b22fdedb5ceff0093131d4dc0ca")
|
||||
@@ -117,6 +118,7 @@ class Hip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
depends_on(f"comgr@{ver}", when=f"@{ver}")
|
||||
@@ -143,6 +145,7 @@ class Hip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hipify-clang@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -163,6 +166,7 @@ class Hip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -180,10 +184,11 @@ class Hip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hipcc@{ver}", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"rocprofiler-register@{ver}", when=f"@{ver}")
|
||||
|
||||
# roc-obj-ls requirements
|
||||
@@ -245,6 +250,7 @@ class Hip(CMakePackage):
|
||||
)
|
||||
# Add hip-clr sources thru the below
|
||||
for d_version, d_shasum in [
|
||||
("6.3.2", "ec13dc4ffe212beee22171cb2825d2b16cdce103c835adddb482b9238cf4f050"),
|
||||
("6.3.1", "bfb8a4a59e7bd958e2cd4bf6f14c6cdea601d9827ebf6dc7af053a90e963770f"),
|
||||
("6.3.0", "829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c"),
|
||||
("6.2.4", "0a3164af7f997a4111ade634152957378861b95ee72d7060eb01c86c87208c54"),
|
||||
@@ -303,6 +309,7 @@ class Hip(CMakePackage):
|
||||
)
|
||||
# Add hipother sources thru the below
|
||||
for d_version, d_shasum in [
|
||||
("6.3.2", "1623d823de49471aae3ecb1fad0e9cdddf9301a4089f1fd44f78ac2ff0c20fb2"),
|
||||
("6.3.1", "caa69147227bf72fa7b076867f84579456ef55af63efec29914265a80602df42"),
|
||||
("6.3.0", "a28eb1e8fe239b41e744584d45d676925ca210968ecb21bfa60678cf8e86eeb7"),
|
||||
("6.2.4", "b7ebcf8a2679e50d27c49ebec0dbea5a67573f8b8c3f4a29108c84b28b5bedee"),
|
||||
|
||||
@@ -15,5 +15,6 @@ class HipblasCommon(CMakePackage):
|
||||
|
||||
license("MIT")
|
||||
|
||||
version("6.3.2", sha256="29aa1ac1a0f684a09fe2ea8a34ae8af3622c27708c7df403a7481e75174e1984")
|
||||
version("6.3.1", sha256="512e652483b5580713eca14db3fa633d0441cd7c02cdb0d26e631ea605b9231b")
|
||||
version("6.3.0", sha256="240bb1b0f2e6632447e34deae967df259af1eec085470e58a6d0aa040c8530b0")
|
||||
|
||||
@@ -24,6 +24,7 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
version("develop", branch="develop")
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="6e86d4f8657e13665e37fdf3174c3a30f4c7dff2c4e2431d1be110cd7d463971")
|
||||
version("6.3.1", sha256="77a1845254d738c43a48bc52fa3e94499ed83535b5771408ff476122bc4b7b7c")
|
||||
version("6.3.0", sha256="72604c1896e42e65ea2b3e905159af6ec5eede6a353678009c47d0a24f462c92")
|
||||
version("6.2.4", sha256="3137ba35e0663d6cceed70086fc6397d9e74803e1711382be62809b91beb2f32")
|
||||
@@ -92,6 +93,7 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}", when=f"+rocm @{ver}")
|
||||
depends_on(f"rocm-openmp-extras@{ver}", type="test", when=f"+rocm @{ver}")
|
||||
@@ -119,6 +121,7 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
"develop",
|
||||
]:
|
||||
@@ -127,7 +130,7 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage):
|
||||
for tgt in ROCmPackage.amdgpu_targets:
|
||||
depends_on(f"rocblas amdgpu_target={tgt}", when=f"+rocm amdgpu_target={tgt}")
|
||||
depends_on(f"rocsolver amdgpu_target={tgt}", when=f"+rocm amdgpu_target={tgt}")
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hipblas-common@{ver}", when=f"@{ver}")
|
||||
|
||||
@classmethod
|
||||
@@ -155,7 +158,7 @@ def cmake_args(self):
|
||||
# FindHIP.cmake is still used for +cuda
|
||||
if self.spec.satisfies("+cuda"):
|
||||
args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip))
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
args.append("-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
|
||||
@@ -16,6 +16,7 @@ class Hipblaslt(CMakePackage):
|
||||
maintainers("srekolam", "afzpatel", "renjithravindrankannath")
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="cc4875b1a5cf1708a7576c42aff6b4cb790cb7337f5dc2df33119a4aadcef027")
|
||||
version("6.3.1", sha256="9a18a2e44264a21cfe58ed102fd3e34b336f23d6c191ca2da726e8e0883ed663")
|
||||
version("6.3.0", sha256="e570996037ea42eeca4c9b8b0b77a202d40be1a16068a6245595c551d80bdcad")
|
||||
version("6.2.4", sha256="b8a72cb1ed4988b0569817c6387fb2faee4782795a0d8f49b827b32b52572cfd")
|
||||
@@ -51,6 +52,7 @@ class Hipblaslt(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
@@ -59,7 +61,7 @@ class Hipblaslt(CMakePackage):
|
||||
for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4"]:
|
||||
depends_on(f"hipblas@{ver}", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hipblas-common@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ def url_for_version(self, version):
|
||||
maintainers("srekolam", "renjithravindrankannath", "afzpatel")
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827")
|
||||
version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c")
|
||||
version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c")
|
||||
version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528")
|
||||
|
||||
@@ -17,6 +17,7 @@ class Hipcub(CMakePackage, CudaPackage, ROCmPackage):
|
||||
license("BSD-3-Clause")
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath", "afzpatel")
|
||||
version("6.3.2", sha256="4a1443c2ea12c3aa05fb65703eb309ccf8b893f9e6cbebec4ccf5502ba54b940")
|
||||
version("6.3.1", sha256="e5d100c7b8f95fe6243ad9f22170c136aa34db4e588136bec54ede7cb2e7f12f")
|
||||
version("6.3.0", sha256="a609cde18cefa90a1970049cc5630f2ec263f12961aa85993897580da2ca0456")
|
||||
version("6.2.4", sha256="06f3655b110d3d2e2ecf0aca052d3ba3f2ef012c069e5d2d82f2b75d50555f46")
|
||||
@@ -84,6 +85,7 @@ class Hipcub(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocprim@{ver}", when=f"+rocm @{ver}")
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
@@ -107,7 +109,7 @@ def cmake_args(self):
|
||||
# FindHIP.cmake is still used for +cuda
|
||||
if self.spec.satisfies("+cuda"):
|
||||
args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip))
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
return args
|
||||
|
||||
@@ -24,6 +24,7 @@ class Hipfft(CMakePackage, CudaPackage, ROCmPackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="5d9e662c7d67f4c814cad70476b57651df5ae6b65f371ca6dbb5aa51d9eeb6f5")
|
||||
version("6.3.1", sha256="b709df2d0115748ed004d0cddce829cb0f9ec3761eb855e61f0097cab04e4806")
|
||||
version("6.3.0", sha256="08a0c800f531247281b4dbe8de9567a6fde4f432829a451a720d0b0a3c711059")
|
||||
version("6.2.4", sha256="308b81230498b01046f7fc3299a9e9c2c5456d80fd71a94f490ad97f51ed9de8")
|
||||
@@ -91,6 +92,7 @@ class Hipfft(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
@@ -117,7 +119,7 @@ def cmake_args(self):
|
||||
if self.spec["hip"].satisfies("@5.2:"):
|
||||
args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip))
|
||||
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
|
||||
@@ -16,6 +16,7 @@ class Hipfort(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
maintainers("cgmb", "srekolam", "renjithravindrankannath", "afzpatel")
|
||||
version("6.3.2", sha256="d2438971199637eb2e09519c1f2300cdd7a84b4d948034a7cd1ce3e441faf5de")
|
||||
version("6.3.1", sha256="8141bf3d05ab4f91c561815134707123e3d06486bf775224b9a3a4cc8ee8f56f")
|
||||
version("6.3.0", sha256="9e7f4420c75430cdb9046c0c4dbe656f22128b0672b2e261d50a6e92e47cc6d3")
|
||||
version("6.2.4", sha256="32daa4ee52c2d44790bff7a7ddde9d572e4785b2f54766a5e45d10228da0534b")
|
||||
@@ -68,6 +69,7 @@ class Hipfort(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", type="build", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class HipifyClang(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="c0da5118be8207fab6d19803417c0b8d2db5bc766279038527cbd6fa92b25c67")
|
||||
version("6.3.1", sha256="5f9d9a65545f97b18c6a0d4394dca1bcdee10737a5635b79378ea505081f9315")
|
||||
version("6.3.0", sha256="9fced04f9e36350bdbabd730c446b55a898e2f4ba82078855bcf5dea3b5e8dc8")
|
||||
version("6.2.4", sha256="981af55ab4243f084b3e75007e827f7c94ac317fa84fe08d59c5872124a7d3c7")
|
||||
@@ -76,6 +77,7 @@ class HipifyClang(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
@@ -97,6 +99,7 @@ class HipifyClang(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ class Hiprand(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
version("develop", branch="develop")
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="0a08ed7554c161b095c866cd5e6f0d63cdf063e5b3c1183afa6ac18bad94a575")
|
||||
version("6.3.1", sha256="ec43bf64eda348cf53c2767e553fd9561540dc50ae3ce95ca916404aa9a3eafb")
|
||||
version("6.3.0", sha256="7464c1e48f4e1a97a5e5978146641971d068886038810876b60acb5dfb6c4d39")
|
||||
version("6.2.4", sha256="b6010f5e0c63a139acd92197cc1c0d64a428f7a0ad661bce0cd1e553ad6fd6eb")
|
||||
@@ -103,6 +104,7 @@ class Hiprand(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
"develop",
|
||||
]:
|
||||
@@ -140,7 +142,7 @@ def cmake_args(self):
|
||||
else:
|
||||
args.append(self.define("BUILD_WITH_LIB", "ROCM"))
|
||||
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
|
||||
@@ -29,6 +29,7 @@ class Hipsolver(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
version("develop", branch="develop")
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="885c999da8e4aa0b4cb9584bc0fc0d6a8c8d56f5e7ee6d211c608003eff22aa7")
|
||||
version("6.3.1", sha256="793074ebaa4a3b16dc6e4d2a54ecbb259f1e0ec7fdcd7f885da622a1d1478b76")
|
||||
version("6.3.0", sha256="a0443f0b894cedd5af59af4fadcb3c38daa728ca32c13b9741fb19e2d828a089")
|
||||
version("6.2.4", sha256="4dc564498361cb1bac17dcfeaf0f2b9c85320797c75b05ee33160a133f5f4a15")
|
||||
@@ -109,6 +110,7 @@ class Hipsolver(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
"develop",
|
||||
]:
|
||||
@@ -162,7 +164,7 @@ def cmake_args(self):
|
||||
self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)
|
||||
)
|
||||
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
args.append(self.define("CMAKE_INSTALL_LIBDIR", "lib"))
|
||||
|
||||
@@ -21,6 +21,7 @@ class Hipsparse(CMakePackage, CudaPackage, ROCmPackage):
|
||||
libraries = ["libhipsparse"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="9fbc3468632fdc828d7bae386c2737eb371d78811f53da7348b417fb00d62808")
|
||||
version("6.3.1", sha256="d64bc48e0aa5ec2f48853272a9c554b37ec98cb0724135e45f21b1340df7bccb")
|
||||
version("6.3.0", sha256="550fd5a480490e631507e8c34b2b0cf9cbc2ad2a5bf84e8ea0a8fad96eecb25a")
|
||||
version("6.2.4", sha256="0ecc0ff1eeb99e9a9ac419e49e9be9ec4cd23a117d819710114ee2f35aefe88b")
|
||||
@@ -91,6 +92,7 @@ class Hipsparse(CMakePackage, CudaPackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
depends_on(f"rocsparse@{ver}", when=f"+rocm @{ver}")
|
||||
@@ -127,7 +129,7 @@ def cmake_args(self):
|
||||
# FindHIP.cmake is still used for +cuda
|
||||
if self.spec.satisfies("+cuda"):
|
||||
args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip))
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
|
||||
@@ -21,6 +21,7 @@ class Hipsparselt(CMakePackage, ROCmPackage):
|
||||
maintainers("srekolam", "afzpatel", "renjithravindrankannath")
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="a0b30b478eff822dd7fa1c116ad99dcdf14ece1c33aae04ac71b594efd4d9866")
|
||||
version("6.3.1", sha256="403d4c0ef47f89510452a20be6cce72962f21761081fc19a7e0e27e7f0c4ccfd")
|
||||
version("6.3.0", sha256="f67ed4900101686596add37824d0628f1e71cf6a30d827a0519b3c3657f63ac3")
|
||||
version("6.2.4", sha256="7b007b346f89fac9214ad8541b3276105ce1cac14d6f95a8a504b5a5381c8184")
|
||||
@@ -58,13 +59,14 @@ class Hipsparselt(CMakePackage, ROCmPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hipsparse@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rocm-openmp-extras@{ver}", when=f"@{ver}", type="test")
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}")
|
||||
|
||||
depends_on("cmake@3.5:", type="build")
|
||||
|
||||
@@ -23,6 +23,7 @@ class HsaRocrDev(CMakePackage):
|
||||
libraries = ["libhsa-runtime64"]
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="aaecaa7206b6fa1d5d7b8f7c1f7c5057a944327ba4779448980d7e7c7122b074")
|
||||
version("6.3.1", sha256="547ceeeda9a41cdffa21e57809dc5834f94938a0a2809c283aebcbcf01901df0")
|
||||
version("6.3.0", sha256="8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b")
|
||||
version("6.2.4", sha256="b7aa0055855398d1228c39a6f4feb7d7be921af4f43d82855faf0b531394bb9b")
|
||||
@@ -106,6 +107,7 @@ class HsaRocrDev(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
@@ -129,6 +131,7 @@ class HsaRocrDev(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ def cmake_args(self):
|
||||
options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc)
|
||||
else:
|
||||
# Compiler weirdness due to nvcc_wrapper
|
||||
options.append("-DCMAKE_CXX_COMPILER=%s" % spec["kokkos"].kokkos_cxx)
|
||||
options.append("-DCMAKE_CXX_COMPILER=%s" % self["kokkos"].kokkos_cxx)
|
||||
|
||||
if self.run_tests:
|
||||
options.append("-DKokkosKernels_ENABLE_TESTS=ON")
|
||||
|
||||
@@ -69,6 +69,6 @@ def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
env.set("OMPI_CXX", wrapper)
|
||||
env.set("MPICXX_CXX", wrapper) # HPE MPT
|
||||
|
||||
def setup_dependent_package(self, module, dependent_spec):
|
||||
wrapper = join_path(self.prefix.bin, "nvcc_wrapper")
|
||||
self.spec.kokkos_cxx = wrapper
|
||||
@property
|
||||
def kokkos_cxx(self) -> str:
|
||||
return join_path(self.prefix.bin, "nvcc_wrapper")
|
||||
|
||||
@@ -408,11 +408,12 @@ def append_args(self, cmake_prefix, cmake_options, spack_options):
|
||||
if option:
|
||||
spack_options.append(option)
|
||||
|
||||
def setup_dependent_package(self, module, dependent_spec):
|
||||
try:
|
||||
self.spec.kokkos_cxx = self.spec["kokkos-nvcc-wrapper"].kokkos_cxx
|
||||
except Exception:
|
||||
self.spec.kokkos_cxx = spack_cxx
|
||||
@property
|
||||
def kokkos_cxx(self) -> str:
|
||||
if self.spec.satisfies("+wrapper"):
|
||||
return self["kokkos-nvcc-wrapper"].kokkos_cxx
|
||||
# Assumes build-time globals have been set already
|
||||
return spack_cxx
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
@@ -474,9 +475,7 @@ def cmake_args(self):
|
||||
options.append(self.define(tpl + "_DIR", spec[tpl].prefix))
|
||||
|
||||
if self.spec.satisfies("+wrapper"):
|
||||
options.append(
|
||||
self.define("CMAKE_CXX_COMPILER", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
)
|
||||
options.append(self.define("CMAKE_CXX_COMPILER", self.kokkos_cxx))
|
||||
elif "+rocm" in self.spec:
|
||||
if "+cmake_lang" in self.spec:
|
||||
options.append(
|
||||
|
||||
@@ -406,7 +406,7 @@ def cmake_args(self):
|
||||
if spec.satisfies("+kokkos"):
|
||||
# default is off.
|
||||
options.append("-DLegion_USE_Kokkos=ON")
|
||||
os.environ["KOKKOS_CXX_COMPILER"] = spec["kokkos"].kokkos_cxx
|
||||
os.environ["KOKKOS_CXX_COMPILER"] = self["kokkos"].kokkos_cxx
|
||||
if spec.satisfies("+cuda+cuda_unsupported_compiler ^kokkos%clang +cuda"):
|
||||
# Keep CMake CUDA compiler detection happy
|
||||
options.append(
|
||||
|
||||
@@ -24,6 +24,7 @@ class LlvmAmdgpu(CMakePackage, CompilerPackage):
|
||||
license("Apache-2.0")
|
||||
|
||||
version("master", branch="amd-stg-open")
|
||||
version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827")
|
||||
version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c")
|
||||
version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c")
|
||||
version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528")
|
||||
@@ -160,6 +161,7 @@ class LlvmAmdgpu(CMakePackage, CompilerPackage):
|
||||
when="@master +rocm-device-libs",
|
||||
)
|
||||
for d_version, d_shasum in [
|
||||
("6.3.2", "aaecaa7206b6fa1d5d7b8f7c1f7c5057a944327ba4779448980d7e7c7122b074"),
|
||||
("6.3.1", "547ceeeda9a41cdffa21e57809dc5834f94938a0a2809c283aebcbcf01901df0"),
|
||||
("6.3.0", "8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b"),
|
||||
("6.2.4", "b7aa0055855398d1228c39a6f4feb7d7be921af4f43d82855faf0b531394bb9b"),
|
||||
|
||||
@@ -16,6 +16,58 @@ paths:
|
||||
c: ".*/bin/clang-3.9$"
|
||||
cxx: ".*/bin/clang[+][+]-3.9$"
|
||||
|
||||
# flang-new detection: flang-new generates slightly-different output than clang
|
||||
- layout:
|
||||
- executables:
|
||||
- "bin/clang"
|
||||
- "bin/clang++"
|
||||
script: |
|
||||
echo "clang version 19.1.6 (https://github.com/spack/spack.git 8d3a733b7798b6e33c371518b6dec298c3ebd8b1)"
|
||||
echo "Target: x86_64-unknown-linux-gnu"
|
||||
echo "Thread model: posix"
|
||||
echo "InstalledDir: /path/to/spack/install/llvm/bin"
|
||||
- executables:
|
||||
- "bin/flang-new"
|
||||
script: |
|
||||
echo "flang-new version 19.1.6 (https://github.com/spack/spack.git 8d3a733b7798b6e33c371518b6dec298c3ebd8b1)"
|
||||
echo "Target: x86_64-unknown-linux-gnu"
|
||||
echo "Thread model: posix"
|
||||
echo "InstalledDir: /path/to/spack/install/llvm/bin"
|
||||
platforms: ["darwin", "linux"]
|
||||
results:
|
||||
- spec: 'llvm@19.1.6 +flang+clang~lld~lldb'
|
||||
extra_attributes:
|
||||
compilers:
|
||||
c: ".*/bin/clang"
|
||||
cxx: ".*/bin/clang[+][+]"
|
||||
fortran: ".*/bin/flang-new"
|
||||
|
||||
# flang: like previous test, but the fortran compiler is called "flang" vs. "flang-new"
|
||||
- layout:
|
||||
- executables:
|
||||
- "bin/clang"
|
||||
- "bin/clang++"
|
||||
script: |
|
||||
echo "clang version 20.1.0-rc1 (https://github.com/llvm/llvm-project af7f483a9d801252247b6c72e3763c1f55c5a506)"
|
||||
echo "Target: x86_64-unknown-linux-gnu"
|
||||
echo "Thread model: posix"
|
||||
echo "InstalledDir: /tmp/clang/LLVM-20.1.0-rc1-Linux-X64/bin"
|
||||
- executables:
|
||||
- "bin/flang"
|
||||
script: |
|
||||
echo "flang version 20.1.0-rc1 (https://github.com/llvm/llvm-project af7f483a9d801252247b6c72e3763c1f55c5a506)"
|
||||
echo "Target: x86_64-unknown-linux-gnu"
|
||||
echo "Thread model: posix"
|
||||
echo "InstalledDir: /tmp/clang/LLVM-20.1.0-rc1-Linux-X64/bin"
|
||||
platforms: ["darwin", "linux"]
|
||||
results:
|
||||
- spec: 'llvm@20.1.0 +flang+clang~lld~lldb'
|
||||
extra_attributes:
|
||||
compilers:
|
||||
c: ".*/bin/clang"
|
||||
cxx: ".*/bin/clang[+][+]"
|
||||
fortran: ".*/bin/flang"
|
||||
|
||||
# `~` and other weird characters in the version string
|
||||
- layout:
|
||||
- executables:
|
||||
|
||||
@@ -753,19 +753,21 @@ def patch(self):
|
||||
string=True,
|
||||
)
|
||||
|
||||
clang_and_friends = "(?:clang|flang|flang-new)"
|
||||
|
||||
compiler_version_regex = (
|
||||
# Normal clang compiler versions are left as-is
|
||||
r"clang version ([^ )\n]+)-svn[~.\w\d-]*|"
|
||||
rf"{clang_and_friends} version ([^ )\n]+)-svn[~.\w\d-]*|"
|
||||
# Don't include hyphenated patch numbers in the version
|
||||
# (see https://github.com/spack/spack/pull/14365 for details)
|
||||
r"clang version ([^ )\n]+?)-[~.\w\d-]*|"
|
||||
r"clang version ([^ )\n]+)|"
|
||||
rf"{clang_and_friends} version ([^ )\n]+?)-[~.\w\d-]*|"
|
||||
rf"{clang_and_friends} version ([^ )\n]+)|"
|
||||
# LLDB
|
||||
r"lldb version ([^ )\n]+)|"
|
||||
# LLD
|
||||
r"LLD ([^ )\n]+) \(compatible with GNU linkers\)"
|
||||
)
|
||||
fortran_names = ["flang"]
|
||||
fortran_names = ["flang", "flang-new"]
|
||||
|
||||
@property
|
||||
def supported_languages(self):
|
||||
|
||||
@@ -19,6 +19,7 @@ class Migraphx(CMakePackage):
|
||||
libraries = ["libmigraphx"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="4e6b9800919e99070c0289616657592c23ff66a55230409f38e5c7e099c0d89b")
|
||||
version("6.3.1", sha256="c60df20b3c890c469265ae6f273fb5d43cc13c8c514f76dd7b4d195d9e44ba85")
|
||||
version("6.3.0", sha256="21550e5cecf1b26c02e1c4633c7c4c6eb5e37be8758d7a2641f10cfdf4203636")
|
||||
version("6.2.4", sha256="849cca3c7c98dc437e42ac17013f86ef0a5fd202cb87b7822778bd9a8f93d293")
|
||||
@@ -105,6 +106,7 @@ class Migraphx(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
@@ -122,6 +124,7 @@ class Migraphx(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocmlir@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ class MiopenHip(CMakePackage):
|
||||
libraries = ["libMIOpen"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="7abda3b437e396a1611a6f63e73ab1656d45d5405194504136c0ccbb75b81fea")
|
||||
version("6.3.1", sha256="edb82a74086fb96f8d7ee9e50a180302f716332cd0dff96bf7244bdc6fab5895")
|
||||
version("6.3.0", sha256="171834978d6316a5ec7607d4b10c7c69e5bfe9064edae8bdb9b207e578b41c1d")
|
||||
version("6.2.4", sha256="8e4836e007e5e66fa487288887a098aaeeb95f3c63a19c2b91f6e848c023a040")
|
||||
@@ -96,6 +97,7 @@ class MiopenHip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
@@ -139,6 +141,7 @@ class MiopenHip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on("nlohmann-json", type="link")
|
||||
depends_on(f"composable-kernel@{ver}", when=f"@{ver}")
|
||||
@@ -156,13 +159,14 @@ class MiopenHip(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"roctracer-dev@{ver}", when=f"@{ver}")
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2"]:
|
||||
depends_on("googletest")
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"rocrand@{ver}", when=f"@{ver}")
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hipblas@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hipblaslt@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ def url_for_version(self, version):
|
||||
return url.format(version)
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="2e7984e4ef2e6195aa9afa11030b8418aee885bec9befa220b9b53b5229b7fae")
|
||||
version("6.3.1", sha256="1f7bd1f6b61401bc642b50e96411344b092b09189534c5d6ba2f4c661d1af0ce")
|
||||
version("6.3.0", sha256="bc16881eae11140025b8fbd00bc741763548d41345dbe954c8d8659f4dccfe9e")
|
||||
version("6.2.4", sha256="7e65dc83f1b85e089c1218dff57211e64f3586bcb4415bda4798e4a434cba216")
|
||||
@@ -172,6 +173,14 @@ def patch(self):
|
||||
"model_compiler/python/nnir_to_clib.py",
|
||||
string=True,
|
||||
)
|
||||
if self.spec.satisfies("@6.2:"):
|
||||
filter_file(
|
||||
r"crypto",
|
||||
"{0}".format(self.spec["openssl"].libs),
|
||||
"utilities/runvx/CMakeLists.txt",
|
||||
"utilities/runcl/CMakeLists.txt",
|
||||
string=True,
|
||||
)
|
||||
|
||||
depends_on("cmake@3.5:", type="build")
|
||||
depends_on("ffmpeg@:4", type="build", when="@:5.3")
|
||||
@@ -230,6 +239,7 @@ def patch(self):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"miopen-hip@{ver}", when=f"@{ver}")
|
||||
for ver in [
|
||||
@@ -252,6 +262,7 @@ def patch(self):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"migraphx@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
@@ -273,6 +284,7 @@ def patch(self):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
depends_on("python@3.5:", type="build")
|
||||
@@ -290,6 +302,7 @@ def patch(self):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rpp@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -299,9 +312,10 @@ def setup_run_environment(self, env):
|
||||
env.prepend_path("LD_LIBRARY_PATH", self.spec["hsa-rocr-dev"].prefix.lib)
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
if self.spec.satisfies("+asan"):
|
||||
if self.spec.satisfies("@6.1:"):
|
||||
env.set("CC", f"{self.spec['llvm-amdgpu'].prefix}/bin/clang")
|
||||
env.set("CXX", f"{self.spec['llvm-amdgpu'].prefix}/bin/clang++")
|
||||
if self.spec.satisfies("+asan"):
|
||||
env.set("ASAN_OPTIONS", "detect_leaks=0")
|
||||
env.set("CFLAGS", "-fsanitize=address -shared-libasan")
|
||||
env.set("CXXFLAGS", "-fsanitize=address -shared-libasan")
|
||||
|
||||
@@ -140,9 +140,9 @@ def setup_build_environment(self, env):
|
||||
spec = self.spec
|
||||
env.append_flags("CXXFLAGS", "-DUSE_STK_SIMD_NONE")
|
||||
if spec.satisfies("+cuda"):
|
||||
env.set("OMPI_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICH_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICXX_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("OMPI_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICH_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
env.set("MPICXX_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
if spec.satisfies("+rocm"):
|
||||
env.append_flags("CXXFLAGS", "-fgpu-rdc")
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ def cmake_args(self):
|
||||
if "+cuda%gcc" in self.spec:
|
||||
options += [
|
||||
self.define(
|
||||
"CMAKE_CXX_COMPILER", "{0}".format(self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
"CMAKE_CXX_COMPILER", "{0}".format(self["kokkos-nvcc-wrapper"].kokkos_cxx)
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
@@ -335,8 +335,7 @@ def check_fortran_compiler(self):
|
||||
patch("revert-3.18.0-ver-format-for-dealii.patch", when="@3.18.0")
|
||||
|
||||
depends_on("diffutils", type="build")
|
||||
# not listed as a "build" dependency - so that slepc build gets the same dependency
|
||||
depends_on("gmake")
|
||||
depends_on("gmake", type="build")
|
||||
|
||||
# Virtual dependencies
|
||||
# Git repository needs sowing to build Fortran interface
|
||||
|
||||
@@ -61,7 +61,7 @@ def set_cmake_from_variants(self):
|
||||
with open("cmake_opts.txt", "w") as f:
|
||||
f.write("KokkosCore_PREFIX:PATH=%s\n" % spec["kokkos"].prefix)
|
||||
f.write("KokkosKernels_PREFIX:PATH=%s\n" % spec["kokkos-kernels"].prefix)
|
||||
f.write("CMAKE_CXX_COMPILER:STRING={0}\n".format(spec["kokkos"].kokkos_cxx))
|
||||
f.write("CMAKE_CXX_COMPILER:STRING={0}\n".format(self["kokkos"].kokkos_cxx))
|
||||
if spec.variants["debug"].value == "0":
|
||||
f.write(
|
||||
"CMAKE_CXX_FLAGS:STRING=%s\n"
|
||||
|
||||
@@ -114,6 +114,12 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
description="Enable breakpad crash dump library",
|
||||
when="@1.10:1.11",
|
||||
)
|
||||
# Flash attention has very high memory requirements that may cause the build to fail
|
||||
# https://github.com/pytorch/pytorch/issues/111526
|
||||
# https://github.com/pytorch/pytorch/issues/124018
|
||||
_desc = "Build the flash_attention kernel for scaled dot product attention"
|
||||
variant("flash_attention", default=True, description=_desc, when="@1.13:+cuda")
|
||||
variant("flash_attention", default=True, description=_desc, when="@1.13:+rocm")
|
||||
# py-torch has strict dependencies on old protobuf/py-protobuf versions that
|
||||
# cause problems with other packages that require newer versions of protobuf
|
||||
# and py-protobuf --> provide an option to use the internal/vendored protobuf.
|
||||
@@ -594,17 +600,13 @@ def enable_or_disable(variant, keyword="USE", var=None):
|
||||
env.set("CUDNN_INCLUDE_DIR", self.spec["cudnn"].prefix.include)
|
||||
env.set("CUDNN_LIBRARY", self.spec["cudnn"].libs[0])
|
||||
|
||||
# Flash attention has very high memory requirements that may cause the build to fail
|
||||
# https://github.com/pytorch/pytorch/issues/111526
|
||||
# https://github.com/pytorch/pytorch/issues/124018
|
||||
env.set("USE_FLASH_ATTENTION", "OFF")
|
||||
|
||||
enable_or_disable("fbgemm")
|
||||
enable_or_disable("kineto")
|
||||
enable_or_disable("magma")
|
||||
enable_or_disable("metal")
|
||||
enable_or_disable("mps")
|
||||
enable_or_disable("breakpad")
|
||||
enable_or_disable("flash_attention")
|
||||
|
||||
enable_or_disable("nccl")
|
||||
if "+cuda+nccl" in self.spec:
|
||||
|
||||
@@ -20,6 +20,12 @@ class Rccl(CMakePackage):
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath", "afzpatel")
|
||||
libraries = ["librccl"]
|
||||
version(
|
||||
"6.3.2",
|
||||
tag="rocm-6.3.2",
|
||||
commit="9a0e6a114c8f7371fa3050b413a350d6945fb7db",
|
||||
submodules=True,
|
||||
)
|
||||
version(
|
||||
"6.3.1",
|
||||
tag="rocm-6.3.1",
|
||||
@@ -93,6 +99,7 @@ class Rccl(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
@@ -116,6 +123,7 @@ class Rccl(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ def url_for_version(self, version):
|
||||
return url.format(version)
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="e0780b8ef46d7b9885eb06a0b9eb56924fdf090ade71a66360a0bee1d9d7295d")
|
||||
version("6.3.1", sha256="88a96f13c0010a7f9e63f7a5a5531ae1d57ef1a722bac232c8544cde6245e120")
|
||||
version("6.3.0", sha256="419afd9c8e50a872fb0a922e29c8578664ed88e0b79bf558db0a1e864aa8fecf")
|
||||
version("6.2.4", sha256="cdebbc0c1a49f067fb8ff17bd91cd92f6f83b2aee142e5b576e5eb1742983a7f")
|
||||
@@ -80,6 +81,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-smi-lib@{ver}", type=("build", "link"), when=f"@{ver}")
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
@@ -101,9 +103,10 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"amdsmi@{ver}", when=f"@{ver}")
|
||||
|
||||
def patch(self):
|
||||
|
||||
@@ -104,6 +104,12 @@ class Rivet(AutotoolsPackage):
|
||||
|
||||
filter_compiler_wrappers("rivet-build", relative_root="bin")
|
||||
|
||||
# fix missing header in 3.1.10
|
||||
patch(
|
||||
"https://gitlab.com/hepcedar/rivet/-/merge_requests/800.diff",
|
||||
sha256="9ff3429f20a4497d100627551c75a6b76dd8666d40fb5e21fdc83df4e539a6b5",
|
||||
when="@3.1.10",
|
||||
)
|
||||
# fix missing headers in 4.0.x
|
||||
patch(
|
||||
"https://gitlab.com/hepcedar/rivet/-/merge_requests/973.diff",
|
||||
|
||||
@@ -15,6 +15,7 @@ class Rocal(CMakePackage):
|
||||
maintainers("afzpatel", "srekolam", "renjithravindrankannath")
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="ceae8a86770c1f5d8cb56f4c38d6b354e16bda6b877cf93417d6a3e4e33354c6")
|
||||
version("6.3.1", sha256="e332c9c2b2eb4081d7dd8a66a141f95fe8c7fccbbfdd0fea7572a62a28a62bbb")
|
||||
version("6.3.0", sha256="162a0c15e6e7e09c0e13a9d01a493ba3199b77919addf396cd5d273ebf44d759")
|
||||
version("6.2.4", sha256="630813669e75a8ee179b89f489101931a26f7a7ee486fcbe1b0e3cb1803c582c")
|
||||
@@ -27,7 +28,7 @@ class Rocal(CMakePackage):
|
||||
depends_on("ffmpeg@4.4:")
|
||||
depends_on("abseil-cpp", when="@6.3:")
|
||||
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"mivisionx@{ver}", when=f"@{ver}")
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rpp@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -25,6 +25,7 @@ class Rocalution(CMakePackage):
|
||||
libraries = ["librocalution_hip"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="b13118a5c0af08a666d80af78d52bdfba12ed134f6745ab36d8de75ed3bc7584")
|
||||
version("6.3.1", sha256="94b78b34ac750c09831aa70a3d7f8cd220c540a75e4f91c391ba435de420c536")
|
||||
version("6.3.0", sha256="a7476e1ce79915cb8e01917de372ae6b15d7e51b1a25e15cde346dadf2391068")
|
||||
version("6.2.4", sha256="993c55e732d0ee390746890639486649f36ae806110cf7490b9bb5d49b0663c0")
|
||||
@@ -86,6 +87,7 @@ class Rocalution(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rocprim@{ver}", when=f"@{ver}")
|
||||
@@ -145,7 +147,7 @@ def cmake_args(self):
|
||||
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
|
||||
args.append(self.define("__skip_rocmclang", "ON"))
|
||||
|
||||
if self.spec.satisfies("@5.2:"):
|
||||
if self.spec.satisfies("@5.2:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
if self.spec.satisfies("@5.3:"):
|
||||
|
||||
@@ -22,6 +22,7 @@ class Rocblas(CMakePackage):
|
||||
|
||||
version("develop", branch="develop")
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="455cad760d926c21101594197c4456f617e5873a8f17bb3e14bd762018545a9e")
|
||||
version("6.3.1", sha256="88d2de6ce6b23a157eea8be63408350848935e4dfc3e27e5f2add78834c6d6ba")
|
||||
version("6.3.0", sha256="051f53bb69a9aba55a0c66c32688bf6af80e29e4a6b56b380b3c427e7a6aff9d")
|
||||
version("6.2.4", sha256="8bacf74e3499c445f1bb0a8048df1ef3ce6f72388739b1823b5784fd1e8aa22a")
|
||||
@@ -88,10 +89,11 @@ class Rocblas(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-openmp-extras@{ver}", type="test", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"rocm-smi-lib@{ver}", type="test", when=f"@{ver}")
|
||||
|
||||
depends_on("rocm-cmake@master", type="build", when="@master:")
|
||||
@@ -117,13 +119,14 @@ class Rocblas(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
depends_on(f"llvm-amdgpu@{ver}", type="build", when=f"@{ver}")
|
||||
depends_on(f"rocminfo@{ver}", type="build", when=f"@{ver}")
|
||||
depends_on(f"rocm-cmake@{ver}", type="build", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hipblaslt@{ver}", when=f"@{ver}")
|
||||
depends_on("python@3.6:", type="build")
|
||||
|
||||
@@ -160,6 +163,7 @@ class Rocblas(CMakePackage):
|
||||
("@6.2.4", "81ae9537671627fe541332c0a5d953bfd6af71d6"),
|
||||
("@6.3.0", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"),
|
||||
("@6.3.1", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"),
|
||||
("@6.3.2", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"),
|
||||
]:
|
||||
resource(
|
||||
name="Tensile",
|
||||
@@ -250,7 +254,7 @@ def cmake_args(self):
|
||||
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
|
||||
args.append(self.define("__skip_rocmclang", "ON"))
|
||||
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
args.append("-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
|
||||
@@ -17,6 +17,7 @@ class Rocdecode(CMakePackage):
|
||||
maintainers("afzpatel", "srekolam", "renjithravindrankannath")
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="39ff3c21c81a73910dcfe6a147edaddecc21575a3077f0f99971c8d2f6d0e7d5")
|
||||
version("6.3.1", sha256="94da1a61167abaf3f983ae5d62bffb22bb8ba3eb1c9d9fc7c68ed9a066aa4e52")
|
||||
version("6.3.0", sha256="931f49ff86fa34929b03cec8e7becde78d0c49c1c3a23a13203fecd2b392b242")
|
||||
version("6.2.4", sha256="37aaa1299cfc517ddaf60b0e8a5cf06d672f59e8acc0da3862b40b810d4931cb")
|
||||
@@ -37,7 +38,7 @@ class Rocdecode(CMakePackage):
|
||||
|
||||
depends_on("libva", type="build", when="@6.2:")
|
||||
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
|
||||
def patch(self):
|
||||
|
||||
@@ -20,6 +20,7 @@ class Rocfft(CMakePackage):
|
||||
|
||||
license("MIT")
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="0511d04d2367dcac6b35bc6b449337ba37bb623b8382fb11178fc608b5435437")
|
||||
version("6.3.1", sha256="f8aa0e68d8e303725d0be8ae1d7c0113b6ca019a3b9f08572abf8a02db690662")
|
||||
version("6.3.0", sha256="afc716c95d1c80097f7a965e0c3cf1fe246c9fdf10a8fd9a303202156bd3811d")
|
||||
version("6.2.4", sha256="8ddc4e779a84b73c21b054ae37fec69e5c2f248589c7fb1b84a2197baf6ce995")
|
||||
@@ -97,6 +98,7 @@ class Rocfft(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
@@ -163,7 +165,7 @@ def cmake_args(self):
|
||||
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
|
||||
args.append(self.define("__skip_rocmclang", "ON"))
|
||||
|
||||
if self.spec.satisfies("@5.2.0:"):
|
||||
if self.spec.satisfies("@5.2.0:6.3.1"):
|
||||
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
||||
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
|
||||
@@ -18,12 +18,13 @@ class Rocjpeg(CMakePackage):
|
||||
|
||||
license("MIT")
|
||||
|
||||
version("6.3.2", sha256="4e1ec9604152e818afa85360f1e0ef9e98bfb8a97ca0989980063e2ece015c16")
|
||||
version("6.3.1", sha256="f4913cbc63e11b9b418d33b0f9ba0fec0aa00b23285090acfd435e1ba1c21e42")
|
||||
version("6.3.0", sha256="2623b8f8bb61cb418d00c695e8ff0bc5979e1bb2d61d6c327a27d676c89e89cb")
|
||||
|
||||
depends_on("cxx", type="build")
|
||||
|
||||
for ver in ["6.3.0", "6.3.1"]:
|
||||
for ver in ["6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class RocmBandwidthTest(CMakePackage):
|
||||
maintainers("srekolam", "renjithravindrankannath", "afzpatel")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="3754831244d7c4f6314fc25b3e929adf9abe44c9cb60621dd8ae5d1aa930ae55")
|
||||
version("6.3.1", sha256="98002e4104929a62a308114ed82fba530880359a17f90ebd62a2ca49c2baac78")
|
||||
version("6.3.0", sha256="6d1e444b962e7a40fb9f20c87631865d3e04e8c9027fd21b439bee9b62d0070c")
|
||||
version("6.2.4", sha256="4d25c62d81f60eba8042f57ca0905adc853a214333ffc70238d91e2f53606a79")
|
||||
@@ -86,6 +87,7 @@ class RocmBandwidthTest(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
@@ -107,6 +109,7 @@ class RocmBandwidthTest(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ class RocmCmake(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="f5104c2289da99a70d8c4c1befbca4f8efa7c89711eaac7b6b63592cd4bd99a8")
|
||||
version("6.3.1", sha256="6994a5bdeea55cd41ec01ab4142785ea02bbdcb83e70f6911095c7cea766ebe8")
|
||||
version("6.3.0", sha256="45a1b96f85ae28a7f62895ddc4d6648500b883af250f52f6417bafb31b3cc75d")
|
||||
version("6.2.4", sha256="76bfac6fba31a9c4ec196d9b9b2d5ec51b8b68840b3fba8686aa42323d76a425")
|
||||
@@ -63,6 +64,7 @@ class RocmCmake(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class RocmCore(CMakePackage):
|
||||
libraries = ["librocm-core"]
|
||||
|
||||
license("MIT")
|
||||
version("6.3.2", sha256="3243f661e5e995341e81127a6096ac80169b8481826ebadc02e24020f1ff985d")
|
||||
version("6.3.1", sha256="f8196f3aafe03bd93ae2947162f34098fd08ddbad4eb3deaf92acd434b480304")
|
||||
version("6.3.0", sha256="4fa981335426195028dd6b3a05228a2ebe8e601023a1e99130bba1b14bf60178")
|
||||
version("6.2.4", sha256="46dcfb5d20d242cd0ce6d02ba64d92bdd3ea59c103cf47b665c7d7a4ea7dc7f1")
|
||||
@@ -44,7 +45,7 @@ class RocmCore(CMakePackage):
|
||||
|
||||
depends_on("cxx", type="build") # generated
|
||||
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on("llvm-amdgpu", when=f"@{ver}+asan")
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
|
||||
@@ -24,6 +24,7 @@ class RocmDbgapi(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="amd-master")
|
||||
version("6.3.2", sha256="0e7cea6ae2eb737ad378787d2ef5f6cbaf9dfb483bb5e61e716601a145677adf")
|
||||
version("6.3.1", sha256="1843423c91a22cf83bef5f14cb50f55ba333047e03e75296b9f9522facde5822")
|
||||
version("6.3.0", sha256="c46ca562fbbac8673c22ee5c92d62ddf6c7dfd7faceeb66d3876cde6beda8872")
|
||||
version("6.2.4", sha256="004e9ace3ead840e44f98fc033b621d5489a554965deecfdb7df768482068282")
|
||||
@@ -78,6 +79,7 @@ class RocmDbgapi(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"hsa-rocr-dev@{ver}", type="build", when=f"@{ver}")
|
||||
@@ -100,6 +102,7 @@ class RocmDbgapi(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class RocmDebugAgent(CMakePackage):
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath", "afzpatel")
|
||||
libraries = ["librocm-debug-agent"]
|
||||
version("6.3.2", sha256="578aa08b10a456eebd2b548afd86339bd5a5df807611ffd20cc3006eaae74836")
|
||||
version("6.3.1", sha256="0e28a9febf3b95cc6bbf8eae91091bf22a8f49fe9558171251f8f9afe666f9d7")
|
||||
version("6.3.0", sha256="c8c3461395b2fc1e136d61eb5a36ba9f3f751eb00cb9d830f498de2e5d4299d5")
|
||||
version("6.2.4", sha256="a4f213a9e28a1e82543135c0b6d16c5a252186f83fc842f980631943f7e11398")
|
||||
@@ -93,6 +94,7 @@ class RocmDebugAgent(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
depends_on(f"rocm-dbgapi@{ver}", when=f"@{ver}")
|
||||
@@ -114,6 +116,7 @@ class RocmDebugAgent(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ def url_for_version(self, version):
|
||||
maintainers("srekolam", "renjithravindrankannath", "haampie", "afzpatel")
|
||||
|
||||
version("master", branch="amd-stg-open")
|
||||
version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827")
|
||||
version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c")
|
||||
version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c")
|
||||
version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528")
|
||||
@@ -82,6 +83,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
@@ -103,6 +105,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class RocmExamples(CMakePackage):
|
||||
|
||||
license("MIT")
|
||||
|
||||
version("6.3.2", sha256="7a71dcfec782338af1d838f86b692974368e362de8ad85d5ec26c23b0afbab9e")
|
||||
version("6.3.1", sha256="c5093cd6641de478b940d2e36d6723f7ef1ccad3f4f96caf0394def2e6c7e325")
|
||||
version("6.3.0", sha256="809b5212d86d182586d676752b192967aee3bde6df8bbbe67558b221d63f5c7c")
|
||||
version("6.2.4", sha256="510931103e4a40b272123b5c731d2ea795215c6171810beb1d5335d73bcc9b03")
|
||||
@@ -28,7 +29,7 @@ class RocmExamples(CMakePackage):
|
||||
|
||||
depends_on("glfw", type="build")
|
||||
|
||||
for ver in ["6.3.1", "6.3.0", "6.2.4", "6.2.1", "6.2.0"]:
|
||||
for ver in ["6.3.2", "6.3.1", "6.3.0", "6.2.4", "6.2.1", "6.2.0"]:
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hipify-clang@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hipcub@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -17,6 +17,7 @@ class RocmGdb(AutotoolsPackage):
|
||||
license("LGPL-2.0-or-later")
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath")
|
||||
version("6.3.2", sha256="85b03c1fb99f55272f4732dff58e8ba0a1add454a79d2b9d471df200366d0c7e")
|
||||
version("6.3.1", sha256="954236518491ba547f849be7c86e71ff95ef24535f66acabfd45040e11c25d7b")
|
||||
version("6.3.0", sha256="4a41ffbc4f7a5970181ee0aae07f0ea4cda278870cd60a562b25001f1365e29f")
|
||||
version("6.2.4", sha256="061d00f3d02ca64094008c5da185712712ccd3a922f6e126d5f203cdae2b9e04")
|
||||
@@ -77,6 +78,7 @@ class RocmGdb(AutotoolsPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-dbgapi@{ver}", type="link", when=f"@{ver}")
|
||||
depends_on(f"comgr@{ver}", type="link", when=f"@{ver}")
|
||||
@@ -98,6 +100,7 @@ class RocmGdb(AutotoolsPackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ def url_for_version(self, version):
|
||||
license("MIT")
|
||||
|
||||
version("master", branch="main")
|
||||
version("6.3.2", sha256="ec13dc4ffe212beee22171cb2825d2b16cdce103c835adddb482b9238cf4f050"),
|
||||
version("6.3.1", sha256="bfb8a4a59e7bd958e2cd4bf6f14c6cdea601d9827ebf6dc7af053a90e963770f")
|
||||
version("6.3.0", sha256="829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c")
|
||||
version("6.2.4", sha256="0a3164af7f997a4111ade634152957378861b95ee72d7060eb01c86c87208c54")
|
||||
@@ -129,6 +130,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
"master",
|
||||
]:
|
||||
depends_on(f"comgr@{ver}", type="build", when=f"@{ver}")
|
||||
@@ -145,6 +147,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"aqlprofile@{ver}", type="link", when=f"@{ver}")
|
||||
|
||||
@@ -165,6 +168,7 @@ def url_for_version(self, version):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"ad5674b5626ed6720ca5f8772542e8ed3fb7a9150ed7a86a1adbcd70a2074e8e",
|
||||
"8c8240d948817ab1874eff0406d6053ee0518902427e0236e6b4d2cee84ff882",
|
||||
"8fefdd0d9eecd11866ddecbe039347560469eb69d974934005d480eac4432b81",
|
||||
"eeda81dafd17df7e1d2b9dbf91a23924c6dd8de29f0792725fc25a6cd1d9c5fa",
|
||||
]
|
||||
|
||||
devlib = [
|
||||
@@ -58,6 +59,7 @@
|
||||
"7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528",
|
||||
"79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c",
|
||||
"e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c",
|
||||
"1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827",
|
||||
]
|
||||
|
||||
llvm = [
|
||||
@@ -81,6 +83,7 @@
|
||||
"7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528",
|
||||
"79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c",
|
||||
"e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c",
|
||||
"1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827",
|
||||
]
|
||||
|
||||
flang = [
|
||||
@@ -104,6 +107,7 @@
|
||||
"51c1308f324101e4b637e78cd2eb652e22f68f6d820991a76189c15131f971dc",
|
||||
"43f10662706dbf22b0090839fd590d9fc633e7339b19aaee7578322ea6809275",
|
||||
"2e38ba138312d18b2677347839a960802bb04090bb92b5e6a15ac06ed789dbc0",
|
||||
"4b4d8025a215c52e62dd6317cafce224d95f91040e90942c9a93ade568a8dd48",
|
||||
]
|
||||
|
||||
extras = [
|
||||
@@ -127,6 +131,7 @@
|
||||
"34c3506b0f6aefbf0bc7981ff2901b7a2df975a5b40c5eb078522499d81057f0",
|
||||
"22cdd87b1d66e7e7f9e30fd9031fcbf01ce0b631551959144bb42e7f1dba28cb",
|
||||
"4050c60cbbf582122cc0a30b4a99200341c426f2fa3d81ac8dc61f5a0890ed15",
|
||||
"70b49c1198bf176498ec4a94584b8ed8a07f623ebfa567e4fcf1a6545b635185",
|
||||
]
|
||||
|
||||
versions = [
|
||||
@@ -150,6 +155,7 @@
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]
|
||||
versions_dict = dict() # type: Dict[str,Dict[str,str]]
|
||||
components = ["aomp", "devlib", "llvm", "flang", "extras"]
|
||||
@@ -167,12 +173,13 @@ class RocmOpenmpExtras(Package):
|
||||
"""OpenMP support for ROCm LLVM."""
|
||||
|
||||
homepage = tools_url + "/aomp"
|
||||
url = tools_url + "/aomp/archive/rocm-6.2.4.tar.gz"
|
||||
url = tools_url + "/aomp/archive/rocm-6.3.2.tar.gz"
|
||||
tags = ["rocm"]
|
||||
|
||||
license("Apache-2.0")
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath", "estewart08", "afzpatel")
|
||||
version("6.3.2", sha256=versions_dict["6.3.2"]["aomp"])
|
||||
version("6.3.1", sha256=versions_dict["6.3.1"]["aomp"])
|
||||
version("6.3.0", sha256=versions_dict["6.3.0"]["aomp"])
|
||||
version("6.2.4", sha256=versions_dict["6.2.4"]["aomp"])
|
||||
@@ -229,6 +236,7 @@ class RocmOpenmpExtras(Package):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
@@ -292,7 +300,7 @@ class RocmOpenmpExtras(Package):
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4"]:
|
||||
depends_on(f"hsakmt-roct@{ver}", when=f"@{ver}")
|
||||
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]:
|
||||
for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]:
|
||||
depends_on(f"comgr@{ver}", when=f"@{ver}")
|
||||
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")
|
||||
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
|
||||
@@ -508,9 +516,7 @@ def install(self, spec, prefix):
|
||||
llvm_inc = "/rocm-openmp-extras/llvm-project/llvm/include"
|
||||
llvm_prefix = self.spec["llvm-amdgpu"].prefix
|
||||
omp_bin_dir = "{0}/bin".format(openmp_extras_prefix)
|
||||
omp_lib_dir = "{0}/lib".format(openmp_extras_prefix)
|
||||
bin_dir = "{0}/bin".format(llvm_prefix)
|
||||
lib_dir = "{0}/lib".format(llvm_prefix)
|
||||
flang_warning = "-Wno-incompatible-pointer-types-discards-qualifiers"
|
||||
libpgmath = "/rocm-openmp-extras/flang/runtime/libpgmath/lib/common"
|
||||
elfutils_inc = spec["elfutils"].prefix.include
|
||||
@@ -519,34 +525,6 @@ def install(self, spec, prefix):
|
||||
ncurses_lib_dir = self.spec["ncurses"].prefix.lib
|
||||
zlib_lib_dir = self.spec["zlib"].prefix.lib
|
||||
|
||||
# flang1 and flang2 symlink needed for build of flang-runtime
|
||||
# libdevice symlink to rocm-openmp-extras for runtime
|
||||
# libdebug symlink to rocm-openmp-extras for runtime
|
||||
if os.path.islink((os.path.join(bin_dir, "flang1"))):
|
||||
os.unlink(os.path.join(bin_dir, "flang1"))
|
||||
if os.path.islink((os.path.join(bin_dir, "flang2"))):
|
||||
os.unlink(os.path.join(bin_dir, "flang2"))
|
||||
if self.spec.version >= Version("6.1.0"):
|
||||
if os.path.islink((os.path.join(bin_dir, "flang-legacy"))):
|
||||
os.unlink(os.path.join(bin_dir, "flang-legacy"))
|
||||
if os.path.islink((os.path.join(lib_dir, "libdevice"))):
|
||||
os.unlink(os.path.join(lib_dir, "libdevice"))
|
||||
if os.path.islink((os.path.join(llvm_prefix, "lib-debug"))):
|
||||
os.unlink(os.path.join(llvm_prefix, "lib-debug"))
|
||||
if not os.path.exists(os.path.join(bin_dir, "flang1")):
|
||||
os.symlink(os.path.join(omp_bin_dir, "flang1"), os.path.join(bin_dir, "flang1"))
|
||||
if not os.path.exists(os.path.join(bin_dir, "flang2")):
|
||||
os.symlink(os.path.join(omp_bin_dir, "flang2"), os.path.join(bin_dir, "flang2"))
|
||||
|
||||
if self.spec.version >= Version("6.1.0"):
|
||||
os.symlink(
|
||||
os.path.join(omp_bin_dir, "flang-legacy"), os.path.join(bin_dir, "flang-legacy")
|
||||
)
|
||||
os.symlink(os.path.join(omp_lib_dir, "libdevice"), os.path.join(lib_dir, "libdevice"))
|
||||
os.symlink(
|
||||
os.path.join(openmp_extras_prefix, "lib-debug"), os.path.join(llvm_prefix, "lib-debug")
|
||||
)
|
||||
|
||||
# Set cmake args
|
||||
components = dict()
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class RocmSmiLib(CMakePackage):
|
||||
libraries = ["librocm_smi64"]
|
||||
|
||||
version("master", branch="master")
|
||||
version("6.3.2", sha256="29a9190143dfcbafeac93d8064b00c9320dbca57a3344adb009ec17d9b09d036")
|
||||
version("6.3.1", sha256="0f45e4823e361a1c6ac560eabf6000c3b59e08bcd96e87150149149e861c6a63")
|
||||
version("6.3.0", sha256="573cfb759f8c7700fdcb0c28d045aed0f2d950692bb66a10bd589b89b8f48d0f")
|
||||
version("6.2.4", sha256="eb8986dd571f5862c2db693398c0dbec28e2754f764f6bd3cfb21be7699e4452")
|
||||
@@ -71,6 +72,7 @@ class RocmSmiLib(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class RocmTensile(CMakePackage):
|
||||
license("MIT")
|
||||
|
||||
maintainers("srekolam", "renjithravindrankannath", "haampie", "afzpatel")
|
||||
version("6.3.2", sha256="700e43a22d7e6309bf74624b18a42bb0132ef35716fccec897d3045a97759e6a")
|
||||
version("6.3.1", sha256="9882e8f949e1eb1d4b7dbd215370ecce643852dd2ce6e021d59cd49d32ba9dea")
|
||||
version("6.3.0", sha256="7ae90d1a513dc6f000a45f644b360305ef212ab3dff7b0217b6addabebf932e1")
|
||||
version("6.2.4", sha256="dd0721e4371c8752aa4b14362f75d7ebb7805f57dcb990e03ae08cef4a291383")
|
||||
@@ -87,6 +88,7 @@ class RocmTensile(CMakePackage):
|
||||
"6.2.4",
|
||||
"6.3.0",
|
||||
"6.3.1",
|
||||
"6.3.2",
|
||||
]:
|
||||
depends_on(f"rocm-cmake@{ver}", type="build", when=f"@{ver}")
|
||||
depends_on(f"hip@{ver}", when=f"@{ver}")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user