Compare commits

..

2 Commits

Author SHA1 Message Date
Wouter Deconinck
29554e8446 intel-oneapi-mpi: strip @ from IMPI_OFFICIALVERSION 2024-11-18 14:09:02 -06:00
Wouter Deconinck
d92cea0a07 intel-oneapi-mpi: external detection support 2024-07-27 08:23:56 -05:00
430 changed files with 1666 additions and 4750 deletions

View File

@@ -5,10 +5,14 @@ updates:
directory: "/"
schedule:
interval: "daily"
# Requirements to run style checks and build documentation
# Requirements to build documentation
- package-ecosystem: "pip"
directories:
- "/.github/workflows/requirements/style/*"
- "/lib/spack/docs"
directory: "/lib/spack/docs"
schedule:
interval: "daily"
# Requirements to run style checks
- package-ecosystem: "pip"
directories:
- "/.github/workflows/requirements/*"
schedule:
interval: "daily"

View File

@@ -44,7 +44,6 @@ jobs:
run: |
. share/spack/setup-env.sh
coverage run $(which spack) audit packages
coverage run $(which spack) audit configs
coverage run $(which spack) -d audit externals
coverage combine
coverage xml
@@ -53,7 +52,6 @@ jobs:
run: |
. share/spack/setup-env.sh
spack -d audit packages
spack -d audit configs
spack -d audit externals
- name: Package audits (without coverage)
if: ${{ runner.os == 'Windows' }}
@@ -61,8 +59,6 @@ jobs:
. share/spack/setup-env.sh
spack -d audit packages
./share/spack/qa/validate_last_exit.ps1
spack -d audit configs
./share/spack/qa/validate_last_exit.ps1
spack -d audit externals
./share/spack/qa/validate_last_exit.ps1
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673

View File

@@ -87,7 +87,7 @@ jobs:
fi
- name: Upload Dockerfile
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: dockerfiles_${{ matrix.dockerfile[0] }}
path: dockerfiles
@@ -96,7 +96,7 @@ jobs:
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
@@ -126,7 +126,7 @@ jobs:
needs: deploy-images
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@834a144ee995460fba8ed112a2fc961b36a5ec5a
uses: actions/upload-artifact/merge@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: dockerfiles
pattern: dockerfiles_*

View File

@@ -1,6 +1,6 @@
black==24.8.0
black==24.4.2
clingo==5.7.1
flake8==7.1.1
flake8==7.1.0
isort==5.13.2
mypy==1.8.0
types-six==1.16.21.20240513

View File

@@ -61,7 +61,6 @@ packages:
tbb: [intel-tbb]
unwind: [libunwind]
uuid: [util-linux-uuid, libuuid]
wasi-sdk: [wasi-sdk-prebuilt]
xxd: [xxd-standalone, vim]
yacc: [bison, byacc]
ziglang: [zig]

View File

@@ -1,13 +1,13 @@
sphinx==7.4.7
sphinxcontrib-programoutput==0.17
sphinx_design==0.6.1
sphinx_design==0.6.0
sphinx-rtd-theme==2.0.0
python-levenshtein==0.25.1
docutils==0.20.1
pygments==2.18.0
urllib3==2.2.2
pytest==8.3.2
pytest==8.3.1
isort==5.13.2
black==24.8.0
flake8==7.1.1
mypy==1.11.1
black==24.4.2
flake8==7.1.0
mypy==1.11.0

View File

@@ -351,22 +351,6 @@ def _wrongly_named_spec(error_cls):
return errors
@config_packages
def _ensure_all_virtual_packages_have_default_providers(error_cls):
"""All virtual packages must have a default provider explicitly set."""
configuration = spack.config.create()
defaults = configuration.get("packages", scope="defaults")
default_providers = defaults["all"]["providers"]
virtuals = spack.repo.PATH.provider_index.providers
default_providers_filename = configuration.scopes["defaults"].get_section_filename("packages")
return [
error_cls(f"'{virtual}' must have a default provider in {default_providers_filename}", [])
for virtual in virtuals
if virtual not in default_providers
]
def _make_config_error(config_data, summary, error_cls):
s = io.StringIO()
s.write("Occurring in the following file:\n")

View File

@@ -139,10 +139,6 @@ def configure(self, pkg, spec, prefix):
args = ["--verbose", "--target-dir", inspect.getmodule(self.pkg).python_platlib]
args.extend(self.configure_args())
# https://github.com/Python-SIP/sip/commit/cb0be6cb6e9b756b8b0db3136efb014f6fb9b766
if spec["py-sip"].satisfies("@6.1.0:"):
args.extend(["--scripts-dir", pkg.prefix.bin])
sip_build = Executable(spec["py-sip"].prefix.bin.join("sip-build"))
sip_build(*args)

View File

@@ -71,7 +71,7 @@
# TODO: Remove this in Spack 0.23
SHARED_PR_MIRROR_URL = "s3://spack-binaries-prs/shared_pr_mirror"
JOB_NAME_FORMAT = (
"{name}{@version} {/hash:7} {%compiler.name}{@compiler.version}{ arch=architecture}"
"{name}{@version} {/hash:7} {%compiler.name}{@compiler.version}{arch=architecture}"
)
IS_WINDOWS = sys.platform == "win32"
spack_gpg = spack.main.SpackCommand("gpg")

View File

@@ -237,7 +237,7 @@ def ensure_single_spec_or_die(spec, matching_specs):
if len(matching_specs) <= 1:
return
format_string = "{name}{@version}{%compiler.name}{@compiler.version}{ arch=architecture}"
format_string = "{name}{@version}{%compiler.name}{@compiler.version}{arch=architecture}"
args = ["%s matches multiple packages." % spec, "Matching packages:"]
args += [
colorize(" @K{%s} " % s.dag_hash(7)) + s.cformat(format_string) for s in matching_specs

View File

@@ -339,7 +339,7 @@ def add(self, pkg_name, fetcher):
for pkg_cls in spack.repo.PATH.all_package_classes():
npkgs += 1
for v in list(pkg_cls.versions):
for v in pkg_cls.versions:
try:
pkg = pkg_cls(spack.spec.Spec(pkg_cls.name))
fetcher = fs.for_package_version(pkg, v)

View File

@@ -231,55 +231,24 @@ def msvc_version(self):
@property
def short_msvc_version(self):
"""This is the shorthand VCToolset version of form
MSVC<short-ver>
"""
return "MSVC" + self.vc_toolset_ver
@property
def vc_toolset_ver(self):
"""
The toolset version is the version of the combined set of cl and link
This typically relates directly to VS version i.e. VS 2022 is v143
VS 19 is v142, etc.
This value is defined by the first three digits of the major + minor
version of the VS toolset (143 for 14.3x.bbbbb). Traditionally the
minor version has remained a static two digit number for a VS release
series, however, as of VS22, this is no longer true, both
14.4x.bbbbb and 14.3x.bbbbb are considered valid VS22 VC toolset
versions due to a change in toolset minor version sentiment.
This is *NOT* the full version, for that see
This is the shorthand VCToolset version of form
MSVC<short-ver> *NOT* the full version, for that see
Msvc.msvc_version or MSVC.platform_toolset_ver for the
raw platform toolset version
"""
ver = self.msvc_version[:2].joined.string[:3]
return ver
ver = self.platform_toolset_ver
return "MSVC" + ver
@property
def platform_toolset_ver(self):
"""
This is the platform toolset version of current MSVC compiler
i.e. 142. The platform toolset is the targeted MSVC library/compiler
versions by compilation (this is different from the VC Toolset)
i.e. 142.
This is different from the VC toolset version as established
by `short_msvc_version`, but typically are represented by the same
three digit value
by `short_msvc_version`
"""
# Typically VS toolset version and platform toolset versions match
# VS22 introduces the first divergence of VS toolset version
# (144 for "recent" releases) and platform toolset version (143)
# so it needs additional handling until MS releases v144
# (assuming v144 is also for VS22)
# or adds better support for detection
# TODO: (johnwparent) Update this logic for the next platform toolset
# or VC toolset version update
toolset_ver = self.vc_toolset_ver
vs22_toolset = Version(toolset_ver) > Version("142")
return toolset_ver if not vs22_toolset else "143"
return self.msvc_version[:2].joined.string[:3]
def _compiler_version(self, compiler):
"""Returns version object for given compiler"""

View File

@@ -81,17 +81,7 @@ class OpenMpi(Package):
]
#: These are variant names used by Spack internally; packages can't use them
reserved_names = [
"arch",
"architecture",
"dev_path",
"namespace",
"operating_system",
"os",
"patches",
"platform",
"target",
]
reserved_names = ["patches", "dev_path"]
#: Names of possible directives. This list is mostly populated using the @directive decorator.
#: Some directives leverage others and in that case are not automatically added.

View File

