Compare commits
6 Commits
develop-20
...
hs/fix/spe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae3bcf9937 | ||
|
|
01e16b58a3 | ||
|
|
f71e202f24 | ||
|
|
f7edd10c17 | ||
|
|
153c0805dd | ||
|
|
5d8517ef69 |
2
.github/workflows/import-check.yaml
vendored
2
.github/workflows/import-check.yaml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
repository: haampie/circular-import-fighter
|
||||
ref: e38bcd0aa46368e30648b61b7f0d8c1ca68aadff
|
||||
ref: 4cdb0bf15f04ab6b49041d5ef1bfd9644cce7f33
|
||||
path: circular-import-fighter
|
||||
- name: Install dependencies
|
||||
working-directory: circular-import-fighter
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
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
|
||||
@@ -129,7 +130,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.repo.RepoError:
|
||||
except spack.error.RepoError:
|
||||
continue
|
||||
|
||||
tty.die("No repository with path or namespace: %s" % namespace_or_path)
|
||||
@@ -142,7 +143,7 @@ def repo_list(args):
|
||||
for r in roots:
|
||||
try:
|
||||
repos.append(spack.repo.from_path(r))
|
||||
except spack.repo.RepoError:
|
||||
except spack.error.RepoError:
|
||||
continue
|
||||
|
||||
if sys.stdout.isatty():
|
||||
|
||||
@@ -202,3 +202,11 @@ 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."""
|
||||
|
||||
@@ -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.repo.RepoError as err:
|
||||
except spack.error.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}")
|
||||
|
||||
@@ -2109,7 +2109,7 @@ def uninstall_by_spec(spec, force=False, deprecator=None):
|
||||
# Try to get the package for the spec
|
||||
try:
|
||||
pkg = spec.package
|
||||
except spack.repo.UnknownEntityError:
|
||||
except spack.error.UnknownEntityError:
|
||||
pkg = None
|
||||
|
||||
# Pre-uninstall hook runs first.
|
||||
|
||||
@@ -663,7 +663,7 @@ def __init__(
|
||||
repo = Repo(repo, cache=cache, overrides=overrides)
|
||||
repo.finder(self)
|
||||
self.put_last(repo)
|
||||
except RepoError as e:
|
||||
except spack.error.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 RepoError(msg) from e
|
||||
raise spack.error.RepoError(msg) from e
|
||||
|
||||
cls = getattr(module, class_name)
|
||||
if not isinstance(cls, type):
|
||||
@@ -1501,27 +1501,19 @@ def recipe_filename(self, name):
|
||||
return os.path.join(self.root, "packages", name, "package.py")
|
||||
|
||||
|
||||
class RepoError(spack.error.SpackError):
|
||||
"""Superclass for repository-related errors."""
|
||||
|
||||
|
||||
class NoRepoConfiguredError(RepoError):
|
||||
class NoRepoConfiguredError(spack.error.RepoError):
|
||||
"""Raised when there are no repositories configured."""
|
||||
|
||||
|
||||
class InvalidNamespaceError(RepoError):
|
||||
class InvalidNamespaceError(spack.error.RepoError):
|
||||
"""Raised when an invalid namespace is encountered."""
|
||||
|
||||
|
||||
class BadRepoError(RepoError):
|
||||
class BadRepoError(spack.error.RepoError):
|
||||
"""Raised when repo layout is invalid."""
|
||||
|
||||
|
||||
class UnknownEntityError(RepoError):
|
||||
"""Raised when we encounter a package spack doesn't have."""
|
||||
|
||||
|
||||
class UnknownPackageError(UnknownEntityError):
|
||||
class UnknownPackageError(spack.error.UnknownEntityError):
|
||||
"""Raised when we encounter a package spack doesn't have."""
|
||||
|
||||
def __init__(self, name, repo=None):
|
||||
@@ -1558,7 +1550,7 @@ def __init__(self, name, repo=None):
|
||||
self.name = name
|
||||
|
||||
|
||||
class UnknownNamespaceError(UnknownEntityError):
|
||||
class UnknownNamespaceError(spack.error.UnknownEntityError):
|
||||
"""Raised when we encounter an unknown namespace"""
|
||||
|
||||
def __init__(self, namespace, name=None):
|
||||
@@ -1568,7 +1560,7 @@ def __init__(self, namespace, name=None):
|
||||
super().__init__(msg, long_msg)
|
||||
|
||||
|
||||
class FailedConstructorError(RepoError):
|
||||
class FailedConstructorError(spack.error.RepoError):
|
||||
"""Raised when a package's class constructor fails."""
|
||||
|
||||
def __init__(self, name, exc_type, exc_obj, exc_tb):
|
||||
|
||||
@@ -3831,7 +3831,7 @@ def _is_reusable(spec: spack.spec.Spec, packages, local: bool) -> bool:
|
||||
|
||||
try:
|
||||
provided = spack.repo.PATH.get(spec).provided_virtual_names()
|
||||
except spack.repo.RepoError:
|
||||
except spack.error.RepoError:
|
||||
provided = []
|
||||
|
||||
for name in {spec.name, *provided}:
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
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
|
||||
@@ -1893,9 +1892,7 @@ def root(self):
|
||||
|
||||
@property
|
||||
def package(self):
|
||||
assert self.concrete, "{0}: Spec.package can only be called on concrete specs".format(
|
||||
self.name
|
||||
)
|
||||
assert self.concrete, f"{self.name}: Spec.package can only be called on concrete specs"
|
||||
if not self._package:
|
||||
self._package = spack.repo.PATH.get(self)
|
||||
return self._package
|
||||
@@ -3267,7 +3264,7 @@ def _constrain_dependencies(self, other):
|
||||
|
||||
def common_dependencies(self, other):
|
||||
"""Return names of dependencies that self an other have in common."""
|
||||
common = set(s.name for s in self.traverse(root=False))
|
||||
common = {s.name for s in self.traverse(root=False)}
|
||||
common.intersection_update(s.name for s in other.traverse(root=False))
|
||||
return common
|
||||
|
||||
@@ -3315,7 +3312,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 not concrete
|
||||
# From here we know both self and other are abstract
|
||||
self_hash = self.abstract_hash
|
||||
other_hash = other.abstract_hash
|
||||
|
||||
@@ -3326,32 +3323,8 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool:
|
||||
):
|
||||
return False
|
||||
|
||||
# If the names are different, we need to consider virtuals
|
||||
# We do not consider virtuals for two abstract specs, since no package is associated
|
||||
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.
|
||||
@@ -3381,40 +3354,16 @@ 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 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
|
||||
if not deps or not self._dependencies or not other._dependencies:
|
||||
return True
|
||||
|
||||
# Handle first-order constraints directly
|
||||
return self._intersects_dependencies(other)
|
||||
|
||||
def _intersects_dependencies(self, other: "Spec") -> bool:
|
||||
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:
|
||||
@@ -3439,24 +3388,22 @@ 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
|
||||
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 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 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.
|
||||
@@ -3509,10 +3456,6 @@ 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
|
||||
|
||||
@@ -3554,10 +3497,6 @@ 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.
|
||||
|
||||
@@ -457,7 +457,7 @@ def bpp_path(spec):
|
||||
|
||||
def _repoerr(repo, name):
|
||||
if name == "cmake":
|
||||
raise spack.repo.RepoError(repo_err_msg)
|
||||
raise spack.error.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.repo.RepoError, match=repo_err_msg):
|
||||
with pytest.raises(spack.error.RepoError, match=repo_err_msg):
|
||||
inst.dump_packages(spec, path)
|
||||
|
||||
out = str(capsys.readouterr()[1])
|
||||
|
||||
@@ -472,9 +472,6 @@ 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"),
|
||||
@@ -705,9 +702,9 @@ def test_copy_satisfies_transitive(self):
|
||||
assert copy[s.name].satisfies(s)
|
||||
|
||||
def test_intersects_virtual(self):
|
||||
assert Spec("mpich").intersects(Spec("mpi"))
|
||||
assert Spec("mpich2").intersects(Spec("mpi"))
|
||||
assert Spec("zmpi").intersects(Spec("mpi"))
|
||||
assert spack.concretize.concretize_one("mpich").intersects("mpi")
|
||||
assert spack.concretize.concretize_one("mpich2").intersects("mpi")
|
||||
assert spack.concretize.concretize_one("zmpi").intersects("mpi")
|
||||
|
||||
def test_intersects_virtual_providers(self):
|
||||
"""Tests that we can always intersect virtual providers from abstract specs.
|
||||
@@ -1829,9 +1826,6 @@ 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,6 +11,7 @@
|
||||
import spack.binary_distribution
|
||||
import spack.cmd
|
||||
import spack.concretize
|
||||
import spack.error
|
||||
import spack.platforms.test
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
@@ -1139,7 +1140,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.repo.UnknownEntityError) as exc_info:
|
||||
with pytest.raises(spack.error.UnknownEntityError) as exc_info:
|
||||
spack.concretize.concretize_one(spec)
|
||||
assert exc_info.value.long_message
|
||||
assert (
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
from llnl.util.filesystem import mkdirp, working_dir
|
||||
|
||||
import spack.caches
|
||||
import spack.error
|
||||
import spack.fetch_strategy
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
@@ -78,7 +79,7 @@ def pkg(self):
|
||||
try:
|
||||
pkg = spack.repo.PATH.get_pkg_class(self.pkg_name)
|
||||
pkg.git
|
||||
except (spack.repo.RepoError, AttributeError) as e:
|
||||
except (spack.error.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
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import spack.store
|
||||
from spack.package import *
|
||||
from spack.pkg.builtin.boost import Boost
|
||||
|
||||
|
||||
class CbtfKrell(CMakePackage):
|
||||
@@ -51,9 +50,17 @@ class CbtfKrell(CMakePackage):
|
||||
description="build only the FE tool using the runtime_dir to point to target build.",
|
||||
)
|
||||
|
||||
# Fix build errors with gcc >= 10
|
||||
patch(
|
||||
"https://github.com/OpenSpeedShop/cbtf-krell/commit/7d47761c6cd9110883bff9ca1e694af1475676f5.patch?full_index=1",
|
||||
sha256="64ed80d18163ca04a67be4a13ac2d2553243fc24c6274d26981472e6e2050b8a",
|
||||
)
|
||||
|
||||
# Dependencies for cbtf-krell
|
||||
depends_on("cmake@3.0.2:", type="build")
|
||||
|
||||
depends_on("gotcha")
|
||||
|
||||
# For rpcgen
|
||||
depends_on("rpcsvc-proto", type="build")
|
||||
|
||||
@@ -64,16 +71,11 @@ class CbtfKrell(CMakePackage):
|
||||
depends_on("binutils@2.32")
|
||||
|
||||
# For boost
|
||||
depends_on("boost@1.70.0:")
|
||||
|
||||
# TODO: replace this with an explicit list of components of Boost,
|
||||
# for instance depends_on('boost +filesystem')
|
||||
# See https://github.com/spack/spack/pull/22303 for reference
|
||||
depends_on(Boost.with_default_variants)
|
||||
depends_on("boost@1.70.0:+filesystem+graph+program_options+python+test+thread")
|
||||
|
||||
# For Dyninst
|
||||
depends_on("dyninst@10.1.0", when="@develop")
|
||||
depends_on("dyninst@10.1.0", when="@1.9.3:9999")
|
||||
depends_on("dyninst@10.1.0:", when="@develop")
|
||||
depends_on("dyninst@10.1.0:", when="@1.9.3:9999")
|
||||
|
||||
# For MRNet
|
||||
depends_on("mrnet@5.0.1-3:+lwthreads", when="@develop", type=("build", "link", "run"))
|
||||
|
||||
@@ -19,6 +19,7 @@ class Detray(CMakePackage):
|
||||
|
||||
license("MPL-2.0", checked_by="stephenswat")
|
||||
|
||||
version("0.88.0", sha256="bda15501c9c96af961e24ce243982f62051c535b9fe458fb28336a19b54eb47d")
|
||||
version("0.87.0", sha256="2d4a76432dd6ddbfc00b88b5d482072e471fefc264b60748bb1f9a123963576e")
|
||||
version("0.86.0", sha256="98350c94e8a2395b8712b7102fd449536857e8158b38a96cc913c79b70301170")
|
||||
version("0.85.0", sha256="a0121a27fd08243d4a6aab060e8ab379ad5129e96775b45f6a683835767fa8e7")
|
||||
|
||||
@@ -17,6 +17,7 @@ class Geomodel(CMakePackage):
|
||||
|
||||
license("Apache-2.0", checked_by="wdconinc")
|
||||
|
||||
version("6.9.0", sha256="ea34dad8a0cd392e06794b8a1b7407dd6ad617fefd19fb4cccdf36b154749793")
|
||||
version("6.8.0", sha256="4dfd5a932955ee2618a880bb210aed9ce7087cfadd31f23f92e5ff009c8384eb")
|
||||
version("6.7.0", sha256="bfa69062ba191d0844d7099b28c0d6c3c0f87e726dacfaa21dba7a6f593d34bf")
|
||||
version("6.6.0", sha256="3cefeaa409177d45d3fa63e069b6496ca062991b0d7d71275b1748487659e91b")
|
||||
|
||||
@@ -31,6 +31,12 @@ class LuaSol2(CMakePackage):
|
||||
# Lua is not needed when building, since sol2 is headers-only
|
||||
depends_on("lua", type=("link", "run"))
|
||||
|
||||
patch(
|
||||
"https://github.com/ThePhD/sol2/pull/1606.patch?full_index=1",
|
||||
when="@3.3.0 %oneapi@2025:",
|
||||
sha256="ed6c5924a0639fb1671e6d7dacbb88dce70aa006bcee2f380b6acd34da89664c",
|
||||
)
|
||||
|
||||
def cmake_args(self):
|
||||
args = [
|
||||
self.define("SOL2_ENABLE_INSTALL", True),
|
||||
|
||||
@@ -17,6 +17,9 @@ class PortsOfCall(CMakePackage):
|
||||
license("BSD-3-Clause")
|
||||
|
||||
version("main", branch="main")
|
||||
version("1.7.1", sha256="18b0b99370ef2adf3374248f653461606f826fe4076d0f19ac8c72d46035fdf5")
|
||||
version("1.7.0", sha256="99045a7c4e3fbc73f01e930ce870cdc573a39910a28d85c54d65d2135f764bfc")
|
||||
version("1.6.0", sha256="290da149d4ad79c15787956559aeeefa0a06403be2f08cd324562ef013306797")
|
||||
version("1.5.2", sha256="73d16fe9236a9475010dbb01bf751c15bef01eb2e15bf92c8d9be2c0a606329f")
|
||||
version("1.5.1", sha256="b1f0232cd6d2aac65385d77cc061ec5035283ea50d0f167e7003eae034effb78")
|
||||
version("1.4.1", sha256="82d2c75fcca8bd613273fd4126749df68ccc22fbe4134ba673b4275f9972b78d")
|
||||
@@ -44,11 +47,32 @@ class PortsOfCall(CMakePackage):
|
||||
default="None",
|
||||
when="@:1.2.0",
|
||||
)
|
||||
variant("test", default=False, description="Build tests")
|
||||
variant(
|
||||
"test_portability_strategy",
|
||||
description="Portability strategy used by tests",
|
||||
values=("Kokkos", "Cuda", "None"),
|
||||
multi=False,
|
||||
default="None",
|
||||
when="@1.7.0: +test",
|
||||
)
|
||||
|
||||
depends_on("cmake@3.12:", type="build")
|
||||
depends_on("catch2@3.0.1:", when="+test", type=("build", "test"))
|
||||
depends_on("kokkos", when="+test test_portability_strategy=Kokkos", type=("build", "test"))
|
||||
|
||||
def cmake_args(self):
|
||||
args = []
|
||||
args = [
|
||||
self.define_from_variant("PORTS_OF_CALL_BUILD_TESTING", "test"),
|
||||
self.define_from_variant(
|
||||
"PORTS_OF_CALL_TEST_PORTABILITY_STRATEGY", "test_portability_strategy"
|
||||
),
|
||||
]
|
||||
if self.spec.satisfies("@:1.2.0"):
|
||||
args.append(self.define_from_variant("PORTABILITY_STRATEGY", "portability_strategy"))
|
||||
if self.spec.satisfies("test_portability_strategy=Kokkos ^kokkos+rocm"):
|
||||
args.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc))
|
||||
args.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc))
|
||||
if self.spec.satisfies("test_portability_strategy=Kokkos ^kokkos+cuda"):
|
||||
args.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx))
|
||||
return args
|
||||
|
||||
Reference in New Issue
Block a user