@@ -328,26 +328,19 @@ def next_spec(
if not self.ctx.next_token:
return initial_spec
def add_dependency(dep, **edge_properties):
"""wrapper around root_spec._add_dependency"""
try:
root_spec._add_dependency(dep, **edge_properties)
except spack.error.SpecError as e:
raise SpecParsingError(str(e), self.ctx.current_token, self.literal_str) from e
initial_spec = initial_spec or spack.spec.Spec()
root_spec = SpecNodeParser(self.ctx, self.literal_str).parse(initial_spec)
root_spec = SpecNodeParser(self.ctx).parse(initial_spec)
while True:
if self.ctx.accept(TokenType.START_EDGE_PROPERTIES):
edge_properties = EdgeAttributeParser(self.ctx, self.literal_str).parse()
edge_properties.setdefault("depflag", 0)
edge_properties.setdefault("virtuals", ())
dependency = self._parse_node(root_spec)
add_dependency(dependency, **edge_properties)
root_spec._add_dependency(dependency, **edge_properties)
elif self.ctx.accept(TokenType.DEPENDENCY):
dependency = self._parse_node(root_spec)
add_dependency(dependency, depflag=0, virtuals=())
root_spec._add_dependency(dependency, depflag=0, virtuals=())
else:
break
@@ -355,7 +348,7 @@ def add_dependency(dep, **edge_properties):
return root_spec
def _parse_node(self, root_spec):
dependency = SpecNodeParser(self.ctx, self.literal_str).parse()
dependency = SpecNodeParser(self.ctx).parse()
if dependency is None:
msg = (
"the dependency sigil and any optional edge attributes must be followed by a "
@@ -374,11 +367,10 @@ def all_specs(self) -> List["spack.spec.Spec"]:
class SpecNodeParser:
"""Parse a single spec node from a stream of tokens"""
__slots__ = "ctx", "has_compiler", "has_version", "literal_str"
__slots__ = "ctx", "has_compiler", "has_version"
def __init__(self, ctx, literal_str):
def __init__(self, ctx):
self.ctx = ctx
self.literal_str = literal_str
self.has_compiler = False
self.has_version = False
@@ -396,8 +388,7 @@ def parse(
if not self.ctx.next_token or self.ctx.expect(TokenType.DEPENDENCY):
return initial_spec
if initial_spec is None:
initial_spec = spack.spec.Spec()
initial_spec = initial_spec or spack.spec.Spec()
# If we start with a package name we have a named spec, we cannot
# accept another package name afterwards in a node
@@ -414,21 +405,12 @@ def parse(
elif self.ctx.accept(TokenType.FILENAME):
return FileParser(self.ctx).parse(initial_spec)
def raise_parsing_error(string: str, cause: Optional[Exception] = None):
"""Raise a spec parsing error with token context."""
raise SpecParsingError(string, self.ctx.current_token, self.literal_str) from cause
def add_flag(name: str, value: str, propagate: bool):
"""Wrapper around ``Spec._add_flag()`` that adds parser context to errors raised."""
try:
initial_spec._add_flag(name, value, propagate)
except Exception as e:
raise_parsing_error(str(e), e)
while True:
if self.ctx.accept(TokenType.COMPILER):
if self.has_compiler:
raise_parsing_error("Spec cannot have multiple compilers")
raise spack.spec.DuplicateCompilerSpecError(
f"{initial_spec} cannot have multiple compilers"
)
compiler_name = self.ctx.current_token.value[1:]
initial_spec.compiler = spack.spec.CompilerSpec(compiler_name.strip(), ":")
@@ -436,7 +418,9 @@ def add_flag(name: str, value: str, propagate: bool):
elif self.ctx.accept(TokenType.COMPILER_AND_VERSION):
if self.has_compiler:
raise_parsing_error("Spec cannot have multiple compilers")
raise spack.spec.DuplicateCompilerSpecError(
f"{initial_spec} cannot have multiple compilers"
)
compiler_name, compiler_version = self.ctx.current_token.value[1:].split("@")
initial_spec.compiler = spack.spec.CompilerSpec(
@@ -450,8 +434,9 @@ def add_flag(name: str, value: str, propagate: bool):
or self.ctx.accept(TokenType.VERSION)
):
if self.has_version:
raise_parsing_error("Spec cannot have multiple versions")
raise spack.spec.MultipleVersionError(
f"{initial_spec} cannot have multiple versions"
)
initial_spec.versions = spack.version.VersionList(
[spack.version.from_string(self.ctx.current_token.value[1:])]
)
@@ -460,25 +445,29 @@ def add_flag(name: str, value: str, propagate: bool):
elif self.ctx.accept(TokenType.BOOL_VARIANT):
variant_value = self.ctx.current_token.value[0] == "+"
add_flag(self.ctx.current_token.value[1:].strip(), variant_value, propagate=False)
initial_spec._add_flag(
self.ctx.current_token.value[1:].strip(), variant_value, propagate=False
)
elif self.ctx.accept(TokenType.PROPAGATED_BOOL_VARIANT):
variant_value = self.ctx.current_token.value[0:2] == "++"
add_flag(self.ctx.current_token.value[2:].strip(), variant_value, propagate=True)
initial_spec._add_flag(
self.ctx.current_token.value[2:].strip(), variant_value, propagate=True
)
elif self.ctx.accept(TokenType.KEY_VALUE_PAIR):
match = SPLIT_KVP.match(self.ctx.current_token.value)
assert match, "SPLIT_KVP and KEY_VALUE_PAIR do not agree."
name, _, value = match.groups()
add_flag(name, strip_quotes_and_unescape(value), propagate=False)
name, delim, value = match.groups()
initial_spec._add_flag(name, strip_quotes_and_unescape(value), propagate=False)
elif self.ctx.accept(TokenType.PROPAGATED_KEY_VALUE_PAIR):
match = SPLIT_KVP.match(self.ctx.current_token.value)
assert match, "SPLIT_KVP and PROPAGATED_KEY_VALUE_PAIR do not agree."
name, _, value = match.groups()
add_flag(name, strip_quotes_and_unescape(value), propagate=True)
name, delim, value = match.groups()
initial_spec._add_flag(name, strip_quotes_and_unescape(value), propagate=True)
elif self.ctx.expect(TokenType.DAG_HASH):
if initial_spec.abstract_hash:

View File

@@ -1438,14 +1438,16 @@ def condition(
# caller, we won't emit partial facts.
condition_id = next(self._id_counter)
self.gen.fact(fn.pkg_fact(required_spec.name, fn.condition(condition_id)))
self.gen.fact(fn.condition_reason(condition_id, msg))
trigger_id = self._get_condition_id(
required_spec, cache=self._trigger_cache, body=True, transform=transform_required
)
self.gen.fact(fn.pkg_fact(required_spec.name, fn.condition(condition_id)))
self.gen.fact(fn.condition_reason(condition_id, msg))
self.gen.fact(
fn.pkg_fact(required_spec.name, fn.condition_trigger(condition_id, trigger_id))
)
if not imposed_spec:
return condition_id
@@ -1694,43 +1696,19 @@ def external_packages(self):
spack.spec.parse_with_version_concrete(x["spec"]) for x in externals
]
selected_externals = set()
external_specs = []
if spec_filters:
for current_filter in spec_filters:
current_filter.factory = lambda: candidate_specs
selected_externals.update(current_filter.selected_specs())
# Emit facts for externals specs. Note that "local_idx" is the index of the spec
# in packages:<pkg_name>:externals. This means:
#
# packages:<pkg_name>:externals[local_idx].spec == spec
external_versions = []
for local_idx, spec in enumerate(candidate_specs):
msg = f"{spec.name} available as external when satisfying {spec}"
if spec_filters and spec not in selected_externals:
continue
if not spec.versions.concrete:
warnings.warn(f"cannot use the external spec {spec}: needs a concrete version")
continue
def external_imposition(input_spec, requirements):
return requirements + [
fn.attr("external_conditions_hold", input_spec.name, local_idx)
]
try:
self.condition(spec, spec, msg=msg, transform_imposed=external_imposition)
except (spack.error.SpecError, RuntimeError) as e:
warnings.warn(f"while setting up external spec {spec}: {e}")
continue
external_versions.append((spec.version, local_idx))
self.possible_versions[spec.name].add(spec.version)
self.gen.newline()
external_specs.extend(current_filter.selected_specs())
else:
external_specs.extend(candidate_specs)
# Order the external versions to prefer more recent versions
# even if specs in packages.yaml are not ordered that way
external_versions = [
(x.version, external_id) for external_id, x in enumerate(external_specs)
]
external_versions = [
(v, idx, external_id)
for idx, (v, external_id) in enumerate(sorted(external_versions, reverse=True))
@@ -1740,6 +1718,19 @@ def external_imposition(input_spec, requirements):
DeclaredVersion(version=version, idx=idx, origin=Provenance.EXTERNAL)
)
# Declare external conditions with a local index into packages.yaml
for local_idx, spec in enumerate(external_specs):
msg = "%s available as external when satisfying %s" % (spec.name, spec)
def external_imposition(input_spec, requirements):
return requirements + [
fn.attr("external_conditions_hold", input_spec.name, local_idx)
]
self.condition(spec, spec, msg=msg, transform_imposed=external_imposition)
self.possible_versions[spec.name].add(spec.version)
self.gen.newline()
self.trigger_rules()
self.effect_rules()

View File

@@ -99,7 +99,7 @@
"CompilerSpec",
"Spec",
"SpecParseError",
"UnsupportedPropagationError",
"ArchitecturePropagationError",
"DuplicateDependencyError",
"DuplicateCompilerSpecError",
"UnsupportedCompilerError",
@@ -129,7 +129,7 @@
r"|" # or
# OPTION 2: an actual format string
r"{" # non-escaped open brace {
r"([%@/]|[\w ][\w -]*=)?" # optional sigil (or identifier or space) to print sigil in color
r"([%@/]|arch=)?" # optional sigil (to print sigil in color)
r"(?:\^([^}\.]+)\.)?" # optional ^depname. (to get attr from dependency)
# after the sigil or depname, we can have a hash expression or another attribute
r"(?:" # one of
@@ -163,14 +163,14 @@
DEFAULT_FORMAT = (
"{name}{@versions}"
"{%compiler.name}{@compiler.versions}{compiler_flags}"
"{variants}{ namespace=namespace_if_anonymous}{ arch=architecture}{/abstract_hash}"
"{variants}{arch=architecture}{/abstract_hash}"
)
#: Display format, which eliminates extra `@=` in the output, for readability.
DISPLAY_FORMAT = (
"{name}{@version}"
"{%compiler.name}{@compiler.version}{compiler_flags}"
"{variants}{ namespace=namespace_if_anonymous}{ arch=architecture}{/abstract_hash}"
"{variants}{arch=architecture}{/abstract_hash}"
)
#: Regular expression to pull spec contents out of clearsigned signature
@@ -1640,9 +1640,19 @@ def _add_flag(self, name, value, propagate):
Known flags currently include "arch"
"""
if propagate and name in spack.directives.reserved_names:
raise UnsupportedPropagationError(
f"Propagation with '==' is not supported for '{name}'."
# If the == syntax is used to propagate the spec architecture
# This is an error
architecture_names = [
"arch",
"architecture",
"platform",
"os",
"operating_system",
"target",
]
if propagate and name in architecture_names:
raise ArchitecturePropagationError(
"Unable to propagate the architecture failed." " Use a '=' instead."
)
valid_flags = FlagMap.valid_compiler_flags()
@@ -1656,8 +1666,6 @@ def _add_flag(self, name, value, propagate):
self._set_architecture(os=value)
elif name == "target":
self._set_architecture(target=value)
elif name == "namespace":
self.namespace = value
elif name in valid_flags:
assert self.compiler_flags is not None
flags_and_propagation = spack.compiler.tokenize_flags(value, propagate)
@@ -1677,7 +1685,9 @@ def _set_architecture(self, **kwargs):
"""Called by the parser to set the architecture."""
arch_attrs = ["platform", "os", "target"]
if self.architecture and self.architecture.concrete:
raise DuplicateArchitectureError("Spec cannot have two architectures.")
raise DuplicateArchitectureError(
"Spec for '%s' cannot have two architectures." % self.name
)
if not self.architecture:
new_vals = tuple(kwargs.get(arg, None) for arg in arch_attrs)
@@ -1686,7 +1696,10 @@ def _set_architecture(self, **kwargs):
new_attrvals = [(a, v) for a, v in kwargs.items() if a in arch_attrs]
for new_attr, new_value in new_attrvals:
if getattr(self.architecture, new_attr):
raise DuplicateArchitectureError(f"Cannot specify '{new_attr}' twice")
raise DuplicateArchitectureError(
"Spec for '%s' cannot have two '%s' specified "
"for its architecture" % (self.name, new_attr)
)
else:
setattr(self.architecture, new_attr, new_value)
@@ -1881,14 +1894,14 @@ def short_spec(self):
"""Returns a version of the spec with the dependencies hashed
instead of completely enumerated."""
spec_format = "{name}{@version}{%compiler.name}{@compiler.version}"
spec_format += "{variants}{ arch=architecture}{/hash:7}"
spec_format += "{variants}{arch=architecture}{/hash:7}"
return self.format(spec_format)
@property
def cshort_spec(self):
"""Returns an auto-colorized version of ``self.short_spec``."""
spec_format = "{name}{@version}{%compiler.name}{@compiler.version}"
spec_format += "{variants}{ arch=architecture}{/hash:7}"
spec_format += "{variants}{arch=architecture}{/hash:7}"
return self.cformat(spec_format)
@property
@@ -4373,19 +4386,14 @@ def deps():
yield deps
@property
def namespace_if_anonymous(self):
return self.namespace if not self.name else None
def format(self, format_string: str = DEFAULT_FORMAT, color: Optional[bool] = False) -> str:
r"""Prints out attributes of a spec according to a format string.
r"""Prints out particular pieces of a spec, depending on what is
in the format string.
Using an ``{attribute}`` format specifier, any field of the spec can be
selected. Those attributes can be recursive. For example,
``s.format({compiler.version})`` will print the version of the compiler.
If the attribute in a format specifier evaluates to ``None``, then the format
specifier will evaluate to the empty string, ``""``.
Using the ``{attribute}`` syntax, any field of the spec can be
selected. Those attributes can be recursive. For example,
``s.format({compiler.version})`` will print the version of the
compiler.
Commonly used attributes of the Spec for format strings include::
@@ -4401,7 +4409,6 @@ def format(self, format_string: str = DEFAULT_FORMAT, color: Optional[bool] = Fa
architecture.os
architecture.target
prefix
namespace
Some additional special-case properties can be added::
@@ -4410,51 +4417,40 @@ def format(self, format_string: str = DEFAULT_FORMAT, color: Optional[bool] = Fa
spack_install The spack install directory
The ``^`` sigil can be used to access dependencies by name.
``s.format({^mpi.name})`` will print the name of the MPI implementation in the
spec.
``s.format({^mpi.name})`` will print the name of the MPI
implementation in the spec.
The ``@``, ``%``, and ``/`` sigils can be used to include the sigil with the
printed string. These sigils may only be used with the appropriate attributes,
listed below::
The ``@``, ``%``, ``arch=``, and ``/`` sigils
can be used to include the sigil with the printed
string. These sigils may only be used with the appropriate
attributes, listed below::
@ ``{@version}``, ``{@compiler.version}``
% ``{%compiler}``, ``{%compiler.name}``
arch= ``{arch=architecture}``
/ ``{/hash}``, ``{/hash:7}``, etc
The ``@`` sigil may also be used for any other property named ``version``.
Sigils printed with the attribute string are only printed if the attribute
string is non-empty, and are colored according to the color of the attribute.
The ``@`` sigil may also be used for any other property named
``version``. Sigils printed with the attribute string are only
printed if the attribute string is non-empty, and are colored
according to the color of the attribute.
Variants listed by name naturally print with their sigil. For example,
``spec.format('{variants.debug}')`` prints either ``+debug`` or ``~debug``
depending on the name of the variant. Non-boolean variants print as
``name=value``. To print variant names or values independently, use
Sigils are not used for printing variants. Variants listed by
name naturally print with their sigil. For example,
``spec.format('{variants.debug}')`` would print either
``+debug`` or ``~debug`` depending on the name of the
variant. Non-boolean variants print as ``name=value``. To
print variant names or values independently, use
``spec.format('{variants.<name>.name}')`` or
``spec.format('{variants.<name>.value}')``.
There are a few attributes on specs that can be specified as key-value pairs
that are *not* variants, e.g.: ``os``, ``arch``, ``architecture``, ``target``,
``namespace``, etc. You can format these with an optional ``key=`` prefix, e.g.
``{namespace=namespace}`` or ``{arch=architecture}``, etc. The ``key=`` prefix
will be colorized along with the value.
When formatting specs, key-value pairs are separated from preceding parts of the
spec by whitespace. To avoid printing extra whitespace when the formatted
attribute is not set, you can add whitespace to the key *inside* the braces of
the format string, e.g.:
{ namespace=namespace}
This evaluates to `` namespace=builtin`` if ``namespace`` is set to ``builtin``,
and to ``""`` if ``namespace`` is ``None``.
Spec format strings use ``\`` as the escape character. Use ``\{`` and ``\}`` for
literal braces, and ``\\`` for the literal ``\`` character.
Spec format strings use ``\`` as the escape character. Use
``\{`` and ``\}`` for literal braces, and ``\\`` for the
literal ``\`` character.
Args:
format_string: string containing the format to be expanded
color: True for colorized result; False for no color; None for auto color.
"""
ensure_modern_format_string(format_string)
@@ -4508,6 +4504,10 @@ def format_attribute(match_object: Match) -> str:
raise SpecFormatSigilError(sig, "compilers", attribute)
elif sig == "/" and attribute != "abstract_hash":
raise SpecFormatSigilError(sig, "DAG hashes", attribute)
elif sig == "arch=":
if attribute not in ("architecture", "arch"):
raise SpecFormatSigilError(sig, "the architecture", attribute)
sig = " arch=" # include space as separator
# Iterate over components using getattr to get next element
for idx, part in enumerate(parts):
@@ -4552,19 +4552,15 @@ def format_attribute(match_object: Match) -> str:
# Set color codes for various attributes
color = None
if "architecture" in parts:
color = ARCHITECTURE_COLOR
elif "variants" in parts or sig.endswith("="):
if "variants" in parts:
color = VARIANT_COLOR
elif "architecture" in parts:
color = ARCHITECTURE_COLOR
elif "compiler" in parts or "compiler_flags" in parts:
color = COMPILER_COLOR
elif "version" in parts or "versions" in parts:
color = VERSION_COLOR
# return empty string if the value of the attribute is None.
if current is None:
return ""
# return colored output
return safe_color(sig, str(current), color)
@@ -5394,8 +5390,10 @@ def long_message(self):
)
class UnsupportedPropagationError(spack.error.SpecError):
"""Raised when propagation (==) is used with reserved variant names."""
class ArchitecturePropagationError(spack.error.SpecError):
"""Raised when the double equal symbols are used to assign
the spec's architecture.
"""
class DuplicateDependencyError(spack.error.SpecError):
@@ -5525,7 +5523,7 @@ def __init__(self, spec):
class AmbiguousHashError(spack.error.SpecError):
def __init__(self, msg, *specs):
spec_fmt = "{namespace}.{name}{@version}{%compiler}{compiler_flags}"
spec_fmt += "{variants}{ arch=architecture}{/hash:7}"
spec_fmt += "{variants}{arch=architecture}{/hash:7}"
specs_str = "\n " + "\n ".join(spec.format(spec_fmt) for spec in specs)
super().__init__(msg + specs_str)

View File

@@ -2609,55 +2609,6 @@ def test_cannot_reuse_host_incompatible_libc(self):
assert len(result.specs) == 1
assert result.specs[0] == snd
@pytest.mark.regression("45321")
@pytest.mark.parametrize(
"corrupted_str",
[
"cmake@3.4.3 foo=bar", # cmake has no variant "foo"
"mvdefaults@1.0 foo=a,d", # variant "foo" has no value "d"
"cmake %gcc", # spec has no version
],
)
def test_corrupted_external_does_not_halt_concretization(self, corrupted_str, mutable_config):
"""Tests that having a wrong variant in an external spec doesn't stop concretization"""
corrupted_spec = Spec(corrupted_str)
packages_yaml = {
f"{corrupted_spec.name}": {
"externals": [{"spec": corrupted_str, "prefix": "/dev/null"}]
}
}
mutable_config.set("packages", packages_yaml)
# Assert we don't raise due to the corrupted external entry above
s = Spec("pkg-a").concretized()
assert s.concrete
@pytest.mark.regression("44828")
@pytest.mark.not_on_windows("Tests use linux paths")
def test_correct_external_is_selected_from_packages_yaml(self, mutable_config):
"""Tests that when filtering external specs, the correct external is selected to
reconstruct the prefix, and other external attributes.
"""
packages_yaml = {
"cmake": {
"externals": [
{"spec": "cmake@3.23.1 %gcc", "prefix": "/tmp/prefix1"},
{"spec": "cmake@3.23.1 %clang", "prefix": "/tmp/prefix2"},
]
}
}
concretizer_yaml = {
"reuse": {"roots": True, "from": [{"type": "external", "exclude": ["%gcc"]}]}
}
mutable_config.set("packages", packages_yaml)
mutable_config.set("concretizer", concretizer_yaml)
s = Spec("cmake").concretized()
# Check that we got the properties from the right external
assert s.external
assert s.satisfies("%clang")
assert s.prefix == "/tmp/prefix2"
@pytest.fixture()
def duplicates_test_repository():

View File

@@ -131,6 +131,19 @@ def test_relative_import_spack_packages_as_python_modules(mock_packages):
assert issubclass(Mpileaks, spack.package_base.PackageBase)
def test_all_virtual_packages_have_default_providers():
"""All virtual packages must have a default provider explicitly set."""
configuration = spack.config.create()
defaults = configuration.get("packages", scope="defaults")
default_providers = defaults["all"]["providers"]
providers = spack.repo.PATH.provider_index.providers
default_providers_filename = configuration.scopes["defaults"].get_section_filename("packages")
for provider in providers:
assert provider in default_providers, (
"all providers must have a default in %s" % default_providers_filename
)
def test_get_all_mock_packages(mock_packages):
"""Get the mock packages once each too."""
for name in mock_packages.all_package_names():

View File

@@ -197,9 +197,6 @@ class TestSpecSemantics:
'multivalue-variant foo="baz"',
'multivalue-variant foo="bar,baz,barbaz"',
),
# Namespace (special case, but like variants
("builtin.libelf", "namespace=builtin", "builtin.libelf"),
("libelf", "namespace=builtin", "builtin.libelf"),
# Flags
("mpich ", 'mpich cppflags="-O3"', 'mpich cppflags="-O3"'),
(
@@ -320,7 +317,6 @@ def test_concrete_specs_which_satisfies_abstract(self, lhs, rhs, default_mock_co
("libelf debug=True", "libelf debug=False"),
('libelf cppflags="-O3"', 'libelf cppflags="-O2"'),
("libelf platform=test target=be os=be", "libelf target=fe os=fe"),
("namespace=builtin.mock", "namespace=builtin"),
],
)
def test_constraining_abstract_specs_with_empty_intersection(self, lhs, rhs):
@@ -410,25 +406,6 @@ def test_indirect_unsatisfied_single_valued_variant(self):
spec.concretize()
assert "pkg-a@1.0" not in spec
def test_satisfied_namespace(self):
spec = Spec("zlib").concretized()
assert spec.satisfies("namespace=builtin.mock")
assert not spec.satisfies("namespace=builtin")
@pytest.mark.parametrize(
"spec_string",
[
"tcl namespace==foobar",
"tcl arch==foobar",
"tcl os==foobar",
"tcl patches==foobar",
"tcl dev_path==foobar",
],
)
def test_propagate_reserved_variant_names(self, spec_string):
with pytest.raises(spack.parser.SpecParsingError, match="Propagation"):
Spec(spec_string)
def test_unsatisfiable_multi_value_variant(self, default_mock_concretization):
# Semantics for a multi-valued variant is different
# Depending on whether the spec is concrete or not
@@ -679,7 +656,6 @@ def test_spec_formatting(self, default_mock_concretization):
("{@VERSIONS}", "@", "versions", lambda spec: spec),
("{%compiler}", "%", "compiler", lambda spec: spec),
("{arch=architecture}", "arch=", "architecture", lambda spec: spec),
("{namespace=namespace}", "namespace=", "namespace", lambda spec: spec),
("{compiler.name}", "", "name", lambda spec: spec.compiler),
("{compiler.version}", "", "version", lambda spec: spec.compiler),
("{%compiler.name}", "%", "name", lambda spec: spec.compiler),
@@ -730,40 +706,13 @@ def check_prop(check_spec, fmt_str, prop, getter):
@pytest.mark.parametrize(
"fmt_str",
[
"{name}",
"{version}",
"{@version}",
"{%compiler}",
"{namespace}",
"{ namespace=namespace}",
"{ namespace =namespace}",
"{ name space =namespace}",
"{arch}",
"{architecture}",
"{arch=architecture}",
"{ arch=architecture}",
"{ arch =architecture}",
"{@name}",
"{@version.concrete}",
"{%compiler.version}",
"{/hashd}",
"{arch=architecture.os}",
],
)
def test_spec_format_null_attributes(self, fmt_str):
"""Ensure that attributes format to empty strings when their values are null."""
spec = spack.spec.Spec()
assert spec.format(fmt_str) == ""
def test_spec_formatting_spaces_in_key(self, default_mock_concretization):
spec = default_mock_concretization("multivalue-variant cflags=-O2")
# test that spaces are preserved, if they come after some other text, otherwise
# they are trimmed.
# TODO: should we be trimming whitespace from formats? Probably not.
assert spec.format("x{ arch=architecture}") == f"x arch={spec.architecture}"
assert spec.format("x{ namespace=namespace}") == f"x namespace={spec.namespace}"
assert spec.format("x{ name space =namespace}") == f"x name space ={spec.namespace}"
assert spec.format("x{ os =os}") == f"x os ={spec.os}"
@pytest.mark.parametrize(
"fmt_str", ["{@name}", "{@version.concrete}", "{%compiler.version}", "{/hashd}"]
)
def test_spec_formatting_sigil_mismatches(self, default_mock_concretization, fmt_str):
spec = default_mock_concretization("multivalue-variant cflags=-O2")
@@ -791,11 +740,11 @@ def test_spec_formatting_bad_formats(self, default_mock_concretization, fmt_str)
def test_combination_of_wildcard_or_none(self):
# Test that using 'none' and another value raises
with pytest.raises(spack.parser.SpecParsingError, match="cannot be combined"):
with pytest.raises(spack.variant.InvalidVariantValueCombinationError):
Spec("multivalue-variant foo=none,bar")
# Test that using wildcard and another value raises
with pytest.raises(spack.parser.SpecParsingError, match="cannot be combined"):
with pytest.raises(spack.variant.InvalidVariantValueCombinationError):
Spec("multivalue-variant foo=*,bar")
def test_errors_in_variant_directive(self):

View File

@@ -952,60 +952,64 @@ def test_disambiguate_hash_by_spec(spec1, spec2, constraint, mock_packages, monk
@pytest.mark.parametrize(
"text,match_string",
"text,exc_cls",
[
# Duplicate variants
("x@1.2+debug+debug", "variant"),
("x ^y@1.2+debug debug=true", "variant"),
("x ^y@1.2 debug=false debug=true", "variant"),
("x ^y@1.2 debug=false ~debug", "variant"),
("x@1.2+debug+debug", spack.variant.DuplicateVariantError),
("x ^y@1.2+debug debug=true", spack.variant.DuplicateVariantError),
("x ^y@1.2 debug=false debug=true", spack.variant.DuplicateVariantError),
("x ^y@1.2 debug=false ~debug", spack.variant.DuplicateVariantError),
# Multiple versions
("x@1.2@2.3", "version"),
("x@1.2:2.3@1.4", "version"),
("x@1.2@2.3:2.4", "version"),
("x@1.2@2.3,2.4", "version"),
("x@1.2 +foo~bar @2.3", "version"),
("x@1.2%y@1.2@2.3:2.4", "version"),
("x@1.2@2.3", spack.spec.MultipleVersionError),
("x@1.2:2.3@1.4", spack.spec.MultipleVersionError),
("x@1.2@2.3:2.4", spack.spec.MultipleVersionError),
("x@1.2@2.3,2.4", spack.spec.MultipleVersionError),
("x@1.2 +foo~bar @2.3", spack.spec.MultipleVersionError),
("x@1.2%y@1.2@2.3:2.4", spack.spec.MultipleVersionError),
# Duplicate dependency
("x ^y@1 ^y@2", "Cannot depend on incompatible specs"),
("x ^y@1 ^y@2", spack.spec.DuplicateDependencyError),
# Duplicate compiler
("x%intel%intel", "compiler"),
("x%intel%gcc", "compiler"),
("x%gcc%intel", "compiler"),
("x ^y%intel%intel", "compiler"),
("x ^y%intel%gcc", "compiler"),
("x ^y%gcc%intel", "compiler"),
("x%intel%intel", spack.spec.DuplicateCompilerSpecError),
("x%intel%gcc", spack.spec.DuplicateCompilerSpecError),
("x%gcc%intel", spack.spec.DuplicateCompilerSpecError),
("x ^y%intel%intel", spack.spec.DuplicateCompilerSpecError),
("x ^y%intel%gcc", spack.spec.DuplicateCompilerSpecError),
("x ^y%gcc%intel", spack.spec.DuplicateCompilerSpecError),
# Duplicate Architectures
("x arch=linux-rhel7-x86_64 arch=linux-rhel7-x86_64", "two architectures"),
("x arch=linux-rhel7-x86_64 arch=linux-rhel7-ppc64le", "two architectures"),
("x arch=linux-rhel7-ppc64le arch=linux-rhel7-x86_64", "two architectures"),
("y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-x86_64", "two architectures"),
("y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-ppc64le", "two architectures"),
("x os=fe os=fe", "'os'"),
("x os=fe os=be", "'os'"),
("x target=fe target=fe", "'target'"),
("x target=fe target=be", "'target'"),
("x platform=test platform=test", "'platform'"),
# TODO: these two seem wrong: need to change how arch is initialized (should fail on os)
("x os=fe platform=test target=fe os=fe", "'platform'"),
("x target=be platform=test os=be os=fe", "'platform'"),
# Dependencies
("^[@foo] zlib", "edge attributes"),
(
"x arch=linux-rhel7-x86_64 arch=linux-rhel7-x86_64",
spack.spec.DuplicateArchitectureError,
),
(
"x arch=linux-rhel7-x86_64 arch=linux-rhel7-ppc64le",
spack.spec.DuplicateArchitectureError,
),
(
"x arch=linux-rhel7-ppc64le arch=linux-rhel7-x86_64",
spack.spec.DuplicateArchitectureError,
),
(
"y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-x86_64",
spack.spec.DuplicateArchitectureError,
),
(
"y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-ppc64le",
spack.spec.DuplicateArchitectureError,
),
("x os=fe os=fe", spack.spec.DuplicateArchitectureError),
("x os=fe os=be", spack.spec.DuplicateArchitectureError),
("x target=fe target=fe", spack.spec.DuplicateArchitectureError),
("x target=fe target=be", spack.spec.DuplicateArchitectureError),
("x platform=test platform=test", spack.spec.DuplicateArchitectureError),
("x os=fe platform=test target=fe os=fe", spack.spec.DuplicateArchitectureError),
("x target=be platform=test os=be os=fe", spack.spec.DuplicateArchitectureError),
("^[@foo] zlib", spack.parser.SpecParsingError),
# TODO: Remove this as soon as use variants are added and we can parse custom attributes
("^[foo=bar] zlib", "edge attributes"),
# Propagating reserved names generates a parse error
("x namespace==foo.bar.baz", "Propagation"),
("x arch==linux-rhel9-x86_64", "Propagation"),
("x architecture==linux-rhel9-x86_64", "Propagation"),
("x os==rhel9", "Propagation"),
("x operating_system==rhel9", "Propagation"),
("x target==x86_64", "Propagation"),
("x dev_path==/foo/bar/baz", "Propagation"),
("x patches==abcde12345,12345abcde", "Propagation"),
("^[foo=bar] zlib", spack.parser.SpecParsingError),
],
)
def test_error_conditions(text, match_string):
with pytest.raises(spack.parser.SpecParsingError, match=match_string):
def test_error_conditions(text, exc_cls):
with pytest.raises(exc_cls):
SpecParser(text).next_spec()

View File

@@ -67,16 +67,14 @@ spack:
specs:
# CPU
- adios
- alquimia
- aml
- adios
- amrex
- arborx
- argobots
- axom
- bolt
- boost
- bricks ~cuda
- butterflypack
- cabana
- caliper
@@ -84,20 +82,15 @@ spack:
- charliecloud
- conduit
- datatransferkit
- dealii
- drishti
- dxt-explorer
- ecp-data-vis-sdk ~cuda ~rocm +adios2 ~ascent +cinema +darshan +faodel +hdf5 +paraview +pnetcdf +sz +unifyfs +veloc ~visit +vtkm +zfp # +ascent: fides: fides/xgc/XGCCommon.cxx:233:10: error: no member named 'iota' in namespace 'std'; +visit: visit_vtk/lightweight/vtkSkewLookupTable.C:32:10: error: cannot initialize return object of type 'unsigned char *' with an rvalue of type 'const unsigned char *'
- exaworks
- flecsi
- flit
- flux-core
- fortrilinos
- gasnet
- geopm-service
- ginkgo
- globalarrays
- glvis ^llvm
- gmp
- gotcha
- gptune ~mpispawn
@@ -113,6 +106,7 @@ spack:
- kokkos-kernels +openmp
- laghos
- lammps
# - lbann # 2024.2 internal compiler error
- legion
- libnrm
- libpressio +bitgrooming +bzip2 ~cuda ~cusz +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp
@@ -122,7 +116,6 @@ spack:
- mercury
- metall
- mfem
- mgard +serial +openmp +timing +unstructured ~cuda
- mpark-variant
- mpifileutils ~xattr
- nccmp
@@ -132,13 +125,12 @@ spack:
- omega-h
- openfoam
- openmpi
- openpmd-api
- papi
- papyrus
- parsec ~cuda
- pdt
- petsc
- phist
# - plasma # 2024.2 internal compiler error
- plumed
- precice
- pruners-ninja
@@ -160,15 +152,12 @@ spack:
- sundials
- superlu
- superlu-dist
- swig@4.0.2-fortran
- sz3
- tasmanian
- tau +mpi +python +syscall
- trilinos +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext +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
- turbine
- umap
- umpire
- upcxx
- variorum
- wannier90
- xyce +mpi +shared +pymi +pymi_static_tpls
@@ -181,21 +170,31 @@ spack:
- hdf5
- libcatalyst
- parallel-netcdf
- paraview
# - paraview # paraview: VTK/ThirdParty/cgns/vtkcgns/src/adfh/ADFH.c:2002:23: error: incompatible function pointer types passing 'herr_t (hid_t, const char *, const H5L_info1_t *, void *)' (aka 'int (long, const char *, const H5L_info1_t *, void *)') to parameter of type 'H5L_iterate2_t' (aka 'int (*)(long, const char *,const H5L_info2_t *, void *)') [-Wincompatible-function-pointer-types]
- py-cinemasci
- sz
- unifyfs
- veloc
# - visit # visit: +visit: visit_vtk/lightweight/vtkSkewLookupTable.C:32:10: error: cannot initialize return object of type 'unsigned char *' with an rvalue of type 'const unsigned char *'
- vtk-m ~openmp
# - visit # silo: https://github.com/spack/spack/issues/39538
- vtk-m ~openmp # https://github.com/spack/spack/issues/31830
- zfp
# --
# - cp2k +mpi # dbcsr: dbcsr_api.F(973): #error: incomplete macro call DBCSR_ABORT.
# - geopm-runtime # libelf: configure: error: installation or configuration problem: C compiler cannot create executables.
# - hpctoolkit # dyninst@13.0.0%gcc: libiberty/./d-demangle.c:142: undefined reference to `_intel_fast_memcpy'
# - lbann # 2024.2 internal compiler error
# - plasma # 2024.2 internal compiler error
# - quantum-espresso # quantum-espresso: external/mbd/src/mbd_c_api.F90(392): error #6645: The name of the module procedure conflicts with a name in the encompassing scoping unit. [F_C_STRING]
# - alquimia # pflotran: https://github.com/spack/spack/issues/39474
# - bricks ~cuda # bricks: /opt/intel/oneapi/compiler/2024.0/bin/sycl-post-link: error while loading shared libraries: libonnxruntime.1.12.22.721.so: cannot open shared object file: No such file or directory
# - cp2k +mpi # dbcsr
# - dealii # dealii: https://github.com/spack/spack/issues/39482
# - dxt-explorer # r: https://github.com/spack/spack/issues/40257
# - ecp-data-vis-sdk ~cuda ~rocm +adios2 +ascent +cinema +darshan +faodel +hdf5 +paraview +pnetcdf +sz +unifyfs +veloc +visit +vtkm +zfp # embree: CMake Error at CMakeLists.txt:215 (MESSAGE): Unsupported compiler: IntelLLVM; qt: qtbase/src/corelib/global/qendian.h:333:54: error: incomplete type 'std::numeric_limits' used in nested name specifier
# - geopm # geopm issue: https://github.com/spack/spack/issues/38795
# - glvis ^llvm # glvis: https://github.com/spack/spack/issues/42839
# - hpctoolkit # dyninst@12.3.0%gcc: /usr/bin/ld: libiberty/./d-demangle.c:142: undefined reference to `_intel_fast_memcpy'; can't mix intel-tbb@%oneapi with dyninst%gcc
# - mgard +serial +openmp +timing +unstructured ~cuda # mgard: mgard.tpp:63:48: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned long' in initializer list [-Wc++11-narrowing]
# - openpmd-api # mgard: mgard.tpp:63:48: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned long' in initializer list [-Wc++11-narrowing]
# - pdt # pdt: pdbType.cc:193:21: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# - quantum-espresso # quantum-espresso@7.2 /i3fqdx5: warning: <unknown>:0:0: loop not unroll-and-jammed: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering
# - swig@4.0.2-fortran # ?
# - tau +mpi +python +syscall # pdt: pdbType.cc:193:21: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# - upcxx # upcxx: /opt/intel/oneapi/mpi/2021.10.0//libfabric/bin/fi_info: error while loading shared libraries: libfabric.so.1: cannot open shared object file: No such file or directory
# PYTHON PACKAGES
- opencv +python3
@@ -233,8 +232,8 @@ spack:
- upcxx +level_zero
# --
# - hpctoolkit +level_zero # dyninst@12.3.0%gcc: /usr/bin/ld: libiberty/./d-demangle.c:142: undefined reference to `_intel_fast_memcpy'; can't mix intel-tbb@%oneapi with dyninst%gcc
# - slate +sycl # slate: ifx: error #10426: option '-fopenmp-targets' requires '-fiopenmp'
# - warpx compute=sycl # warpx: fetchedamrex-src/Src/Base/AMReX_RandomEngine.H:18:10: fatal error: 'oneapi/mkl/rng/device.hpp' file not found
# - slate +sycl # blaspp: CMake Error at CMakeLists.txt:313 (find_package): ... set MKL_FOUND to FALSE so package "MKL" is considered to be NOT FOUND.
# - warpx compute=sycl # warpx: spack-build-wzp6vvo/_deps/fetchedamrex-src/Src/Base/AMReX_RandomEngine.H:18:10: fatal error: 'oneapi/mkl/rng/device.hpp' file not found
ci:

View File

@@ -46,7 +46,7 @@ class Abacus(MakefilePackage):
build_directory = "source"
def edit(self, spec, prefix):
if spec.satisfies("+openmp"):
if "+openmp" in spec:
inc_var = "_openmp-"
system_var = "ELPA_LIB = -L${ELPA_LIB_DIR} -lelpa_openmp -Wl, -rpath=${ELPA_LIB_DIR}"
else:

View File

@@ -146,12 +146,12 @@ def configure_args(self):
options += self.with_or_without("libxml2")
oapp = options.append
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp(f"--enable-optim={self.spec.variants['optimization-flavor'].value}")
else:
oapp(f"--with-optim-flavor={self.spec.variants['optimization-flavor'].value}")
if spec.satisfies("+wannier90"):
if "+wannier90" in spec:
if spec.satisfies("@:8"):
oapp(f"--with-wannier90-libs=-L{spec['wannier90'].prefix.lib} -lwannier -lm")
oapp(f"--with-wannier90-incs=-I{spec['wannier90'].prefix.modules}")
@@ -174,16 +174,16 @@ def configure_args(self):
]
)
else:
if spec.satisfies("@:9.8"):
if "@:9.8" in spec:
oapp(f"--with-fftw={spec['fftw-api'].prefix}")
oapp(f"--with-hdf5={spec['hdf5'].prefix}")
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp("--with-dft-flavor=atompaw+libxc")
else:
"--without-wannier90",
if spec.satisfies("+mpi"):
if "+mpi" in spec:
oapp(f"CC={spec['mpi'].mpicc}")
oapp(f"CXX={spec['mpi'].mpicxx}")
oapp(f"FC={spec['mpi'].mpifc}")
@@ -192,18 +192,18 @@ def configure_args(self):
# MPI version:
# let the configure script auto-detect MPI support from mpi_prefix
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp("--enable-mpi=yes")
else:
oapp("--with-mpi")
else:
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp("--enable-mpi=no")
else:
oapp("--without-mpi")
# Activate OpenMP in Abinit Fortran code.
if spec.satisfies("+openmp"):
if "+openmp" in spec:
oapp("--enable-openmp=yes")
else:
oapp("--enable-openmp=no")
@@ -213,19 +213,19 @@ def configure_args(self):
is_using_intel_libraries = spec["lapack"].name in INTEL_MATH_LIBRARIES
if is_using_intel_libraries:
linalg_flavor = "mkl"
if spec.satisfies("@9:") and spec.satisfies("^openblas"):
elif "@9:" in spec and "^openblas" in spec:
linalg_flavor = "openblas"
if spec.satisfies("@9:") and spec.satisfies("^fujitsu-ssl2"):
elif "@9:" in spec and "^fujitsu-ssl2" in spec:
linalg_flavor = "openblas"
else:
linalg_flavor = "custom"
if spec.satisfies("+scalapack"):
if "+scalapack" in spec:
linalg = spec["scalapack"].libs + linalg
if spec.satisfies("@:8"):
if "@:8" in spec:
linalg_flavor = f"scalapack+{linalg_flavor}"
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp(f"--with-linalg-libs={linalg.ld_flags}")
else:
oapp(f"LINALG_LIBS={linalg.ld_flags}")
@@ -235,14 +235,14 @@ def configure_args(self):
if is_using_intel_libraries:
fftflavor = "dfti"
else:
if spec.satisfies("+openmp"):
if "+openmp" in spec:
fftflavor, fftlibs = "fftw3-threads", "-lfftw3_omp -lfftw3 -lfftw3f"
else:
fftflavor, fftlibs = "fftw3", "-lfftw3 -lfftw3f"
oapp(f"--with-fft-flavor={fftflavor}")
if spec.satisfies("@:8"):
if "@:8" in spec:
if is_using_intel_libraries:
oapp(f"--with-fft-incs={spec['fftw-api'].headers.cpp_flags}")
oapp(f"--with-fft-libs={spec['fftw-api'].libs.ld_flags}")
@@ -271,7 +271,7 @@ def configure_args(self):
# LibXC library
libxc = spec["libxc:fortran"]
if spec.satisfies("@:8"):
if "@:8" in spec:
options.extend(
[
f"--with-libxc-incs={libxc.headers.cpp_flags}",
@@ -285,7 +285,7 @@ def configure_args(self):
hdf5 = spec["hdf5:hl"]
netcdfc = spec["netcdf-c"]
netcdff = spec["netcdf-fortran:shared"]
if spec.satisfies("@:8"):
if "@:8" in spec:
oapp("--with-trio-flavor=netcdf")
# Since version 8, Abinit started to use netcdf4 + hdf5 and we have
# to link with the high level HDF5 library
@@ -318,7 +318,7 @@ def check(self):
# the tests directly execute abinit. thus failing with MPI
# TODO: run tests in tests/ via the builtin runtests.py
# requires Python with numpy, pyyaml, pandas
if self.spec.satisfies("~mpi"):
if "~mpi" in self.spec:
make("tests_in")
# Abinit assumes the *old* behavior of HDF5 where the library flags to link
@@ -333,5 +333,5 @@ def patch(self):
def install(self, spec, prefix):
make("install")
if spec.satisfies("+install-tests"):
if "+install-tests" in spec:
install_tree("tests", spec.prefix.tests)

View File

@@ -42,7 +42,7 @@ def cmake_args(self):
self.define("BUILD_SHARED", str(spec.satisfies("+shared")).lower()),
]
if spec.satisfies("+cuda"):
if "+cuda" in spec:
cuda_arch = [x for x in spec.variants["cuda_arch"].value if x]
if cuda_arch:
args.append(f"-DCUDA_NVCC_FLAGS={' '.join(self.cuda_flags(cuda_arch))}")

View File

@@ -353,9 +353,7 @@ class Acts(CMakePackage, CudaPackage):
depends_on("nlohmann-json @3.9.1:", when="@0.14: +json")
depends_on("podio @0.6:", when="@25: +edm4hep")
depends_on("podio @0.16:", when="@30.3: +edm4hep")
depends_on("podio @:0", when="@:35 +edm4hep")
depends_on("podio @0.16:", when="+podio")
depends_on("podio @:0", when="@:35 +podio")
depends_on("pythia8", when="+pythia8")
depends_on("python", when="+python")
depends_on("python@3.8:", when="+python @19.11:19")
@@ -493,7 +491,7 @@ def plugin_cmake_variant(plugin_name, spack_variant):
if spec.satisfies("@14: +vecmem"):
args.append("-DACTS_USE_SYSTEM_VECMEM=ON")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
cuda_arch = spec.variants["cuda_arch"].value
if cuda_arch != "none":
args.append(f"-DCUDA_FLAGS=-arch=sm_{cuda_arch[0]}")

View File

@@ -144,14 +144,14 @@ def configure_args(self):
extra_args += self.enable_or_disable("shared")
extra_args += self.enable_or_disable("fortran")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
env["MPICC"] = spec["mpi"].mpicc
env["MPICXX"] = spec["mpi"].mpicxx
extra_args += self.with_or_without("mpi", activation_value="prefix")
extra_args += self.with_or_without("infiniband")
if spec.satisfies("+zlib"):
if "+zlib" in spec:
extra_args.append(f"--with-zlib={spec['zlib-api'].prefix}")
else:
extra_args.append("--without-zlib")

View File

@@ -292,7 +292,7 @@ def cmake_args(self):
self.define("ADIOS2_USE_MGARD", False),
]
if spec.satisfies("+sst"):
if "+sst" in spec:
args.extend(
[
# Broken dependency package
@@ -305,15 +305,15 @@ def cmake_args(self):
]
)
if spec.satisfies("%fj"):
if "%fj" in spec:
args.extend(["-DCMAKE_Fortran_SUBMODULE_EXT=.smod", "-DCMAKE_Fortran_SUBMODULE_SEP=."])
# hip support
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append(self.builder.define_cuda_architectures(self))
# hip support
if spec.satisfies("+rocm"):
if "+rocm" in spec:
args.append(self.builder.define_hip_architectures(self))
return args
@@ -323,18 +323,18 @@ def libs(self):
spec = self.spec
libs_to_seek = set()
if spec.satisfies("@2.6:"):
if "@2.6:" in spec:
libs_to_seek.add("libadios2_core")
libs_to_seek.add("libadios2_c")
libs_to_seek.add("libadios2_cxx11")
if spec.satisfies("+fortran"):
if "+fortran" in spec:
libs_to_seek.add("libadios2_fortran")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
libs_to_seek.add("libadios2_core_mpi")
libs_to_seek.add("libadios2_c_mpi")
libs_to_seek.add("libadios2_cxx11_mpi")
if spec.satisfies("+fortran"):
if "+fortran" in spec:
libs_to_seek.add("libadios2_fortran_mpi")
if "@2.7: +shared+hdf5" in spec and "@1.12:" in spec["hdf5"]:
@@ -342,7 +342,7 @@ def libs(self):
else:
libs_to_seek.add("libadios2")
if spec.satisfies("+fortran"):
if "+fortran" in spec:
libs_to_seek.add("libadios2_fortran")
return find_libraries(
@@ -391,7 +391,7 @@ def test_examples(self):
std_cmake_args = []
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
mpi_exec = join_path(self.spec["mpi"].prefix, "bin", "mpiexec")
std_cmake_args.append(f"-DMPIEXEC_EXECUTABLE={mpi_exec}")

View File

@@ -87,12 +87,12 @@ def configure_args(self):
configure_args = []
if spec.satisfies("+boost"):
if "+boost" in spec:
configure_args.append(f"--with-boost={spec['boost'].prefix}")
else:
configure_args.append("--with-boost=no")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
configure_args.append(f"--with-openmp-flag={self.compiler.openmp_flag}")
configure_args.extend(
@@ -107,14 +107,14 @@ def configure_args(self):
# We can simply use the bundled examples to check
# whether Adol-C works as expected
if spec.satisfies("+examples"):
if "+examples" in spec:
configure_args.extend(
[
"--enable-docexa", # Documented examples
"--enable-addexa", # Additional examples
]
)
if spec.satisfies("+openmp"):
if "+openmp" in spec:
configure_args.append("--enable-parexa") # Parallel examples
return configure_args
@@ -130,11 +130,11 @@ def install_additional_files(self):
install(config_h, join_path(prefix.include, "adolc"))
# Install documentation to {prefix}/share
if spec.satisfies("+doc"):
if "+doc" in spec:
install_tree(join_path("ADOL-C", "doc"), join_path(prefix.share, "doc"))
# Install examples to {prefix}/share
if spec.satisfies("+examples"):
if "+examples" in spec:
install_tree(join_path("ADOL-C", "examples"), join_path(prefix.share, "examples"))
# Run some examples that don't require user input
@@ -148,7 +148,7 @@ def install_additional_files(self):
):
Executable("./checkpointing/checkpointing")()
if spec.satisfies("+openmp"):
if "+openmp" in spec:
with working_dir(
join_path(source_directory, "ADOL-C", "examples", "additional_examples")
):

View File

@@ -79,30 +79,30 @@ class Alpaka(CMakePackage, CudaPackage):
def cmake_args(self):
spec = self.spec
args = []
if spec.satisfies("backend=serial"):
if "backend=serial" in spec:
args.append(self.define("ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE", True))
if self.spec.satisfies("backend=threads"):
if "backend=threads" in self.spec:
args.append(self.define("ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE", True))
if spec.satisfies("backend=fiber"):
if "backend=fiber" in spec:
args.append(self.define("ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE", True))
if spec.satisfies("backend=tbb"):
if "backend=tbb" in spec:
args.append(self.define("ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE", True))
if spec.satisfies("backend=omp2_gridblock"):
if "backend=omp2_gridblock" in spec:
args.append(self.define("ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE", True))
if spec.satisfies("backend=omp2_blockthread"):
if "backend=omp2_blockthread" in spec:
args.append(self.define("ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE", True))
if spec.satisfies("backend=omp5"):
if "backend=omp5" in spec:
args.append(self.define("ALPAKA_ACC_ANY_BT_OMP5_ENABLE", True))
if spec.satisfies("backend=oacc"):
if "backend=oacc" in spec:
args.append(self.define("ALPAKA_ACC_ANY_BT_OACC_ENABLE", True))
if spec.satisfies("backend=cuda"):
if "backend=cuda" in spec:
args.append(self.define("ALPAKA_ACC_GPU_CUDA_ENABLE", True))
if spec.satisfies("backend=cuda_only"):
if "backend=cuda_only" in spec:
args.append(self.define("ALPAKA_ACC_GPU_CUDA_ENABLE", True))
args.append(self.define("ALPAKA_ACC_GPU_CUDA_ONLY_MODE", True))
if spec.satisfies("backend=hip"):
if "backend=hip" in spec:
args.append(self.define("ALPAKA_ACC_GPU_HIP_ENABLE", True))
if spec.satisfies("backend=hip_only"):
if "backend=hip_only" in spec:
args.append(self.define("ALPAKA_ACC_GPU_HIP_ENABLE", True))
args.append(self.define("ALPAKA_ACC_GPU_HIP_ONLY_MODE", True))

View File

@@ -165,11 +165,11 @@ def configure(self, spec, prefix):
# Dynamic dispatcher builds a single portable optimized library
# that can execute on different x86 CPU architectures.
# It is supported for GCC compiler and Linux based systems only.
if spec.satisfies("+amd-dynamic-dispatcher"):
if "+amd-dynamic-dispatcher" in spec:
options.append("--enable-dynamic-dispatcher")
# Check if compiler is AOCC
if spec.satisfies("%aocc"):
if "%aocc" in spec:
options.append("CC={0}".format(os.path.basename(spack_cc)))
options.append("FC={0}".format(os.path.basename(spack_fc)))
options.append("F77={0}".format(os.path.basename(spack_fc)))
@@ -186,10 +186,10 @@ def configure(self, spec, prefix):
"https://www.amd.com/content/dam/amd/en/documents/developer/version-4-2-documents/aocl/aocl-4-2-user-guide.pdf"
)
if spec.satisfies("+debug"):
if "+debug" in spec:
options.append("--enable-debug")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
options.append("--enable-mpi")
options.append("--enable-amd-mpifft")
else:
@@ -223,7 +223,7 @@ def configure(self, spec, prefix):
simd_features = ["sse2", "avx", "avx2", "avx512"]
# "avx512" is supported from amdfftw 4.0 version onwards
if self.spec.satisfies("@2.2:3.2"):
if "@2.2:3.2" in self.spec:
simd_features.remove("avx512")
simd_options = []

View File

@@ -39,15 +39,15 @@ def build_targets(self):
include_cflags = ["-DTIMER_USE_MPI"]
include_lflags = ["-lm"]
if self.spec.satisfies("+openmp"):
if "+openmp" in self.spec:
include_cflags.append("-DHYPRE_USING_OPENMP")
include_cflags.append(self.compiler.openmp_flag)
include_lflags.append(self.compiler.openmp_flag)
if self.spec.satisfies("+optflags"):
if "+optflags" in self.spec:
include_cflags.append("-DHYPRE_USING_PERSISTENT_COMM")
include_cflags.append("-DHYPRE_HOPSCOTCH")
if self.spec.satisfies("+int64"):
if "+int64" in self.spec:
include_cflags.append("-DHYPRE_BIGINT")
targets.append(f"INCLUDE_CFLAGS={' '.join(include_cflags)}")

View File

@@ -45,7 +45,7 @@ def cmake_args(self):
args = []
args.append("-DCMAKE_NO_MPI={0}".format("1" if "+mpi" not in self.spec else "0"))
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
args.append("-DWITH_CUDA=ON")
cuda_arch = self.spec.variants["cuda_arch"].value
if cuda_arch != "none":
@@ -53,10 +53,10 @@ def cmake_args(self):
else:
args.append("-DWITH_CUDA=OFF")
if self.spec.satisfies("+mkl"):
if "+mkl" in self.spec:
args.append("-DMKL_ROOT_DIR={0}".format(self.spec["mkl"].prefix))
if self.spec.satisfies("+magma"):
if "+magma" in self.spec:
args.append("-DMAGMA_ROOT_DIR={0}".format(self.spec["magma"].prefix))
return args

View File

@@ -70,7 +70,7 @@ def cmake_args(self):
self.define("USE_MPI", "0"),
]
if spec.satisfies("+mpi"):
if "+mpi" in spec:
options.extend(
[
self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc),
@@ -101,7 +101,7 @@ def cmake_args(self):
]
)
if spec.satisfies("+zlib"):
if "+zlib" in spec:
tpl_list.append("ZLIB")
options.append(self.define("TPL_ZLIB_INSTALL_DIR", spec["zlib-api"].prefix))
@@ -119,7 +119,7 @@ def cmake_args(self):
tpl_list.append(vname.upper())
options.append(self.define(f"TPL_{vname.upper()}_INSTALL_DIR", spec[vname].prefix))
if spec.satisfies("+netcdf"):
if "+netcdf" in spec:
tpl_list.append("NETCDF")
options.append(self.define("TPL_NETCDF_INSTALL_DIR", spec["netcdf-c"].prefix))

View File

@@ -26,7 +26,6 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
license("BSD-3-Clause")
version("develop", branch="development")
version("24.08", sha256="e09623e715887a19a1f86ed6fdb8335022fd6c03f19372d8f13b55cdeeadf5de")
version("24.07", sha256="6baf76c1377d765e94020a9bd89dd1bf1485d0440d41cce2ba35d4dfee562580")
version("24.06", sha256="103a97163d81716165fcff1af56df61741608b56f90730a725e9e4eb797bebf0")
version("24.05", sha256="f3db5ea2b81973e3e244c5cf39d5a5383a98f297f56ed91c8dcdd2e24f7b750e")
@@ -293,20 +292,20 @@ def cmake_args(self):
if self.spec.satisfies("%fj"):
args.append("-DCMAKE_Fortran_MODDIR_FLAG=-M")
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
args.append("-DAMReX_GPU_BACKEND=CUDA")
args.append("-DAMReX_CUDA_ERROR_CAPTURE_THIS=ON")
args.append("-DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON")
cuda_arch = self.spec.variants["cuda_arch"].value
args.append("-DAMReX_CUDA_ARCH=" + self.get_cuda_arch_string(cuda_arch))
if self.spec.satisfies("+rocm"):
if "+rocm" in self.spec:
args.append("-DCMAKE_CXX_COMPILER={0}".format(self.spec["hip"].hipcc))
args.append("-DAMReX_GPU_BACKEND=HIP")
targets = self.spec.variants["amdgpu_target"].value
args.append("-DAMReX_AMD_ARCH=" + ";".join(str(x) for x in targets))
if self.spec.satisfies("+sycl"):
if "+sycl" in self.spec:
args.append("-DAMReX_GPU_BACKEND=SYCL")
# SYCL GPU backend only supported with Intel's oneAPI or DPC++ compilers
sycl_compatible_compilers = ["icpx"]
@@ -345,7 +344,7 @@ def cmake_args(self):
if self.spec.satisfies("%fj"):
args.append("-DCMAKE_Fortran_MODDIR_FLAG=-M")
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
cuda_arch = self.spec.variants["cuda_arch"].value
args.append("-DCUDA_ARCH=" + self.get_cuda_arch_string(cuda_arch))
@@ -366,11 +365,11 @@ def test_run_install_test(self):
args = ["-S{0}".format(join_path(".", "cache", "amrex", "Tests", "SpackSmokeTest"))]
args.append("-DAMReX_ROOT=" + self.prefix)
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
args.append("-DMPI_C_COMPILER=" + self.spec["mpi"].mpicc)
args.append("-DMPI_CXX_COMPILER=" + self.spec["mpi"].mpicxx)
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
args.append("-DCMAKE_CUDA_COMPILER=" + join_path(self.spec["cuda"].prefix.bin, "nvcc"))
args.extend(self.cmake_args())

View File

@@ -148,7 +148,7 @@ def setup_build_environment(self, env):
# We don't want an AMREX_HOME the user may have set already
env.unset("AMREX_HOME")
# Help force Amrvis to not pick up random system compilers
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
env.set("MPI_HOME", self.spec["mpi"].prefix)
env.set("CC", self.spec["mpi"].mpicc)
env.set("CXX", self.spec["mpi"].mpicxx)

View File

@@ -114,31 +114,31 @@ def cmake_args(self):
)
)
if spec.satisfies("+verbose"):
if "+verbose" in spec:
args.append("-DWITH_AMS_DEBUG=On")
if spec.satisfies("+hdf5"):
if "+hdf5" in spec:
args.append("-DWITH_HDF5=On")
args.append("-DHDF5_Dir={0}".format(spec["hdf5"].prefix))
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("-DWITH_CUDA=On")
cuda_arch = spec.variants["cuda_arch"].value[0]
args.append("-DAMS_CUDA_ARCH={0}".format(cuda_arch))
if spec.satisfies("+caliper"):
if "+caliper" in spec:
args.append("-DWITH_CALIPER=On")
args.append("-DCALIPER_DIR={0}/share/cmake/caliper".format(spec["caliper"].prefix))
else:
args.append("-DWITH_CALIPER=Off")
if spec.satisfies("+faiss"):
if "+faiss" in spec:
args.append("-DWITH_FAISS=On")
args.append("-DFAISS_DIR={0}".format(spec["faiss"].prefix))
else:
args.append("-DWITH_FAISS=Off")
if spec.satisfies("+torch"):
if "+torch" in spec:
args.append("-DWITH_TORCH=On")
args.append(
"-DTorch_DIR={0}/lib/python{1}/site-packages"
@@ -147,15 +147,15 @@ def cmake_args(self):
)
)
if spec.satisfies("+redis"):
if "+redis" in spec:
args.append("-DWITH_REDIS=On")
args.append("-DREDIS_PLUS_PLUS_DIR={0}".format(spec["redis-plus-plus"].prefix))
if spec.satisfies("+rabbitmq"):
if "+rabbitmq" in spec:
args.append("-DWITH_RMQ=On")
args.append("-Damqpcpp_DIR={0}/cmake".format(spec["amqp-cpp"].prefix))
if spec.satisfies("+examples"):
if "+examples" in spec:
args.append("-DWITH_EXAMPLES=On")
args.append("-DMFEM_DIR={0}".format(spec["mfem"].prefix))

View File

@@ -80,7 +80,7 @@ class Aocc(Package, CompilerPackage):
@run_before("install")
def license_reminder(self):
if self.spec.satisfies("+license-agreed"):
if "+license-agreed" in self.spec:
tty.msg(
"Reminder: by setting +license-agreed you are confirming you agree to the terms "
"of the {0} EULA (found at {1})".format(self.spec.name, self.license_url)

View File

@@ -92,21 +92,21 @@ def cmake_args(self):
"-DLZ4_FRAME_FORMAT_SUPPORT=ON",
"-DAOCL_LZ4HC_DISABLE_PATTERN_ANALYSIS=ON",
]
if spec.satisfies("~shared"):
if "~shared" in spec:
args.append("-DBUILD_STATIC_LIBS=ON")
if spec.satisfies("~zlib"):
if "~zlib" in spec:
args.append("-DAOCL_EXCLUDE_ZLIB=ON")
if spec.satisfies("~bzip2"):
if "~bzip2" in spec:
args.append("-DAOCL_EXCLUDE_BZIP2=ON")
if spec.satisfies("~snappy"):
if "~snappy" in spec:
args.append("-DAOCL_EXCLUDE_SNAPPY=ON")
if spec.satisfies("~zstd"):
if "~zstd" in spec:
args.append("-DAOCL_EXCLUDE_ZSTD=ON")
if spec.satisfies("~lzma"):
if "~lzma" in spec:
args.append("-DAOCL_EXCLUDE_LZMA=ON")
if spec.satisfies("~lz4"):
if "~lz4" in spec:
args.append("-DAOCL_EXCLUDE_LZ4=ON")
if spec.satisfies("~lz4hc"):
if "~lz4hc" in spec:
args.append("-DAOCL_EXCLUDE_LZ4HC=ON")
return args

View File

@@ -121,7 +121,7 @@ def cmake_args(self):
"-DAOCL_LIBFLAME_INCLUDE_DIR={0}".format(self.spec["amdlibflame"].prefix.include)
)
if self.spec.satisfies("@4.2:"):
if "@4.2:" in self.spec:
args.append(f"-DAOCL_UTILS_LIB={self.spec['aocl-utils'].libs}")
args.append(
"-DAOCL_UTILS_INCLUDE_DIR={0}".format(self.spec["aocl-utils"].prefix.include)

View File

@@ -99,7 +99,7 @@ def create_host_config(self, spec, prefix):
# Find and record what CMake is used
##############################################
if spec.satisfies("+cmake"):
if "+cmake" in spec:
cmake_exe = spec["cmake"].command.path
else:
cmake_exe = which("cmake")
@@ -133,17 +133,17 @@ def create_host_config(self, spec, prefix):
cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler))
# shared vs static libs
if spec.satisfies("+shared"):
if "+shared" in spec:
cfg.write(cmake_cache_entry("BUILD_SHARED_LIBS", "ON"))
else:
cfg.write(cmake_cache_entry("BUILD_SHARED_LIBS", "OFF"))
if spec.satisfies("+openmp"):
if "+openmp" in spec:
cfg.write(cmake_cache_entry("ENABLE_OPENMP", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_OPENMP", "OFF"))
if spec.satisfies("+mpi"):
if "+mpi" in spec:
mpicc_path = spec["mpi"].mpicc
mpicxx_path = spec["mpi"].mpicxx
# if we are using compiler wrappers on cray systems
@@ -156,7 +156,7 @@ def create_host_config(self, spec, prefix):
cfg.write(cmake_cache_entry("ENABLE_MPI", "ON"))
cfg.write(cmake_cache_entry("MPI_C_COMPILER", mpicc_path))
cfg.write(cmake_cache_entry("MPI_CXX_COMPILER", mpicxx_path))
if spec.satisfies("+blt_find_mpi"):
if "+blt_find_mpi" in spec:
cfg.write(cmake_cache_entry("ENABLE_FIND_MPI", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_FIND_MPI", "OFF"))

View File

@@ -146,7 +146,7 @@ def cmake_args(self):
# CMake variables were updated in version 2.3.0, to make
prefix = "APEX_WITH"
test_prefix = "APEX_"
if spec.satisfies("@2.2.0"):
if "@2.2.0" in spec:
prefix = "USE"
test_prefix = ""
@@ -167,29 +167,29 @@ def cmake_args(self):
args.append(self.define_from_variant(test_prefix + "BUILD_TESTS", "tests"))
args.append(self.define_from_variant(test_prefix + "BUILD_EXAMPLES", "examples"))
if spec.satisfies("+activeharmony"):
if "+activeharmony" in spec:
args.append("-DACTIVEHARMONY_ROOT={0}".format(spec["activeharmony"].prefix))
if spec.satisfies("+binutils"):
if "+binutils" in spec:
args.append("-DBFD_ROOT={0}".format(spec["binutils"].prefix))
if spec.satisfies("+binutils ^binutils+nls"):
if "+binutils ^binutils+nls" in spec:
if "intl" in self.spec["gettext"].libs.names:
args.append("-DCMAKE_SHARED_LINKER_FLAGS=-lintl")
if spec.satisfies("+otf2"):
if "+otf2" in spec:
args.append("-DOTF2_ROOT={0}".format(spec["otf2"].prefix))
if spec.satisfies("+papi"):
if "+papi" in spec:
args.append("-DPAPI_ROOT={0}".format(spec["papi"].prefix))
if spec.satisfies("+gperftools"):
if "+gperftools" in spec:
args.append("-DGPERFTOOLS_ROOT={0}".format(spec["gperftools"].prefix))
if spec.satisfies("+jemalloc"):
if "+jemalloc" in spec:
args.append("-DJEMALLOC_ROOT={0}".format(spec["jemalloc"].prefix))
if spec.satisfies("+hip"):
if "+hip" in spec:
args.append("-DROCM_ROOT={0}".format(spec["hip"].prefix))
args.append("-DROCTRACER_ROOT={0}".format(spec["roctracer-dev"].prefix))
args.append("-DROCTX_ROOT={0}".format(spec["roctracer-dev"].prefix))

View File

@@ -12,17 +12,17 @@ class Appres(AutotoolsPackage, XorgPackage):
names. It can be used to determine which resources a particular
program will load."""
homepage = "https://gitlab.freedesktop.org/xorg/app/appres"
homepage = "https://cgit.freedesktop.org/xorg/app/appres"
xorg_mirror_path = "app/appres-1.0.4.tar.gz"
version("1.0.6", sha256="848f383ff429612fb9df840d79e97dc193dc72dbbf53d3217a8d1e90a5aa1e26")
version("1.0.4", sha256="22cb6f639c891ffdbb5371bc50a88278185789eae6907d05e9e0bd1086a80803")
depends_on("c", type="build")
depends_on("c", type="build") # generated
depends_on("libx11")
depends_on("libxt")
depends_on("xproto@7.0.17:", type="build")
depends_on("xproto@7.0.17:")
depends_on("pkgconfig", type="build")
depends_on("util-macros", type="build")

View File

@@ -58,22 +58,22 @@ def configure_args(self):
"--without-oracle",
]
if spec.satisfies("+crypto"):
if "+crypto" in spec:
args.extend(["--with-crypto", f"--with-openssl={spec['openssl'].prefix}"])
else:
args.append("--without-crypto")
if spec.satisfies("+gdbm"):
if "+gdbm" in spec:
args.append(f"--with-gdbm={spec['gdbm'].prefix}")
else:
args.append("--without-gdbm")
if spec.satisfies("+pgsql"):
if "+pgsql" in spec:
args.append(f"--with-pgsql={spec['postgresql'].prefix}")
else:
args.append("--without-pgsql")
if spec.satisfies("+sqlite"):
if "+sqlite" in spec:
if spec.satisfies("^sqlite@3.0:3"):
args.extend([f"--with-sqlite3={spec['sqlite'].prefix}", "--without-sqlite2"])
elif spec.satisfies("^sqlite@2.0:2"):
@@ -81,7 +81,7 @@ def configure_args(self):
else:
args.extend(["--without-sqlite2", "--without-sqlite3"])
if spec.satisfies("+odbc"):
if "+odbc" in spec:
args.append(f"--with-odbc={spec['unixodbc'].prefix}")
else:
args.append("--without-odbc")

View File

@@ -117,7 +117,7 @@ def cmake_args(self):
self.define_from_variant("ARB_VECTORIZE", "vectorize"),
]
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
args.append("-DARB_GPU=cuda")
args.append(self.define_from_variant("ARB_USE_GPU_RNG", "gpu_rng"))

View File

@@ -115,10 +115,10 @@ def cmake_args(self):
self.define_from_variant("ARBORX_ENABLE_MPI", "mpi"),
]
if spec.satisfies("+cuda"):
if "+cuda" in spec:
# Only Kokkos allows '+cuda' for now
options.append("-DCMAKE_CXX_COMPILER=%s" % spec["kokkos"].kokkos_cxx)
if spec.satisfies("+rocm"):
if "+rocm" in spec:
options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc)
return options
@@ -152,7 +152,7 @@ def test_run_ctest(self):
),
self.define("ArborX_ROOT", self.spec["arborx".prefix]),
]
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
cmake_args.append(self.define("MPI_HOME", self.spec["mpi"].prefix))
cmake = which(self.spec["cmake"].prefix.bin.cmake)
make = which("make")

View File

@@ -53,20 +53,20 @@ class Argobots(AutotoolsPackage):
def configure_args(self):
args = []
if self.spec.satisfies("+perf"):
if "+perf" in self.spec:
args.append("--enable-perf-opt")
if self.spec.satisfies("+valgrind"):
if "+valgrind" in self.spec:
args.append("--enable-valgrind")
else:
args.append("--disable-valgrind")
if self.spec.satisfies("+debug"):
if "+debug" in self.spec:
args.append("--enable-debug=yes")
else:
args.append("--disable-debug")
if self.spec.satisfies("+stackunwind"):
if "+stackunwind" in self.spec:
args.append("--enable-stack-unwind")
args.append("--with-libunwind={0}".format(self.spec["libunwind"].prefix))
@@ -74,10 +74,10 @@ def configure_args(self):
if stackguard != "none":
args.append("--enable-stack-overflow-check={0}".format(stackguard))
if self.spec.satisfies("+tool"):
if "+tool" in self.spec:
args.append("--enable-tool")
if self.spec.satisfies("+affinity"):
if "+affinity" in self.spec:
args.append("--enable-affinity")
return args

View File

@@ -110,7 +110,7 @@ def libs(self):
# query_parameters = self.spec.last_query.extra_parameters
libraries = ["libarpack"]
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
libraries = ["libparpack"] + libraries
return find_libraries(libraries, root=self.prefix, shared=True, recursive=True)
@@ -160,7 +160,7 @@ def configure_args(self):
+ self.enable_or_disable("shared")
)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
options.append(f"F77={spec['mpi'].mpif77}")
return options

View File

@@ -80,7 +80,7 @@ def cmake_args(self):
]
)
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
arch_list = [
"{}.{}".format(arch[:-1], arch[-1])
for arch in self.spec.variants["cuda_arch"].value

View File

@@ -396,7 +396,7 @@ def hostconfig(self):
#######################
c_compiler = env["SPACK_CC"]
cpp_compiler = env["SPACK_CXX"]
if spec.satisfies("+fortran"):
if "+fortran" in spec:
f_compiler = env["SPACK_FC"]
else:
f_compiler = None
@@ -414,7 +414,7 @@ def hostconfig(self):
# Find and record what CMake is used
##############################################
if spec.satisfies("+cmake"):
if "+cmake" in spec:
cmake_exe = spec["cmake"].command.path
else:
cmake_exe = which("cmake")
@@ -449,14 +449,14 @@ def hostconfig(self):
cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler))
cfg.write("# fortran compiler used by spack\n")
if spec.satisfies("+fortran"):
if "+fortran" in spec:
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "ON"))
cfg.write(cmake_cache_entry("CMAKE_Fortran_COMPILER", f_compiler))
else:
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "OFF"))
# shared vs static libs
if spec.satisfies("+shared"):
if "+shared" in spec:
cfg.write(cmake_cache_entry("BUILD_SHARED_LIBS", "ON"))
else:
cfg.write(cmake_cache_entry("BUILD_SHARED_LIBS", "OFF"))
@@ -481,7 +481,7 @@ def hostconfig(self):
#######################
# Unit Tests
#######################
if spec.satisfies("+test"):
if "+test" in spec:
cfg.write(cmake_cache_entry("ENABLE_TESTS", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_TESTS", "OFF"))
@@ -534,7 +534,7 @@ def hostconfig(self):
# Serial
#######################
if spec.satisfies("+serial"):
if "+serial" in spec:
cfg.write(cmake_cache_entry("ENABLE_SERIAL", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_SERIAL", "OFF"))
@@ -545,7 +545,7 @@ def hostconfig(self):
cfg.write("# MPI Support\n")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
mpicc_path = spec["mpi"].mpicc
mpicxx_path = spec["mpi"].mpicxx
mpifc_path = spec["mpi"].mpifc if "+fortran" in spec else None
@@ -560,7 +560,7 @@ def hostconfig(self):
cfg.write(cmake_cache_entry("ENABLE_MPI", "ON"))
cfg.write(cmake_cache_entry("MPI_C_COMPILER", mpicc_path))
cfg.write(cmake_cache_entry("MPI_CXX_COMPILER", mpicxx_path))
if spec.satisfies("+fortran"):
if "+fortran" in spec:
cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER", mpifc_path))
mpiexe_bin = join_path(spec["mpi"].prefix.bin, "mpiexec")
if os.path.isfile(mpiexe_bin):
@@ -571,14 +571,14 @@ def hostconfig(self):
else:
cfg.write(cmake_cache_entry("MPIEXEC", mpiexe_bin))
if spec.satisfies("+blt_find_mpi"):
if "+blt_find_mpi" in spec:
cfg.write(cmake_cache_entry("ENABLE_FIND_MPI", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_FIND_MPI", "OFF"))
###################################
# BABELFLOW (also depends on mpi)
###################################
if spec.satisfies("+babelflow"):
if "+babelflow" in spec:
cfg.write(cmake_cache_entry("ENABLE_BABELFLOW", "ON"))
cfg.write(cmake_cache_entry("BabelFlow_DIR", spec["babelflow"].prefix))
cfg.write(cmake_cache_entry("PMT_DIR", spec["parallelmergetree"].prefix))
@@ -591,12 +591,12 @@ def hostconfig(self):
cfg.write("# CUDA Support\n")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
cfg.write(cmake_cache_entry("ENABLE_CUDA", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_CUDA", "OFF"))
if spec.satisfies("+openmp"):
if "+openmp" in spec:
cfg.write(cmake_cache_entry("ENABLE_OPENMP", "ON"))
else:
cfg.write(cmake_cache_entry("ENABLE_OPENMP", "OFF"))
@@ -606,7 +606,7 @@ def hostconfig(self):
#######################
cfg.write("# vtk-h support \n")
if spec.satisfies("+vtkh"):
if "+vtkh" in spec:
cfg.write("# vtk-h\n")
if self.spec.satisfies("@0.8.1:"):
cfg.write(cmake_cache_entry("ENABLE_VTKH", "ON"))
@@ -616,7 +616,7 @@ def hostconfig(self):
cfg.write("# vtk-m from spack\n")
cfg.write(cmake_cache_entry("VTKM_DIR", spec["vtk-m"].prefix))
if spec.satisfies("+cuda"):
if "+cuda" in spec:
cfg.write(cmake_cache_entry("VTKm_ENABLE_CUDA", "ON"))
cfg.write(cmake_cache_entry("CMAKE_CUDA_HOST_COMPILER", env["SPACK_CXX"]))
else:
@@ -632,7 +632,7 @@ def hostconfig(self):
#######################
# RAJA
#######################
if spec.satisfies("+raja"):
if "+raja" in spec:
cfg.write("# RAJA from spack \n")
cfg.write(cmake_cache_entry("RAJA_DIR", spec["raja"].prefix))
else:
@@ -641,7 +641,7 @@ def hostconfig(self):
#######################
# Umpire
#######################
if spec.satisfies("+umpire"):
if "+umpire" in spec:
cfg.write("# umpire from spack \n")
cfg.write(cmake_cache_entry("UMPIRE_DIR", spec["umpire"].prefix))
else:
@@ -659,7 +659,7 @@ def hostconfig(self):
#######################
# MFEM
#######################
if spec.satisfies("+mfem"):
if "+mfem" in spec:
cfg.write("# mfem from spack \n")
cfg.write(cmake_cache_entry("MFEM_DIR", spec["mfem"].prefix))
else:
@@ -668,7 +668,7 @@ def hostconfig(self):
#######################
# OCCA
#######################
if spec.satisfies("+occa"):
if "+occa" in spec:
cfg.write("# occa from spack \n")
cfg.write(cmake_cache_entry("OCCA_DIR", spec["occa"].prefix))
else:
@@ -677,7 +677,7 @@ def hostconfig(self):
#######################
# Devil Ray
#######################
if spec.satisfies("+dray"):
if "+dray" in spec:
cfg.write("# devil ray\n")
if self.spec.satisfies("@0.8.1:"):
cfg.write(cmake_cache_entry("ENABLE_DRAY", "ON"))
@@ -698,7 +698,7 @@ def hostconfig(self):
#######################
cfg.write("# adios2 support\n")
if spec.satisfies("+adios2"):
if "+adios2" in spec:
cfg.write(cmake_cache_entry("ADIOS2_DIR", spec["adios2"].prefix))
else:
cfg.write("# adios2 not built by spack \n")
@@ -708,7 +708,7 @@ def hostconfig(self):
#######################
cfg.write("# Fides support\n")
if spec.satisfies("+fides"):
if "+fides" in spec:
cfg.write(cmake_cache_entry("FIDES_DIR", spec["fides"].prefix))
else:
cfg.write("# fides not built by spack \n")
@@ -717,7 +717,7 @@ def hostconfig(self):
# Caliper
#######################
cfg.write("# caliper from spack \n")
if spec.satisfies("+caliper"):
if "+caliper" in spec:
cfg.write(cmake_cache_entry("CALIPER_DIR", spec["caliper"].prefix))
cfg.write(cmake_cache_entry("ADIAK_DIR", spec["adiak"].prefix))
else:

View File

@@ -185,7 +185,7 @@ def setup_build_environment(self, env):
env.set("OPT", "-O3")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
env.set("CC", spec["mpi"].mpicc)
env.set("LDR", spec["mpi"].mpicc)
env.set("MPILIB", spec["mpi"].libs.ld_flags)
@@ -194,7 +194,7 @@ def setup_build_environment(self, env):
env.set("CC", spack_cc)
env.set("LDR", spack_cc)
if spec.satisfies("+fft"):
if "+fft" in spec:
env.set("FFTWLIB", spec["fftw"].libs.ld_flags)
env.set("FFTWINC", spec["fftw"].headers.include_flags)
@@ -202,82 +202,82 @@ def configure_args(self):
spec = self.spec
args = []
if spec.satisfies("+conduction"):
if "+conduction" in spec:
args.append("--enable-conduction")
else:
args.append("--disable-conduction")
if spec.satisfies("+resistivity"):
if "+resistivity" in spec:
args.append("--enable-resistivity")
else:
args.append("--disable-resistivity")
if spec.satisfies("+special_relativity"):
if "+special_relativity" in spec:
args.append("--enable-special-relativity")
else:
args.append("--disable-special-relativity")
if spec.satisfies("+viscosity"):
if "+viscosity" in spec:
args.append("--enable-viscosity")
else:
args.append("--disable-viscosity")
if spec.satisfies("+single"):
if "+single" in spec:
args.append("--enable-single")
else:
args.append("--disable-single")
if spec.satisfies("+ghost"):
if "+ghost" in spec:
args.append("--enable-ghost")
else:
args.append("--disable-ghost")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append("--enable-mpi")
else:
args.append("--disable-mpi")
if spec.satisfies("+h_correction"):
if "+h_correction" in spec:
args.append("--enable-h-correction")
else:
args.append("--disable-h-correction")
if spec.satisfies("+fft"):
if "+fft" in spec:
args.append("--enable-fft")
else:
args.append("--disable-fft")
if spec.satisfies("+shearing_box"):
if "+shearing_box" in spec:
args.append("--enable-shearing-box")
else:
args.append("--disable-shearing-box")
if spec.satisfies("+fargo"):
if "+fargo" in spec:
args.append("--enable-fargo")
else:
args.append("--disable-fargo")
if spec.satisfies("+sts"):
if "+sts" in spec:
args.append("--enable-sts")
else:
args.append("--disable-sts")
if spec.satisfies("+smr"):
if "+smr" in spec:
args.append("--enable-smr")
else:
args.append("--disable-smr")
if spec.satisfies("+fofc"):
if "+fofc" in spec:
args.append("--enable-fofc")
else:
args.append("--disable-fofc")
if spec.satisfies("+rotating_frame"):
if "+rotating_frame" in spec:
args.append("--enable-rotating_frame")
else:
args.append("--disable-rotating_frame")
if spec.satisfies("+l1_inflow"):
if "+l1_inflow" in spec:
args.append("--enable-l1_inflow")
else:
args.append("--disable-l1_inflow")

View File

@@ -100,7 +100,7 @@ def install(self, spec, prefix):
# https://github.com/macports/macports-ports/blob/master/math/atlas/Portfile
# https://github.com/Homebrew/homebrew-science/pull/3571
options = []
if spec.satisfies("+shared"):
if "+shared" in spec:
options.extend(["--shared"])
# TODO: for non GNU add '-Fa', 'alg', '-fPIC' ?
@@ -129,7 +129,7 @@ def install(self, spec, prefix):
make("check")
make("ptcheck")
make("time")
if spec.satisfies("+shared"):
if "+shared" in spec:
with working_dir("lib"):
make("shared_all")
@@ -143,7 +143,7 @@ def libs(self):
# serial BLAS), and all ATLAS symbols needed to support them. Whereas
# libtatlas.[so,dylib,dll ] is parallel (multithreaded) version.
is_threaded = self.spec.satisfies("threads=pthreads")
if self.spec.satisfies("+shared"):
if "+shared" in self.spec:
to_find = ["libtatlas"] if is_threaded else ["libsatlas"]
shared = True
else:

View File

@@ -15,7 +15,6 @@ class AuditUserspace(AutotoolsPackage):
license("LGPL-2.1-or-later")
version("4.0.1", sha256="f964610dc0c1e68075d5ae4b14d6280d1164b6eca3a4a13721d1a711681403d9")
version("3.1.2", sha256="4516dbfd1bea0eea10a30f907e50f17087673a536ec6322a2a568dff4ebe50f4")
version("3.1.1", sha256="6a97cc472920639d736e9927353be05e323f351067fcf6e5d34439cafa0e9006")
version("2.8.5", sha256="835ffdd65056ba0c26509dbf48882713b00dbe70e1d8cf25d538501136c2e3e9")
version("2.8.4", sha256="089dfdceb38edf056202a6de4892fd0c9aaa964c08bd7806c5d0c7c33f09e18d")
@@ -30,9 +29,3 @@ class AuditUserspace(AutotoolsPackage):
depends_on("m4", type="build")
depends_on("openldap")
depends_on("swig")
patch(
"https://github.com/linux-audit/audit-userspace/commit/28a74a445d54932e1450b60d6148912344615b44.patch?full_index=1",
sha256="63d4644c7037be21bcafa913f4c96fbaa37f388c170cf0344869a0dc2449fd65",
when="@4.0.1",
)

View File

@@ -69,7 +69,7 @@ class Augustus(MakefilePackage):
def edit(self, spec, prefix):
# Set compile commands for each compiler and
# Fix for using 'boost' on Spack. (only after ver.3.3.1-tag1)
if spec.satisfies("@3.3.1-tag1:3.4.0"):
if "@3.3.1-tag1:3.4.0" in spec:
with working_dir(join_path("auxprogs", "utrrnaseq", "Debug")):
filter_file("g++", spack_cxx, "makefile", string=True)
filter_file(
@@ -108,22 +108,22 @@ def edit(self, spec, prefix):
makefile = FileFilter("Makefile")
makefile.filter("BAMTOOLS = .*", f"BAMTOOLS = {bamtools}")
makefile.filter("INCLUDES = *", "INCLUDES = -I$(BAMTOOLS)/include/bamtools ")
if spec.satisfies("bamtools@2.5:"):
if "bamtools@2.5:" in spec:
makefile.filter(
"LIBS = -lbamtools -lz", "LIBS = $(BAMTOOLS)/lib64" "/libbamtools.a -lz"
)
if spec.satisfies("bamtools@:2.4"):
if "bamtools@:2.4" in spec:
makefile.filter(
"LIBS = -lbamtools -lz", "LIBS = $(BAMTOOLS)/lib/bamtools" "/libbamtools.a -lz"
)
with working_dir(join_path("auxprogs", "bam2hints")):
makefile = FileFilter("Makefile")
makefile.filter("/usr/include/bamtools", f"{bamtools}/include/bamtools")
if spec.satisfies("bamtools@2.5:"):
if "bamtools@2.5:" in spec:
makefile.filter(
"LIBS = -lbamtools -lz", f"LIBS = {bamtools}/lib64/libbamtools.a -lz"
)
if spec.satisfies("bamtools@:2.4"):
if "bamtools@:2.4" in spec:
makefile.filter(
"LIBS = -lbamtools -lz", f"LIBS = {bamtools}/lib/bamtools/libbamtools.a -lz"
)
@@ -151,7 +151,7 @@ def edit(self, spec, prefix):
with working_dir("src"):
makefile = FileFilter("Makefile")
makefile.filter(r"/usr/include/mysql\+\+", f"{mysqlpp}/include/mysql++")
if spec.satisfies("^mariadb-c-client"):
if "^mariadb-c-client" in spec:
makefile.filter("/usr/include/mysql", f"{mysql}/include/mariadb")
else:
makefile.filter("/usr/include/mysql", f"{mysql}/include/mysql")
@@ -180,10 +180,10 @@ def setup_build_environment(self, env):
htslib = self.spec["htslib"].prefix
bamtools = self.spec["bamtools"].prefix
if self.spec.satisfies("@3.4.0"):
if "@3.4.0" in self.spec:
env.set("HTSLIBDIR", htslib)
if self.spec.satisfies("@3.5.0:"):
if "@3.5.0:" in self.spec:
env.set("HTSLIB_INSTALL_DIR", htslib)
env.set("BAMTOOLS_INSTALL_DIR", bamtools)

View File

@@ -84,7 +84,7 @@ def patch(self):
# We save and restore the modification timestamp of the file to prevent
# regeneration of the respective man page:
with keep_modification_time(patched_file):
if self.spec.satisfies("@2.70:"):
if "@2.70:" in self.spec:
shebang_string = "^#! @PERL@"
else:
shebang_string = "^#! @PERL@ -w"
@@ -104,7 +104,7 @@ def filter_sbang(self):
# target will try to rebuild the binaries (filter_file updates the
# timestamps)
if self.spec.satisfies("@2.70:"):
if "@2.70:" in self.spec:
shebang_string = "#! {0}"
else:
shebang_string = "#! {0} -w"

View File

@@ -39,7 +39,7 @@ def configure_args(self):
"--disable-nls"
]
if spec.satisfies("+xml"):
if "+xml" in spec:
args.append(f"--with-libxml2={spec['libxml2'].prefix}")
else:
args.append("--without-libxml2")

View File

@@ -45,10 +45,10 @@ def determine_version(cls, exe):
def patch(self):
# The full perl shebang might be too long
files_to_be_patched_fmt = "bin/{0}.in"
if self.spec.satisfies("@:1.15.1"):
if "@:1.15.1" in self.spec:
files_to_be_patched_fmt = "t/wrap/{0}.in"
if self.spec.satisfies("@1.16.3:"):
if "@1.16.3:" in self.spec:
shebang_string = "^#!@PERL@"
else:
shebang_string = "^#!@PERL@ -w"

View File

@@ -243,11 +243,11 @@ def cache_name(self):
# Are we on a LLNL system then strip node number
hostname = hostname.rstrip("1234567890")
special_case = ""
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
special_case += "_cuda"
if self.spec.satisfies("~fortran"):
if "~fortran" in self.spec:
special_case += "_nofortran"
if self.spec.satisfies("+rocm"):
if "+rocm" in self.spec:
special_case += "_hip"
return "{0}-{1}-{2}@{3}{4}.cmake".format(
hostname,
@@ -261,7 +261,7 @@ def initconfig_compiler_entries(self):
spec = self.spec
entries = super().initconfig_compiler_entries()
if spec.satisfies("+fortran"):
if "+fortran" in spec:
entries.append(cmake_cache_option("ENABLE_FORTRAN", True))
if self.is_fortran_compiler("gfortran") and "clang" in self.compiler.cxx:
libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.cxx)), "lib")
@@ -282,7 +282,7 @@ def initconfig_compiler_entries(self):
entries.append(cmake_cache_string("BLT_CXX_STD", "c++14", ""))
# Add optimization flag workaround for Debug builds with cray compiler or newer HIP
if spec.satisfies("+rocm"):
if "+rocm" in spec:
entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", "-O1 -g -DNDEBUG"))
return entries
@@ -291,7 +291,7 @@ def initconfig_hardware_entries(self):
spec = self.spec
entries = super().initconfig_hardware_entries()
if spec.satisfies("+cuda"):
if "+cuda" in spec:
entries.append(cmake_cache_option("ENABLE_CUDA", True))
entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True))
@@ -304,7 +304,7 @@ def initconfig_hardware_entries(self):
if spec.satisfies("^blt@:0.5.1"):
# This is handled internally by BLT now
if spec.satisfies("+cpp14"):
if "+cpp14" in spec:
cudaflags += " -std=c++14"
else:
cudaflags += " -std=c++11"
@@ -313,7 +313,7 @@ def initconfig_hardware_entries(self):
entries.append("# nvcc does not like gtest's 'pthreads' flag\n")
entries.append(cmake_cache_option("gtest_disable_pthreads", True))
if spec.satisfies("+rocm"):
if "+rocm" in spec:
entries.append("#------------------{0}\n".format("-" * 60))
entries.append("# Axom ROCm specifics\n")
entries.append("#------------------{0}\n\n".format("-" * 60))
@@ -385,7 +385,7 @@ def initconfig_hardware_entries(self):
entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", linker_flags, description))
if spec.satisfies("+shared"):
if "+shared" in spec:
linker_flags = "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath," + libdir
entries.append(
cmake_cache_string("CMAKE_SHARED_LINKER_FLAGS", linker_flags, description)
@@ -440,7 +440,7 @@ def initconfig_mpi_entries(self):
spec = self.spec
entries = super().initconfig_mpi_entries()
if spec.satisfies("+mpi"):
if "+mpi" in spec:
entries.append(cmake_cache_option("ENABLE_MPI", True))
if spec["mpi"].name == "spectrum-mpi":
entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind"))
@@ -496,7 +496,7 @@ def initconfig_package_entries(self):
else:
entries.append("# %s not built\n" % dep.upper())
if spec.satisfies("+profiling"):
if "+profiling" in spec:
dep_dir = get_spec_path(spec, "adiak", path_replacements)
entries.append(cmake_cache_path("ADIAK_DIR", dep_dir))
@@ -508,7 +508,7 @@ def initconfig_package_entries(self):
entries.append(cmake_cache_path("CAMP_DIR", dep_dir))
# SCR does not export it's targets so we need to pull in its dependencies
if spec.satisfies("+scr"):
if "+scr" in spec:
dep_dir = get_spec_path(spec, "scr", path_replacements)
entries.append(cmake_cache_path("SCR_DIR", dep_dir))
@@ -541,7 +541,7 @@ def initconfig_package_entries(self):
entries.append("#------------------{0}\n".format("-" * 60))
# Add common prefix to path replacement list
if spec.satisfies("+devtools"):
if "+devtools" in spec:
# Grab common devtools root and strip the trailing slash
path1 = os.path.realpath(spec["cppcheck"].prefix)
path2 = os.path.realpath(spec["doxygen"].prefix)

View File

@@ -56,7 +56,7 @@ class Babelstream(CMakePackage, CudaPackage, ROCmPackage):
# ACC conflict
variant("cpu_arch", values=str, default="none", description="Enable CPU Target for ACC")
variant("acc_target", values=str, default="none", description="Enable CPU Target for ACC")
variant("target", values=str, default="none", description="Enable CPU Target for ACC")
# STD conflicts
conflicts("+stddata", when="%gcc@:10.1.0", msg="STD-data requires newer version of GCC")
@@ -77,7 +77,7 @@ class Babelstream(CMakePackage, CudaPackage, ROCmPackage):
conflicts(
"offload=none",
when="+raja",
msg="RAJA requires architecture to be specfied by acc_target=[CPU,NVIDIA]",
msg="RAJA requires architecture to be specfied by target=[CPU,NVIDIA]",
)
# download raja from https://github.com/LLNL/RAJA
@@ -253,7 +253,7 @@ def cmake_args(self):
# SYCL
# ===================================
if self.spec.satisfies("+sycl"):
if "+sycl" in self.spec:
args.append("-DSYCL_COMPILER=" + self.spec.variants["implementation"].value.upper())
if self.spec.variants["implementation"].value.upper() != "ONEAPI-DPCPP":
args.append(
@@ -266,7 +266,7 @@ def cmake_args(self):
# SYCL 2020
# ===================================
if self.spec.satisfies("+sycl2020"):
if "+sycl2020" in self.spec:
if self.spec.satisfies("%oneapi"):
# -fsycl flag is required for setting up sycl/sycl.hpp seems like
# it doesn't get it from the CMake file
@@ -288,7 +288,7 @@ def cmake_args(self):
# HIP(ROCM)
# ===================================
if self.spec.satisfies("+rocm"):
if "+rocm" in self.spec:
hip_comp = self.spec["rocm"].prefix + "/bin/hipcc"
args.append("-DCMAKE_CXX_COMPILER=" + hip_comp)
args.append(
@@ -303,14 +303,14 @@ def cmake_args(self):
# TBB
# ===================================
if self.spec.satisfies("+tbb"):
if "+tbb" in self.spec:
args.append("-DONE_TBB_DIR=" + self.spec["tbb"].prefix + "/tbb/latest/")
args.append("-DPARTITIONER=" + self.spec.variants["partitioner"].value.upper())
# ===================================
# OpenCL (ocl)
# ===================================
if self.spec.satisfies("+ocl"):
if "+ocl" in self.spec:
if "backend" in self.spec.variants:
if "cuda" in self.spec.variants["backend"].value:
cuda_dir = self.spec["cuda"].prefix
@@ -333,7 +333,7 @@ def cmake_args(self):
# ===================================
# RAJA
# ===================================
if self.spec.satisfies("+raja"):
if "+raja" in self.spec:
args.append("-DCMAKE_CXX_COMPILER=" + self.compiler.cxx)
args.append("-DRAJA_IN_TREE=" + self.spec.variants["dir"].value)
if "offload" in self.spec.variants:
@@ -360,7 +360,7 @@ def cmake_args(self):
# ===================================
# THRUST
# ===================================
if self.spec.satisfies("+thrust"):
if "+thrust" in self.spec:
if "cuda" in self.spec.variants["implementation"].value:
args.append("-DTHRUST_IMPL=" + self.spec.variants["implementation"].value.upper())
args.append("-SDK_DIR=" + self.spec["thrust"].prefix + "/include")
@@ -385,7 +385,7 @@ def cmake_args(self):
# ===================================
# kokkos implementation is versatile and it could use cuda or omp architectures as backend
# The usage should be spack install babelstream +kokkos +cuda [or +omp]
if self.spec.satisfies("+kokkos"):
if "+kokkos" in self.spec:
args.append("-DCMAKE_CXX_COMPILER=" + self.compiler.cxx)
args.append("-DKOKKOS_IN_TREE=" + self.spec.variants["dir"].value)
# args.append("-DKOKKOS_IN_PACKAGE=" + self.spec["kokkos"].prefix)

View File

@@ -16,12 +16,10 @@ class Babeltrace(AutotoolsPackage):
license("MIT")
version("1.5.11", sha256="67b43aaaef5c951fa7af1a557cf7201a11fe89876b7c22ba0a03cbc316db5a9c")
version("1.2.4", sha256="666e3a1ad2dc7d5703059963056e7800f0eab59c8eeb6be2efe4f3acc5209eb1")
depends_on("c", type="build") # generated
depends_on("pkgconfig", type="build")
depends_on("glib@2.22:", type=("build", "link"))
depends_on("uuid")
depends_on("popt")

View File

@@ -7,7 +7,7 @@
class Bacio(CMakePackage):
"""The bacio library performs binary I/O for the NCEP models, processing
"""The bacio ibrary performs binary I/O for the NCEP models, processing
unformatted byte-addressable data records, and transforming the little
endian files and big endian files."""
@@ -15,15 +15,15 @@ class Bacio(CMakePackage):
url = "https://github.com/NOAA-EMC/NCEPLIBS-bacio/archive/refs/tags/v2.4.1.tar.gz"
git = "https://github.com/NOAA-EMC/NCEPLIBS-bacio"
maintainers("edwardhartnett", "AlexanderRichert-NOAA", "Hang-Lei-NOAA")
maintainers("t-brown", "edwardhartnett", "AlexanderRichert-NOAA", "Hang-Lei-NOAA")
version("develop", branch="develop")
version("2.6.0", sha256="03fef581e1bd3710fb8d2f2659a6c3e01a0437c1350ba53958d2ff1ffef47bcb")
version("2.5.0", sha256="540a0ed73941d70dbf5d7b21d5d0a441e76fad2bfe37dfdfea0db3e98fc0fbfb")
version("2.4.1", sha256="7b9b6ba0a288f438bfba6a08b6e47f8133f7dba472a74ac56a5454e2260a7200")
depends_on("c", type="build")
depends_on("fortran", type="build")
depends_on("c", type="build") # generated
depends_on("fortran", type="build") # generated
variant("pic", default=True, description="Build with position-independent-code")
variant("shared", default=False, description="Build shared library", when="@2.6.0:")

View File

@@ -62,7 +62,7 @@ def edit(self, spec, prefix):
if "^netlib-lapack+lapacke" not in spec:
env["NOLAPACKE"] = "1"
if spec.satisfies("+cuda"):
if "+cuda" in spec:
cuda_arch = self.spec.variants["cuda_arch"].value
env["CUDA"] = "1"
env["CUDA_BASE"] = spec["cuda"].prefix
@@ -79,7 +79,7 @@ def install(self, spec, prefix):
install("python/cfl.py", python_platlib)
install("python/wslsupport.py", python_platlib)
if spec.satisfies("^python@3:"):
if "^python@3:" in spec:
install("python/bartview3.py", join_path(prefix.bin, "bartview"))
filter_file(r"#!/usr/bin/python3", "#!/usr/bin/env python", prefix.bin.bartview)
else:

View File

@@ -33,6 +33,6 @@ def configure_args(self):
spec = self.spec
args = ["--with-gmp-prefix={0}".format(self.spec["gmp"].prefix)]
if spec.satisfies("+pet"):
if "+pet" in spec:
args.append("--with-pet=bundled")
return args

View File

@@ -100,7 +100,7 @@ def set_make_options(self):
options.append("prefix={0}".format(self.prefix))
options.append("HTSDIR={0}".format(self.spec["htslib"].prefix))
if self.spec.satisfies("+libgsl"):
if "+libgsl" in self.spec:
options.append("USE_GPL=1")
return options

View File

@@ -14,25 +14,19 @@ class Bdftopcf(AutotoolsPackage, XorgPackage):
appropriate machine, but the files are still portable (but read more
slowly) on other machines."""
homepage = "https://gitlab.freedesktop.org/xorg/util/bdftopcf"
xorg_mirror_path = "util/bdftopcf-1.0.5.tar.gz"
homepage = "https://cgit.freedesktop.org/xorg/app/bdftopcf"
xorg_mirror_path = "app/bdftopcf-1.0.5.tar.gz"
license("MIT")
version("1.1.1", sha256="3291df9910c006a0345f3eac485e2a5734bbb79a0d97bf1f2b4cddad48fb1bc4")
version("1.1", sha256="699d1a62012035b1461c7f8e3f05a51c8bd6f28f348983249fb89bbff7309b47")
version("1.0.5", sha256="78a5ec945de1d33e6812167b1383554fda36e38576849e74a9039dc7364ff2c3")
# note: url_for_version can only return a single url, no mirrors
@when("@:1.1.0")
def url_for_version(self, version):
return self.urls[0].replace("util", "app")
depends_on("c", type="build")
depends_on("c", type="build") # generated
depends_on("libxfont")
depends_on("pkgconfig", type="build")
depends_on("xproto", type="build")
depends_on("fontsproto", type="build")
depends_on("xproto")
depends_on("fontsproto")
depends_on("util-macros", type="build")

View File

@@ -84,7 +84,7 @@ def cmake_args(self):
# Use hipcc as the c compiler if we are compiling for rocm. Doing it this way
# keeps the wrapper insted of changeing CMAKE_CXX_COMPILER keeps the spack wrapper
# and the rpaths it sets for us from the underlying spec.
if self.spec.satisfies("+rocm"):
if "+rocm" in self.spec:
env["SPACK_CXX"] = self.spec["hip"].hipcc
# If we're building with cray mpich, we need to make sure we get the GTL library for

View File

@@ -122,7 +122,7 @@ def edit(self, spec, prefix):
tar("-x", "-f", self.stage.archive_file, "--strip-components=1")
# get generic arch.mk template
if spec.satisfies("+mpi"):
if "+mpi" in spec:
copy(join_path(self.stage.source_path, "config", "generic.mpi.linux.mk"), "arch.mk")
else:
copy(join_path(self.stage.source_path, "config", "generic.serial.linux.mk"), "arch.mk")
@@ -189,27 +189,27 @@ def build(self, spec, prefix):
buildopts = []
paraflags = []
if spec.satisfies("+mpi"):
if "+mpi" in spec:
paraflags.append("-DMPI")
# We need to copy fflags in case we append to it (#34019):
fflags = spec.compiler_flags["fflags"][:]
if spec.satisfies("+openmp"):
if "+openmp" in spec:
paraflags.append("-DOMP")
fflags.append(self.compiler.openmp_flag)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
buildopts.append("C_PARAFLAG=-DPARA")
buildopts.append("PARAFLAG=%s" % " ".join(paraflags))
debugflag = ""
if spec.satisfies("+debug"):
if "+debug" in spec:
debugflag += "-DDEBUG "
if spec.satisfies("+verbose"):
if "+verbose" in spec:
debugflag += "-DVERBOSE "
buildopts.append("DEBUGFLAG=%s" % debugflag)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
buildopts.append("LINK=%s" % spec["mpi"].mpifc)
buildopts.append("C_LINK=%s" % spec["mpi"].mpicxx)
else:
@@ -228,7 +228,7 @@ def build(self, spec, prefix):
buildopts.append("LAPACKLIB=%s" % spec["lapack"].libs.ld_flags)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
mathflags.append("-DUSESCALAPACK")
buildopts.append("SCALAPACKLIB=%s" % spec["scalapack"].libs.ld_flags)
@@ -236,7 +236,7 @@ def build(self, spec, prefix):
buildopts.append("COMPFLAG=-DINTEL")
buildopts.append("MOD_OPT=-module ")
buildopts.append("FCPP=cpp -C -P -ffreestanding")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
buildopts.append("F90free=%s -free" % spec["mpi"].mpifc)
buildopts.append("C_COMP=%s" % spec["mpi"].mpicc)
buildopts.append("CC_COMP=%s" % spec["mpi"].mpicxx)
@@ -262,7 +262,7 @@ def build(self, spec, prefix):
buildopts.append(
"FCPP=%s -C -nostdinc -std=c11" % join_path(self.compiler.prefix, "bin", "cpp")
)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
buildopts.append("F90free=%s %s" % (spec["mpi"].mpifc, f90_flags))
buildopts.append("C_COMP=%s %s" % (spec["mpi"].mpicc, c_flags))
buildopts.append("CC_COMP=%s %s" % (spec["mpi"].mpicxx, cxx_flags))
@@ -278,7 +278,7 @@ def build(self, spec, prefix):
buildopts.append("COMPFLAG=")
buildopts.append("MOD_OPT=-module ")
buildopts.append("FCPP=cpp -C -nostdinc")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
buildopts.append("F90free=%s %s" % (spec["mpi"].mpifc, f90_flags))
buildopts.append("C_COMP=%s %s" % (spec["mpi"].mpicc, c_flags))
buildopts.append("CC_COMP=%s %s" % (spec["mpi"].mpicxx, cxx_flags))
@@ -293,16 +293,16 @@ def build(self, spec, prefix):
"BerkeleyGW with compiler %s" % spec.compiler
)
if spec.satisfies("+hdf5"):
if "+hdf5" in spec:
mathflags.append("-DHDF5")
buildopts.append("HDF5INCLUDE=%s" % spec["hdf5"].prefix.include)
buildopts.append("HDF5LIB=%s" % spec["hdf5:hl,fortran"].libs.ld_flags)
if spec.satisfies("+elpa"):
if "+elpa" in spec:
mathflags.append("-DUSEELPA")
elpa = spec["elpa"]
if spec.satisfies("+openmp"):
if "+openmp" in spec:
elpa_suffix = "_openmp"
else:
elpa_suffix = ""

View File

@@ -51,7 +51,7 @@ def configure_args(self):
cflags = []
cxxflags = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
fcflags.append(self.compiler.openmp_flag)
if spec.satisfies("+shared"):
@@ -74,7 +74,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -83,12 +83,12 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")
if spec.satisfies("+openbabel"):
if "+openbabel" in spec:
args.append("--enable-openbabel")
args.append(f"--with-openbabel-libs={spec['openbabel'].prefix.lib}")
args.append(f"--with-openbabel-incs={spec['openbabel'].prefix.include}")

View File

@@ -60,11 +60,11 @@ def configure_args(self):
pyyaml = join_path(spec["py-pyyaml"].prefix.lib, f"python{python_version}")
openmp_flag = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
openmp_flag.append(self.compiler.openmp_flag)
linalg = []
if spec.satisfies("+scalapack"):
if "+scalapack" in spec:
linalg.append(spec["scalapack"].libs.ld_flags)
linalg.append(spec["lapack"].libs.ld_flags)
linalg.append(spec["blas"].libs.ld_flags)
@@ -83,7 +83,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -92,22 +92,22 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")
args.append(f"--with-atlab-libs={spec['bigdft-atlab'].prefix.lib}")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("--enable-cuda-gpu")
args.append(f"--with-cuda-path={spec['cuda'].prefix}")
args.append(f"--with-cuda-libs={spec['cuda'].libs.link_flags}")
if spec.satisfies("+minpack"):
if "+minpack" in spec:
args.append("--with-minpack")
if spec.satisfies("+ntpoly"):
if "+ntpoly" in spec:
args.append("--enable-ntpoly")
return args

View File

@@ -64,11 +64,11 @@ def configure_args(self):
pyyaml = join_path(spec["py-pyyaml"].prefix.lib, f"python{python_version}")
openmp_flag = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
openmp_flag.append(self.compiler.openmp_flag)
linalg = []
if spec.satisfies("+scalapack"):
if "+scalapack" in spec:
linalg.append(spec["scalapack"].libs.ld_flags)
linalg.append(spec["lapack"].libs.ld_flags)
linalg.append(spec["blas"].libs.ld_flags)
@@ -96,7 +96,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -105,19 +105,19 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("--enable-opencl")
args.append(f"--with-ocl-path={spec['cuda'].prefix}")
args.append("--enable-cuda-gpu")
args.append(f"--with-cuda-path={spec['cuda'].prefix}")
args.append(f"--with-cuda-libs={spec['cuda'].libs.link_flags}")
if spec.satisfies("+openbabel"):
if "+openbabel" in spec:
args.append("--enable-openbabel")
args.append(f"--with-openbabel-libs={spec['openbabel'].prefix.lib}")
args.append(f"--with-openbabel-incs={spec['openbabel'].prefix.include}")

View File

@@ -58,7 +58,7 @@ def configure_args(self):
pyyaml = join_path(spec["py-pyyaml"].prefix.lib, f"python{python_version}")
openmp_flag = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
openmp_flag.append(self.compiler.openmp_flag)
args = [
@@ -71,12 +71,12 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -85,7 +85,7 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("--enable-opencl")
args.append(f"--with-ocl-path={spec['cuda'].prefix}")
args.append("--enable-cuda-gpu")

View File

@@ -66,7 +66,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.extend(
[
f"CC={spec['mpi'].mpicc}",

View File

@@ -59,11 +59,11 @@ def configure_args(self):
pyyaml = join_path(spec["py-pyyaml"].prefix.lib, f"python{python_version}")
openmp_flag = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
openmp_flag.append(self.compiler.openmp_flag)
linalg = []
if spec.satisfies("+scalapack"):
if "+scalapack" in spec:
linalg.append(spec["scalapack"].libs.ld_flags)
linalg.append(spec["lapack"].libs.ld_flags)
linalg.append(spec["blas"].libs.ld_flags)
@@ -81,7 +81,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -90,14 +90,14 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")
args.append(f"--with-atlab-libs={spec['bigdft-atlab'].prefix.lib}")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("--enable-cuda-gpu")
args.append(f"--with-cuda-path={spec['cuda'].prefix}")
args.append(f"--with-cuda-libs={spec['cuda'].libs.link_flags}")

View File

@@ -57,11 +57,11 @@ def configure_args(self):
pyyaml = join_path(spec["py-pyyaml"].prefix.lib, f"python{python_version}")
openmp_flag = []
if spec.satisfies("+openmp"):
if "+openmp" in spec:
openmp_flag.append(self.compiler.openmp_flag)
linalg = []
if spec.satisfies("+scalapack"):
if "+scalapack" in spec:
linalg.append(spec["scalapack"].libs.ld_flags)
linalg.append(spec["lapack"].libs.ld_flags)
linalg.append(spec["blas"].libs.ld_flags)
@@ -82,7 +82,7 @@ def configure_args(self):
if spec.satisfies("+shared"):
args.append("--enable-dynamic-libraries")
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append(f"CC={spec['mpi'].mpicc}")
args.append(f"CXX={spec['mpi'].mpicxx}")
args.append(f"FC={spec['mpi'].mpifc}")
@@ -91,7 +91,7 @@ def configure_args(self):
else:
args.append("--disable-mpi")
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args.append("--with-openmp")
else:
args.append("--without-openmp")

View File

@@ -27,7 +27,6 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
checked_by="tgamblin",
)
version("2.43", sha256="fed3c3077f0df7a4a1aa47b080b8c53277593ccbb4e5e78b73ffb4e3f265e750")
version("2.42", sha256="aa54850ebda5064c72cd4ec2d9b056c294252991486350d9a97ab2a6dfdfaf12")
version("2.41", sha256="a4c4bec052f7b8370024e60389e194377f3f48b56618418ea51067f67aaab30b")
version("2.40", sha256="f8298eb153a4b37d112e945aa5cb2850040bcf26a3ea65b5a715c83afe05e48a")
@@ -287,7 +286,7 @@ def configure_args(self):
args += self.enable_or_disable("lto")
args += self.enable_or_disable("nls")
args += self.enable_or_disable("plugins")
if self.spec.satisfies("+pgo"):
if "+pgo" in self.spec:
args.append("--enable-pgo-build=lto")
else:
args.append("--disable-pgo-build")

View File

@@ -3,8 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.package import *
@@ -40,12 +38,6 @@ def cache_test_sources(self):
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources(self.test_src_dir)
# Fix test scripts to run installed binaries
scripts_dir = join_path(install_test_root(self), self.test_src_dir)
for path in os.listdir(scripts_dir):
if path.endswith(".sh"):
filter_file(r"../src/", r"", join_path(scripts_dir, path))
def test_short_sort(self):
"""run testshortsort.sh to check alignments sorted by coordinate"""
test_dir = join_path(self.test_suite.current_test_cache_dir, self.test_src_dir)

View File

@@ -25,7 +25,7 @@ class Bitgroomingz(CMakePackage):
def cmake_args(self):
args = []
if self.spec.satisfies("+shared"):
if "+shared" in self.spec:
args.append("-DBUILD_SHARED_LIBS=ON")
else:
args.append("-DBUILD_SHARED_LIBS=OFF")

View File

@@ -9,14 +9,14 @@
class Bitmap(AutotoolsPackage, XorgPackage):
"""bitmap, bmtoa, atobm - X bitmap (XBM) editor and converter utilities."""
homepage = "https://gitlab.freedesktop.org/xorg/app/bitmap"
homepage = "https://cgit.freedesktop.org/xorg/app/bitmap"
xorg_mirror_path = "app/bitmap-1.0.8.tar.gz"
version("1.1.1", sha256="86928020ece030435eb5ae795a5f22c5ca0886a6c589187886d1b6d14d9eec81")
version("1.1.0", sha256="60ca941e8e38e1f8f9c61d3e86c098878113fd11eac4e07177c111f0bf00779e")
version("1.0.8", sha256="1a2fbd10a2ca5cd93f7b77bbb0555b86d8b35e0fc18d036b1607c761755006fc")
depends_on("c", type="build")
depends_on("c", type="build") # generated
depends_on("libx11")
depends_on("libxmu")
@@ -25,6 +25,6 @@ class Bitmap(AutotoolsPackage, XorgPackage):
depends_on("libxt")
depends_on("xbitmaps")
depends_on("xproto@7.0.25:", type="build")
depends_on("xproto@7.0.25:")
depends_on("pkgconfig", type="build")
depends_on("util-macros", type="build")

View File

@@ -91,11 +91,11 @@ def cmake_args(self):
backend_config = "-Duse_cuda=%s" % ("+cuda" in spec)
if self.version >= Version("2021.04.01"):
backend = "none"
if spec.satisfies("+cuda"):
if "+cuda" in spec:
backend = "cuda"
if spec.satisfies("+rocm"):
if "+rocm" in spec:
backend = "hip"
if spec.satisfies("+sycl"):
if "+sycl" in spec:
backend = "sycl"
backend_config = "-Dgpu_backend=%s" % backend

View File

@@ -14,8 +14,6 @@ class BlastPlus(AutotoolsPackage):
maintainers("weijianwen")
version("2.16.0", sha256="17c93cf009721023e5aecf5753f9c6a255d157561638b91b3ad7276fd6950c2b")
version("2.15.0", sha256="6918c370524c8d44e028bf491e8f245a895e07c66c77b261ce3b38d6058216e0")
version("2.14.1", sha256="712c2dbdf0fb13cc1c2d4f4ef5dd1ce4b06c3b57e96dfea8f23e6e99f5b1650e")
version("2.13.0", sha256="89553714d133daf28c477f83d333794b3c62e4148408c072a1b4620e5ec4feb2")
version("2.12.0", sha256="fda3c9c9d488cad6c1880a98a236d842bcf3610e3e702af61f7a48cf0a714b88")
@@ -94,7 +92,7 @@ def configure_args(self):
if spec.target.family != "aarch64":
config_args.append("--with-64")
if spec.satisfies("+static"):
if "+static" in spec:
config_args.append("--with-static")
# FIXME
# args << "--with-static-exe" unless OS.linux?
@@ -102,17 +100,17 @@ def configure_args(self):
else:
config_args.extend(["--with-dll", "--without-static", "--without-static-exe"])
if spec.satisfies("+jpeg"):
if "+jpeg" in spec:
config_args.append("--with-jpeg={0}".format(self.spec["jpeg"].prefix))
else:
config_args.append("--without-jpeg")
if spec.satisfies("+png"):
if "+png" in spec:
config_args.append("--with-png={0}".format(self.spec["libpng"].prefix))
else:
config_args.append("--without-png")
if spec.satisfies("+freetype"):
if "+freetype" in spec:
config_args.append("--with-freetype={0}".format(self.spec["freetype"].prefix))
else:
config_args.append("--without-freetype")
@@ -126,42 +124,42 @@ def configure_args(self):
# else:
# config_args.append('--without-hdf5')
if spec.satisfies("+zlib"):
if "+zlib" in spec:
config_args.append("--with-z={0}".format(self.spec["zlib-api"].prefix))
else:
config_args.append("--without-z")
if spec.satisfies("+bzip2"):
if "+bzip2" in spec:
config_args.append("--with-bz2={0}".format(self.spec["bzip2"].prefix))
else:
config_args.append("--without-bz2")
if spec.satisfies("+lzo"):
if "+lzo" in spec:
config_args.append("--with-lzo={0}".format(self.spec["lzo"].prefix))
else:
config_args.append("--without-lzo")
if spec.satisfies("+gnutls"):
if "+gnutls" in spec:
config_args.append("--with-gnutls={0}".format(self.spec["gnutls"].prefix))
else:
config_args.append("--without-gnutls")
if spec.satisfies("+openssl"):
if "+openssl" in spec:
config_args.append("--with-openssl={0}".format(self.spec["openssl"].prefix))
else:
config_args.append("--without-openssl")
if spec.satisfies("+pcre"):
if "+pcre" in spec:
config_args.append("--with-pcre={0}".format(self.spec["pcre"].prefix))
else:
config_args.append("--without-pcre")
if spec.satisfies("+python"):
if "+python" in spec:
config_args.append("--with-python={0}".format(self.spec["python"].home))
else:
config_args.append("--without-python")
if spec.satisfies("+perl"):
if "+perl" in spec:
config_args.append("--with-perl={0}".format(self.spec["perl"].prefix))
else:
config_args.append("--without-python")

View File

@@ -55,17 +55,17 @@ def configure_args(self):
spec = self.spec
config_args = ["--enable-threading={0}".format(spec.variants["threads"].value)]
if spec.satisfies("+ilp64"):
if "+ilp64" in spec:
config_args.append("--blas-int-size=64")
else:
config_args.append("--blas-int-size=32")
if spec.satisfies("+cblas"):
if "+cblas" in spec:
config_args.append("--enable-cblas")
else:
config_args.append("--disable-cblas")
if spec.satisfies("+blas"):
if "+blas" in spec:
config_args.append("--enable-blas")
else:
config_args.append("--disable-blas")

View File

@@ -49,7 +49,7 @@ class Bml(CMakePackage):
def cmake_args(self):
args = [self.define_from_variant("BUILD_SHARED_LIBS", "shared")]
spec = self.spec
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append("-DBML_MPI=True")
args.append("-DCMAKE_C_COMPILER=%s" % spec["mpi"].mpicc)
args.append("-DCMAKE_CXX_COMPILER=%s" % spec["mpi"].mpicxx)

View File

@@ -148,7 +148,7 @@ def cmake_args(self):
#
args += ["-DVE_OPENCL=" + str("+opencl" in spec), "-DVE_CUDA=" + str("+cuda" in spec)]
if spec.satisfies("+openmp"):
if "+openmp" in spec:
args += [
"-DVE_OPENMP=ON",
"-DOPENMP_FOUND=True",
@@ -160,7 +160,7 @@ def cmake_args(self):
#
# Extension methods
#
if spec.satisfies("+blas"):
if "+blas" in spec:
args += [
"-DEXT_BLAS=ON",
"-DCBLAS_FOUND=True",
@@ -170,7 +170,7 @@ def cmake_args(self):
else:
args += ["-DEXT_BLAS=OFF", "-DDCBLAS_FOUND=False"]
if spec.satisfies("+lapack"):
if "+lapack" in spec:
args += [
"-DEXT_LAPACK=ON",
"-DLAPACKE_FOUND=True",
@@ -180,7 +180,7 @@ def cmake_args(self):
else:
args += ["-DEXT_LAPACK=OFF", "-DLAPACKE_FOUND=False"]
if spec.satisfies("+opencv"):
if "+opencv" in spec:
args += [
"-DEXT_OPENCV=ON",
"-DOpenCV_FOUND=True",
@@ -234,11 +234,11 @@ def check_install(self):
# Collect the stacks which should be available:
stacks = ["default"]
if spec.satisfies("+openmp"):
if "+openmp" in spec:
stacks.append("openmp")
if spec.satisfies("+cuda"):
if "+cuda" in spec:
stacks.append("cuda")
if spec.satisfies("+opencl"):
if "+opencl" in spec:
stacks.append("opencl")
# C++ compiler and compiler flags
@@ -268,7 +268,7 @@ def check_install(self):
compare_output(cpp_output, "Success!\n")
# Python test (if +python)
if spec.satisfies("+python"):
if "+python" in spec:
file_pyadd = join_path(os.path.dirname(self.module.__file__), "pyadd.py")
py_output = python(file_pyadd, output=str, env=test_env)
compare_output(py_output, "Success!\n")

View File

@@ -60,7 +60,7 @@ def configure_args(self):
args.append("--disable-server")
args.append("--enable-client")
if spec.satisfies("+manager"):
if "+manager" in spec:
args.append("--enable-manager")
else:
args.append("--disable-manager")

View File

@@ -39,16 +39,16 @@ def cmake_args(self):
spec = self.spec
cmake_args = []
if spec.satisfies("+typhon"):
if "+typhon" in spec:
cmake_args.append("-DENABLE_TYPHON=ON")
if spec.satisfies("+parmetis"):
if "+parmetis" in spec:
cmake_args.append("-DENABLE_PARMETIS=ON")
if spec.satisfies("+silo"):
if "+silo" in spec:
cmake_args.append("-DENABLE_SILO=ON")
if spec.satisfies("+caliper"):
if "+caliper" in spec:
cmake_args.append("-DENABLE_CALIPER=ON")
return cmake_args

View File

@@ -507,10 +507,10 @@ def determine_bootstrap_options(self, spec, with_libs, options):
options.append("--with-toolset=%s" % boost_toolset_id)
options.append("--with-libraries=%s" % ",".join(with_libs))
if spec.satisfies("+python"):
if "+python" in spec:
options.append("--with-python=%s" % spec["python"].command.path)
if spec.satisfies("+icu"):
if "+icu" in spec:
options.append("--with-icu")
else:
options.append("--without-icu")
@@ -522,7 +522,7 @@ def determine_bootstrap_options(self, spec, with_libs, options):
# Skip this on Windows since we don't have a cl.exe wrapper in spack
f.write("using {0} : : {1} ;\n".format(boost_toolset_id, spack_cxx))
if spec.satisfies("+mpi"):
if "+mpi" in spec:
# Use the correct mpi compiler. If the compiler options are
# empty or undefined, Boost will attempt to figure out the
# correct options by running "${mpicxx} -show" or something
@@ -532,21 +532,21 @@ def determine_bootstrap_options(self, spec, with_libs, options):
mpi_line = "using mpi : %s" % spec["mpi"].mpicxx
f.write(mpi_line + " ;\n")
if spec.satisfies("+python"):
if "+python" in spec:
f.write(self.bjam_python_line(spec))
def determine_b2_options(self, spec, options):
if spec.satisfies("+debug"):
if "+debug" in spec:
options.append("variant=debug")
else:
options.append("variant=release")
if spec.satisfies("+icu"):
if "+icu" in spec:
options.extend(["-s", "ICU_PATH=%s" % spec["icu4c"].prefix])
else:
options.append("--disable-icu")
if spec.satisfies("+iostreams"):
if "+iostreams" in spec:
options.extend(
[
"-s",
@@ -568,17 +568,17 @@ def determine_b2_options(self, spec, options):
]
)
# At least with older Xcode, _lzma_cputhreads is missing (#33998)
if self.spec.satisfies("platform=darwin"):
if "platform=darwin" in self.spec:
options.extend(["-s", "NO_LZMA=1"])
link_types = ["static"]
if spec.satisfies("+shared"):
if "+shared" in spec:
link_types.append("shared")
threading_opts = []
if spec.satisfies("+multithreaded"):
if "+multithreaded" in spec:
threading_opts.append("multi")
if spec.satisfies("+singlethreaded"):
if "+singlethreaded" in spec:
threading_opts.append("single")
if not threading_opts:
raise RuntimeError(
@@ -589,9 +589,9 @@ def determine_b2_options(self, spec, options):
if "+context" in spec and "context-impl" in spec.variants:
options.extend(["context-impl=%s" % spec.variants["context-impl"].value])
if spec.satisfies("+taggedlayout"):
if "+taggedlayout" in spec:
layout = "tagged"
elif spec.satisfies("+versionedlayout"):
elif "+versionedlayout" in spec:
layout = "versioned"
else:
if len(threading_opts) > 1:
@@ -623,7 +623,7 @@ def determine_b2_options(self, spec, options):
if flag:
cxxflags.append(flag)
if self.spec.satisfies("+pic"):
if "+pic" in self.spec:
cxxflags.append(self.compiler.cxx_pic_flag)
# clang is not officially supported for pre-compiled headers
@@ -632,7 +632,7 @@ def determine_b2_options(self, spec, options):
# https://svn.boost.org/trac/boost/ticket/12496
if spec.satisfies("%apple-clang") or spec.satisfies("%clang") or spec.satisfies("%fj"):
options.extend(["pch=off"])
if spec.satisfies("+clanglibcpp"):
if "+clanglibcpp" in spec:
cxxflags.append("-stdlib=libc++")
options.extend(["toolset=clang", 'linkflags="-stdlib=libc++"'])
elif spec.satisfies("%xl") or spec.satisfies("%xl_r"):
@@ -696,7 +696,7 @@ def install(self, spec, prefix):
with_libs.remove("random")
if not spec.satisfies("@1.39.0:") and "exception" in with_libs:
with_libs.remove("exception")
if spec.satisfies("+graph") and spec.satisfies("+mpi"):
if "+graph" in spec and "+mpi" in spec:
with_libs.append("graph_parallel")
if not with_libs:
@@ -753,7 +753,7 @@ def install(self, spec, prefix):
threading_opts = self.determine_b2_options(spec, b2_options)
# Create headers if building from a git checkout
if spec.satisfies("@develop"):
if "@develop" in spec:
b2("headers", *b2_options)
b2("--clean", *b2_options)
@@ -766,7 +766,7 @@ def install(self, spec, prefix):
else:
b2("install", *b2_options)
if spec.satisfies("+multithreaded") and spec.satisfies("~taggedlayout"):
if "+multithreaded" in spec and "~taggedlayout" in spec:
self.add_buildopt_symlinks(prefix)
# The shared libraries are not installed correctly

View File

@@ -60,7 +60,7 @@ def edit(self, spec, prefix):
def configure_args(self):
spec = self.spec
args = ["--prefix={0}".format(self.prefix)]
if spec.satisfies("+doc"):
if "+doc" in spec:
args.append("--with-documentation")
else:
args.append("--without-documentation")

View File

@@ -74,7 +74,7 @@ def edit(self, spec, prefix):
makefile.filter("CXX = .*", "CPP = " + env["CXX"])
def build(self, spec, prefix):
if spec.satisfies("+tbb"):
if "+tbb" in spec:
make()
else:
make("NO_TBB=1")

View File

@@ -47,7 +47,7 @@ class Bricks(CMakePackage):
def cmake_args(self):
"""CMake arguments for configure stage"""
args = [self.define_from_variant("BRICK_USE_OPENCL", "cuda")]
if self.spec.satisfies("+cuda"):
if "+cuda" in self.spec:
args.append(f"-DOCL_ROOT:STRING={self.spec['opencl-clhpp'].prefix}")
return args

View File

@@ -17,13 +17,12 @@ class Bufr(CMakePackage):
"""
homepage = "https://noaa-emc.github.io/NCEPLIBS-bufr"
url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.1.0.tar.gz"
url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/bufr_v11.5.0.tar.gz"
git = "https://github.com/NOAA-EMC/NCEPLIBS-bufr"
maintainers("AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA", "jbathegit")
version("develop", branch="develop")
version("12.1.0", sha256="b5eae61b50d4132b2933b6e6dfc607e5392727cdc4f46ec7a94a19109d91dcf3")
version("12.0.1", sha256="525f26238dba6511a453fc71cecc05f59e4800a603de2abbbbfb8cbb5adf5708")
version("12.0.0", sha256="d01c02ea8e100e51fd150ff1c4a1192ca54538474acb1b7f7a36e8aeab76ee75")
version("11.7.1", sha256="6533ce6eaa6b02c0cb5424cfbc086ab120ccebac3894980a4daafd4dfadd71f8")
@@ -32,8 +31,8 @@ class Bufr(CMakePackage):
version("11.5.0", sha256="d154839e29ef1fe82e58cf20232e9f8a4f0610f0e8b6a394b7ca052e58f97f43")
version("11.4.0", sha256="946482405e675b99e8e0c221d137768f246076f5e9ba92eed6cae47fb68b7a26")
depends_on("c", type="build")
depends_on("fortran", type="build")
depends_on("c", type="build") # generated
depends_on("fortran", type="build") # generated
# Patch to not add "-c" to ranlib flags when using llvm-ranlib on Apple systems
patch("cmakelists-apple-llvm-ranlib.patch", when="@11.5.0:11.6.0")
@@ -42,10 +41,8 @@ class Bufr(CMakePackage):
# Patch to identify Python version correctly
patch("python-version.patch", when="@11.5:12.0.0 +python")
variant("python", default=False, description="Enable Python interface")
variant("python", default=False, description="Enable Python interface?")
variant("shared", default=True, description="Build shared libraries", when="@11.5:")
variant("test_files", default="none", description="Path to test files")
variant("utils", default=True, description="Build utilities", when="@12.1:")
extends("python", when="+python")
@@ -55,8 +52,6 @@ class Bufr(CMakePackage):
depends_on("py-pip", type="build", when="+python")
depends_on("py-wheel", type="build", when="+python")
conflicts("%oneapi@:2024.1", msg="Requires oneapi 2024.2 or later")
def url_for_version(self, version):
pre = "bufr_" if version < Version("12.0.1") else ""
return (
@@ -73,13 +68,8 @@ def cmake_args(self):
self.define_from_variant("ENABLE_PYTHON", "python"),
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define("BUILD_TESTS", self.run_tests),
self.define("BUILD_TESTING", self.run_tests),
self.define_from_variant("BUILD_UTILS", "utils"),
]
if not self.spec.satisfies("test_files=none"):
args.append(self.define_from_variant("TEST_FILE_DIR", "test_files"))
return args
def flag_handler(self, name, flags):
@@ -129,5 +119,6 @@ def setup_run_environment(self, env):
self._setup_bufr_environment(env, suffix)
def check(self):
with working_dir(self.builder.build_directory):
make("test")
if self.spec.satisfies("~python"):
with working_dir(self.builder.build_directory):
make("test")

View File

@@ -79,7 +79,7 @@ def cmake_args(self):
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
]
args.append("-Denable_openmp=%s" % ("ON" if "+openmp" in spec else "OFF"))
if spec.satisfies("%cce"):
if "%cce" in spec:
# Assume the proper Cray CCE module (cce) is loaded:
craylibs_var = "CRAYLIBS_" + str(spec.target.family).upper()
craylibs_path = env.get(craylibs_var, None)

View File

@@ -65,9 +65,9 @@ def libs(self):
def flag_handler(self, name, flags):
if name == "cflags":
if self.spec.satisfies("+pic"):
if "+pic" in self.spec:
flags.append(self.compiler.cc_pic_flag)
if self.spec.satisfies("+debug"):
if "+debug" in self.spec:
flags.append("-g")
return (flags, None, None)
@@ -123,7 +123,7 @@ def patch(self):
def install(self, spec, prefix):
# Build the dynamic library first
if spec.satisfies("+shared"):
if "+shared" in spec:
make("-f", "Makefile-libbz2_so")
# Build the static library and everything else
@@ -145,7 +145,7 @@ def install(self, spec, prefix):
make()
make("install", "PREFIX={0}".format(prefix))
if spec.satisfies("+shared"):
if "+shared" in spec:
install("bzip2-shared", join_path(prefix.bin, "bzip2"))
v1, v2, v3 = (self.spec.version.up_to(i) for i in (1, 2, 3))

View File

@@ -54,7 +54,7 @@ def libs(self):
def cmake_args(self):
args = []
if self.spec.satisfies("+avx2"):
if "+avx2" in self.spec:
args.append("-DDEACTIVATE_AVX2=OFF")
else:
args.append("-DDEACTIVATE_AVX2=ON")

View File

@@ -11,7 +11,7 @@ class CBlosc2(CMakePackage):
other bells and whistles"""
homepage = "https://www.blosc.org/"
url = "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.15.1.tar.gz"
url = "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.10.2.tar.gz"
git = "https://github.com/Blosc/c-blosc2.git"
maintainers("ax3l", "robert-mijakovic")
@@ -19,7 +19,6 @@ class CBlosc2(CMakePackage):
license("BSD-3-Clause")
version("develop", branch="master")
version("2.15.1", sha256="6cf32fcfc615542b9ba35e021635c8ab9fd3d328fd99d5bf04b7eebc80f1fae2")
version("2.11.1", sha256="1e9923e0f026eb6e6caee608b4b9a523837806076fc79409055a6386cf5de1ea")
version("2.10.5", sha256="a88f94bf839c1371aab8207a6a43698ceb92c72f65d0d7fe5b6e59f24c138b4d")
# 2.10.2+ fixes regressions with external dependencies

View File

@@ -144,7 +144,7 @@ def cmake_args(self):
options.append(self.define(cbn_disable, "ON"))
# Use hipcc for HIP.
if self.spec.satisfies("+rocm"):
if "+rocm" in self.spec:
options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc))
return options

View File

@@ -92,7 +92,7 @@ def cmake_args(self):
]
)
if spec.satisfies("+cuda"):
if "+cuda" in spec:
if spec.variants["cuda_arch"].value[0] != "none":
cuda_arch = spec.variants["cuda_arch"].value
args.append(self.define("CUDA_ARCH_NAME", "Manual"))

View File

@@ -83,7 +83,7 @@ def autoreconf(self, spec, prefix):
def configure_args(self):
args = ["--disable-trace", "--enable-tee"] # can cause problems with libiberty
if self.spec.satisfies("+X"):
if "+X" in self.spec:
args.extend(["--enable-xlib", "--enable-xcb"])
else:
args.extend(["--disable-xlib", "--disable-xcb"])

View File

@@ -159,40 +159,40 @@ def cmake_args(self):
self.define_from_variant("WITH_KOKKOS", "kokkos"),
]
if spec.satisfies("+papi"):
if "+papi" in spec:
args.append("-DPAPI_PREFIX=%s" % spec["papi"].prefix)
if spec.satisfies("+libdw"):
if "+libdw" in spec:
args.append("-DLIBDW_PREFIX=%s" % spec["elfutils"].prefix)
if spec.satisfies("+libpfm"):
if "+libpfm" in spec:
args.append("-DLIBPFM_INSTALL=%s" % spec["libpfm4"].prefix)
if spec.satisfies("+sosflow"):
if "+sosflow" in spec:
args.append("-DSOS_PREFIX=%s" % spec["sosflow"].prefix)
if spec.satisfies("+variorum"):
if "+variorum" in spec:
args.append("-DVARIORUM_PREFIX=%s" % spec["variorum"].prefix)
# -DWITH_CALLPATH was renamed -DWITH_LIBUNWIND in 2.5
callpath_flag = "LIBUNWIND" if spec.satisfies("@2.5:") else "CALLPATH"
if spec.satisfies("+libunwind"):
if "+libunwind" in spec:
args.append("-DLIBUNWIND_PREFIX=%s" % spec["unwind"].prefix)
args.append("-DWITH_%s=On" % callpath_flag)
else:
args.append("-DWITH_%s=Off" % callpath_flag)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
args.append("-DMPI_C_COMPILER=%s" % spec["mpi"].mpicc)
args.append("-DMPI_CXX_COMPILER=%s" % spec["mpi"].mpicxx)
if spec.satisfies("+cuda"):
if "+cuda" in spec:
args.append("-DCUDA_TOOLKIT_ROOT_DIR=%s" % spec["cuda"].prefix)
# technically only works with cuda 10.2+, otherwise cupti is in
# ${CUDA_TOOLKIT_ROOT_DIR}/extras/CUPTI
args.append("-DCUPTI_PREFIX=%s" % spec["cuda"].prefix)
if spec.satisfies("+vtune"):
if "+vtune" in spec:
itt_dir = join_path(spec["intel-oneapi-vtune"].prefix, "vtune", "latest")
args.append("-DITT_PREFIX=%s" % itt_dir)
if spec.satisfies("+rocm"):
if "+rocm" in spec:
args.append("-DCMAKE_CXX_COMPILER={0}".format(spec["hip"].hipcc))
args.append("-DROCM_PREFIX=%s" % spec["hsa-rocr-dev"].prefix)

View File

@@ -49,7 +49,7 @@ def cmake_args(self):
"-DBUILD_FOR_INSTALL:BOOL=ON",
]
if spec.satisfies("+moab"):
if "+moab" in spec:
options.extend(["-DENABLE_MOAB:BOOL=ON", "-DMOAB_PATH:PATH=%s" % spec["moab"].prefix])
else:
options.append("-DENABLE_MOAB:BOOL=OFF")

View File

@@ -75,7 +75,7 @@ def cmake_args(self):
options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix))
options.append(self.define_from_variant("ENABLE_CUDA", "cuda"))
if spec.satisfies("+cuda"):
if "+cuda" in spec:
options.append("-DCUDA_TOOLKIT_ROOT_DIR={0}".format(spec["cuda"].prefix))
if not spec.satisfies("cuda_arch=none"):
@@ -86,7 +86,7 @@ def cmake_args(self):
options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag))
options.append(self.define_from_variant("ENABLE_HIP", "rocm"))
if spec.satisfies("+rocm"):
if "+rocm" in spec:
options.append("-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix))
archs = self.spec.variants["amdgpu_target"].value

View File

@@ -92,7 +92,7 @@ def edit(self, spec, prefix):
)
makefile.filter("OPENMPI MVAPICH", "OPENMPI MVAPICH IntelMPI", string=True)
if spec.satisfies("+mpi"):
if "+mpi" in spec:
# Substitute CC, FC.
makefile.filter("CC = .*", "CC = " + spec["mpi"].mpicc)
makefile.filter("FC = .*", "FC = " + spec["mpi"].mpifc)
@@ -122,7 +122,7 @@ def build_targets(self):
compiler = os.path.basename(env["FC"]) + omp
args = ["COMPILER={0}".format(compiler)]
# Set MPI.
if self.spec.satisfies("+mpi"):
if "+mpi" in self.spec:
mpi = self.spec["mpi"]
args += ["MPI={0}".format(mpi.name), "MPI_INST={0}".format(mpi.prefix)]
return args

Some files were not shown because too many files have changed in this diff Show More