remove platform=cray (#43796)

Remove support for `cray` as a separate platform.

Any platform previously detected as `cray` is now detected as `linux`.

Users who still need platform=cray have to stick to Spack 0.22
This commit is contained in:
Massimiliano Culpo
2024-05-30 14:21:32 +02:00
committed by GitHub
parent 67b5f6b838
commit f242e0fd0c
107 changed files with 104 additions and 1359 deletions

View File

@@ -1,16 +0,0 @@
# -------------------------------------------------------------------------
# This is the default configuration for Spack's module file generation.
#
# Settings here are versioned with Spack and are intended to provide
# sensible defaults out of the box. Spack maintainers should edit this
# file to keep it current.
#
# Users can override these settings by editing the following files.
#
# Per-spack-instance settings (overrides defaults):
# $SPACK_ROOT/etc/spack/modules.yaml
#
# Per-user settings (overrides default and site settings):
# ~/.spack/modules.yaml
# -------------------------------------------------------------------------
modules: {}

View File

@@ -1433,22 +1433,12 @@ the reserved keywords ``platform``, ``os`` and ``target``:
$ spack install libelf os=ubuntu18.04
$ spack install libelf target=broadwell
or together by using the reserved keyword ``arch``:
.. code-block:: console
$ spack install libelf arch=cray-CNL10-haswell
Normally users don't have to bother specifying the architecture if they
are installing software for their current host, as in that case the
values will be detected automatically. If you need fine-grained control
over which packages use which targets (or over *all* packages' default
target), see :ref:`package-preferences`.
.. admonition:: Cray machines
The situation is a little bit different for Cray machines and a detailed
explanation on how the architecture can be set on them can be found at :ref:`cray-support`
.. _support-for-microarchitectures:

View File

@@ -1364,187 +1364,6 @@ This will write the private key to the file `dinosaur.priv`.
or for help on an issue or the Spack slack.
.. _cray-support:
-------------
Spack on Cray
-------------
Spack differs slightly when used on a Cray system. The architecture spec
can differentiate between the front-end and back-end processor and operating system.
For example, on Edison at NERSC, the back-end target processor
is "Ivy Bridge", so you can specify to use the back-end this way:
.. code-block:: console
$ spack install zlib target=ivybridge
You can also use the operating system to build against the back-end:
.. code-block:: console
$ spack install zlib os=CNL10
Notice that the name includes both the operating system name and the major
version number concatenated together.
Alternatively, if you want to build something for the front-end,
you can specify the front-end target processor. The processor for a login node
on Edison is "Sandy bridge" so we specify on the command line like so:
.. code-block:: console
$ spack install zlib target=sandybridge
And the front-end operating system is:
.. code-block:: console
$ spack install zlib os=SuSE11
^^^^^^^^^^^^^^^^^^^^^^^
Cray compiler detection
^^^^^^^^^^^^^^^^^^^^^^^
Spack can detect compilers using two methods. For the front-end, we treat
everything the same. The difference lies in back-end compiler detection.
Back-end compiler detection is made via the Tcl module avail command.
Once it detects the compiler it writes the appropriate PrgEnv and compiler
module name to compilers.yaml and sets the paths to each compiler with Cray\'s
compiler wrapper names (i.e. cc, CC, ftn). During build time, Spack will load
the correct PrgEnv and compiler module and will call appropriate wrapper.
The compilers.yaml config file will also differ. There is a
modules section that is filled with the compiler's Programming Environment
and module name. On other systems, this field is empty []:
.. code-block:: yaml
- compiler:
modules:
- PrgEnv-intel
- intel/15.0.109
As mentioned earlier, the compiler paths will look different on a Cray system.
Since most compilers are invoked using cc, CC and ftn, the paths for each
compiler are replaced with their respective Cray compiler wrapper names:
.. code-block:: yaml
paths:
cc: cc
cxx: CC
f77: ftn
fc: ftn
As opposed to an explicit path to the compiler executable. This allows Spack
to call the Cray compiler wrappers during build time.
For more on compiler configuration, check out :ref:`compiler-config`.
Spack sets the default Cray link type to dynamic, to better match other
other platforms. Individual packages can enable static linking (which is the
default outside of Spack on cray systems) using the ``-static`` flag.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Setting defaults and using Cray modules
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to use default compilers for each PrgEnv and also be able
to load cray external modules, you will need to set up a ``packages.yaml``.
Here's an example of an external configuration for cray modules:
.. code-block:: yaml
packages:
mpich:
externals:
- spec: "mpich@7.3.1%gcc@5.2.0 arch=cray_xc-haswell-CNL10"
modules:
- cray-mpich
- spec: "mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-haswell-CNL10"
modules:
- cray-mpich
all:
providers:
mpi: [mpich]
This tells Spack that for whatever package that depends on mpi, load the
cray-mpich module into the environment. You can then be able to use whatever
environment variables, libraries, etc, that are brought into the environment
via module load.
.. note::
For Cray-provided packages, it is best to use ``modules:`` instead of ``prefix:``
in ``packages.yaml``, because the Cray Programming Environment heavily relies on
modules (e.g., loading the ``cray-mpich`` module adds MPI libraries to the
compiler wrapper link line).
You can set the default compiler that Spack can use for each compiler type.
If you want to use the Cray defaults, then set them under ``all:`` in packages.yaml.
In the compiler field, set the compiler specs in your order of preference.
Whenever you build with that compiler type, Spack will concretize to that version.
Here is an example of a full packages.yaml used at NERSC
.. code-block:: yaml
packages:
mpich:
externals:
- spec: "mpich@7.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
modules:
- cray-mpich
- spec: "mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-SuSE11-ivybridge"
modules:
- cray-mpich
buildable: False
netcdf:
externals:
- spec: "netcdf@4.3.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
modules:
- cray-netcdf
- spec: "netcdf@4.3.3.1%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge"
modules:
- cray-netcdf
buildable: False
hdf5:
externals:
- spec: "hdf5@1.8.14%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
modules:
- cray-hdf5
- spec: "hdf5@1.8.14%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge"
modules:
- cray-hdf5
buildable: False
all:
compiler: [gcc@5.2.0, intel@16.0.0.109]
providers:
mpi: [mpich]
Here we tell spack that whenever we want to build with gcc use version 5.2.0 or
if we want to build with intel compilers, use version 16.0.0.109. We add a spec
for each compiler type for each cray modules. This ensures that for each
compiler on our system we can use that external module.
For more on external packages check out the section :ref:`sec-external-packages`.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using Linux containers on Cray machines
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Spack uses environment variables particular to the Cray programming
environment to determine which systems are Cray platforms. These
environment variables may be propagated into containers that are not
using the Cray programming environment.
To ensure that Spack does not autodetect the Cray programming
environment, unset the environment variable ``MODULEPATH``. This
will cause Spack to treat a linux container on a Cray system as a base
linux distro.
.. _windows_support:
----------------

View File

@@ -91,7 +91,7 @@
)
from spack.util.executable import Executable
from spack.util.log_parse import make_log_context, parse_log_events
from spack.util.module_cmd import load_module, module, path_from_modules
from spack.util.module_cmd import load_module, path_from_modules
#
# This can be set by the user to globally disable parallel builds.
@@ -190,14 +190,6 @@ def __call__(self, *args, **kwargs):
return super().__call__(*args, **kwargs)
def _on_cray():
host_platform = spack.platforms.host()
host_os = host_platform.operating_system("default_os")
on_cray = str(host_platform) == "cray"
using_cnl = re.match(r"cnl\d+", str(host_os))
return on_cray, using_cnl
def clean_environment():
# Stuff in here sanitizes the build environment to eliminate
# anything the user has set that may interfere. We apply it immediately
@@ -241,17 +233,6 @@ def clean_environment():
if varname.endswith("_ROOT") and varname != "SPACK_ROOT":
env.unset(varname)
# On Cray "cluster" systems, unset CRAY_LD_LIBRARY_PATH to avoid
# interference with Spack dependencies.
# CNL requires these variables to be set (or at least some of them,
# depending on the CNL version).
on_cray, using_cnl = _on_cray()
if on_cray and not using_cnl:
env.unset("CRAY_LD_LIBRARY_PATH")
for varname in os.environ.keys():
if "PKGCONF" in varname:
env.unset(varname)
# Unset the following variables because they can affect installation of
# Autotools and CMake packages.
build_system_vars = [
@@ -381,11 +362,7 @@ def set_compiler_environment_variables(pkg, env):
_add_werror_handling(keep_werror, env)
# Set the target parameters that the compiler will add
# Don't set on cray platform because the targeting module handles this
if spec.satisfies("platform=cray"):
isa_arg = ""
else:
isa_arg = spec.architecture.target.optimization_flags(compiler)
isa_arg = spec.architecture.target.optimization_flags(compiler)
env.set("SPACK_TARGET_ARGS", isa_arg)
# Trap spack-tracked compiler flags as appropriate.
@@ -833,14 +810,6 @@ def setup_package(pkg, dirty, context: Context = Context.BUILD):
for mod in pkg.compiler.modules:
load_module(mod)
# kludge to handle cray mpich and libsci being automatically loaded by
# PrgEnv modules on cray platform. Module unload does no damage when
# unnecessary
on_cray, _ = _on_cray()
if on_cray and not dirty:
for mod in ["cray-mpich", "cray-libsci"]:
module("unload", mod)
if target and target.module_name:
load_module(target.module_name)

View File

@@ -110,9 +110,8 @@ def cuda_flags(arch_list):
# From the NVIDIA install guide we know of conflicts for particular
# platforms (linux, darwin), architectures (x86, powerpc) and compilers
# (gcc, clang). We don't restrict %gcc and %clang conflicts to
# platform=linux, since they should also apply to platform=cray, and may
# apply to platform=darwin. We currently do not provide conflicts for
# platform=darwin with %apple-clang.
# platform=linux, since they may apply to platform=darwin. We currently
# do not provide conflicts for platform=darwin with %apple-clang.
# Linux x86_64 compiler conflicts from here:
# https://gist.github.com/ax3l/9489132

View File

@@ -937,32 +937,15 @@ def mpi_setup_dependent_build_environment(self, env, dependent_spec, compilers_o
"I_MPI_ROOT": self.normalize_path("mpi"),
}
# CAUTION - SIMILAR code in:
# var/spack/repos/builtin/packages/mpich/package.py
# var/spack/repos/builtin/packages/openmpi/package.py
# var/spack/repos/builtin/packages/mvapich2/package.py
#
# On Cray, the regular compiler wrappers *are* the MPI wrappers.
if "platform=cray" in self.spec:
# TODO: Confirm
wrapper_vars.update(
{
"MPICC": compilers_of_client["CC"],
"MPICXX": compilers_of_client["CXX"],
"MPIF77": compilers_of_client["F77"],
"MPIF90": compilers_of_client["F90"],
}
)
else:
compiler_wrapper_commands = self.mpi_compiler_wrappers
wrapper_vars.update(
{
"MPICC": compiler_wrapper_commands["MPICC"],
"MPICXX": compiler_wrapper_commands["MPICXX"],
"MPIF77": compiler_wrapper_commands["MPIF77"],
"MPIF90": compiler_wrapper_commands["MPIF90"],
}
)
compiler_wrapper_commands = self.mpi_compiler_wrappers
wrapper_vars.update(
{
"MPICC": compiler_wrapper_commands["MPICC"],
"MPICXX": compiler_wrapper_commands["MPICXX"],
"MPIF77": compiler_wrapper_commands["MPIF77"],
"MPIF90": compiler_wrapper_commands["MPIF90"],
}
)
# Ensure that the directory containing the compiler wrappers is in the
# PATH. Spack packages add `prefix.bin` to their dependents' paths,

View File

@@ -24,7 +24,6 @@ class MSBuildPackage(spack.package_base.PackageBase):
build_system("msbuild")
conflicts("platform=linux", when="build_system=msbuild")
conflicts("platform=darwin", when="build_system=msbuild")
conflicts("platform=cray", when="build_system=msbuild")
@spack.builder.builder("msbuild")

View File

@@ -24,7 +24,6 @@ class NMakePackage(spack.package_base.PackageBase):
build_system("nmake")
conflicts("platform=linux", when="build_system=nmake")
conflicts("platform=darwin", when="build_system=nmake")
conflicts("platform=cray", when="build_system=nmake")
@spack.builder.builder("nmake")

View File

@@ -36,9 +36,8 @@ class IntelOneApiPackage(Package):
"target=ppc64:",
"target=ppc64le:",
"target=aarch64:",
"platform=darwin:",
"platform=cray:",
"platform=windows:",
"platform=darwin",
"platform=windows",
]:
conflicts(c, msg="This package in only available for x86_64 and Linux")

View File

@@ -50,7 +50,7 @@
@B{++}, @r{--}, @r{~~}, @B{==} propagate variants to package dependencies
architecture variants:
@m{platform=platform} linux, darwin, cray, etc.
@m{platform=platform} linux, darwin, freebsd, windows
@m{os=operating_system} specific <operating_system>
@m{target=target} specific <target> processor
@m{arch=platform-os-target} shortcut for all three above

View File

@@ -695,10 +695,6 @@ def compiler_environment(self):
try:
# load modules and set env variables
for module in self.modules:
# On cray, mic-knl module cannot be loaded without cce module
# See: https://github.com/spack/spack/issues/3153
if os.environ.get("CRAY_CPU_TARGET") == "mic-knl":
spack.util.module_cmd.load_module("cce")
spack.util.module_cmd.load_module(module)
# apply other compiler environment changes

View File

@@ -140,7 +140,7 @@ def post_install(spec, explicit=None):
return
# Only enable on platforms using ELF.
if not spec.satisfies("platform=linux") and not spec.satisfies("platform=cray"):
if not spec.satisfies("platform=linux"):
return
# Disable this hook when bootstrapping, to avoid recursion.

View File

@@ -117,7 +117,7 @@ def post_install(spec, explicit=None):
return
# Only enable on platforms using ELF.
if not spec.satisfies("platform=linux") and not spec.satisfies("platform=cray"):
if not spec.satisfies("platform=linux"):
return
visit_directory_tree(spec.prefix, ElfFilesWithRPathVisitor())

View File

@@ -3,22 +3,12 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from ._operating_system import OperatingSystem
from .cray_backend import CrayBackend
from .cray_frontend import CrayFrontend
from .freebsd import FreeBSDOs
from .linux_distro import LinuxDistro
from .mac_os import MacOs
from .windows_os import WindowsOs
__all__ = [
"OperatingSystem",
"LinuxDistro",
"MacOs",
"CrayFrontend",
"CrayBackend",
"WindowsOs",
"FreeBSDOs",
]
__all__ = ["OperatingSystem", "LinuxDistro", "MacOs", "WindowsOs", "FreeBSDOs"]
#: List of all the Operating Systems known to Spack
operating_systems = [LinuxDistro, MacOs, CrayFrontend, CrayBackend, WindowsOs, FreeBSDOs]
operating_systems = [LinuxDistro, MacOs, WindowsOs, FreeBSDOs]

View File

@@ -1,172 +0,0 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import llnl.util.tty as tty
import spack.error
import spack.version
from spack.util.module_cmd import module
from .linux_distro import LinuxDistro
#: Possible locations of the Cray CLE release file,
#: which we look at to get the CNL OS version.
_cle_release_file = "/etc/opt/cray/release/cle-release"
_clerelease_file = "/etc/opt/cray/release/clerelease"
def read_cle_release_file():
"""Read the CLE release file and return a dict with its attributes.
This file is present on newer versions of Cray.
The release file looks something like this::
RELEASE=6.0.UP07
BUILD=6.0.7424
...
The dictionary we produce looks like this::
{
"RELEASE": "6.0.UP07",
"BUILD": "6.0.7424",
...
}
Returns:
dict: dictionary of release attributes
"""
with open(_cle_release_file) as release_file:
result = {}
for line in release_file:
# use partition instead of split() to ensure we only split on
# the first '=' in the line.
key, _, value = line.partition("=")
result[key] = value.strip()
return result
def read_clerelease_file():
"""Read the CLE release file and return the Cray OS version.
This file is present on older versions of Cray.
The release file looks something like this::
5.2.UP04
Returns:
str: the Cray OS version
"""
with open(_clerelease_file) as release_file:
for line in release_file:
return line.strip()
class CrayBackend(LinuxDistro):
"""Compute Node Linux (CNL) is the operating system used for the Cray XC
series super computers. It is a very stripped down version of GNU/Linux.
Any compilers found through this operating system will be used with
modules. If updated, user must make sure that version and name are
updated to indicate that OS has been upgraded (or downgraded)
"""
def __init__(self):
name = "cnl"
version = self._detect_crayos_version()
if version:
# If we found a CrayOS version, we do not want the information
# from LinuxDistro. In order to skip the logic from
# distro.linux_distribution, while still calling __init__
# methods further up the MRO, we skip LinuxDistro in the MRO and
# call the OperatingSystem superclass __init__ method
super(LinuxDistro, self).__init__(name, version)
else:
super().__init__()
self.modulecmd = module
def __str__(self):
return self.name + str(self.version)
@classmethod
def _detect_crayos_version(cls):
if os.path.isfile(_cle_release_file):
release_attrs = read_cle_release_file()
if "RELEASE" not in release_attrs:
# This Cray system uses a base OS not CLE/CNL
return None
v = spack.version.Version(release_attrs["RELEASE"])
return v[0]
elif os.path.isfile(_clerelease_file):
v = read_clerelease_file()
return spack.version.Version(v)[0]
else:
# Not all Cray systems run CNL on the backend.
# Systems running in what Cray calls "cluster" mode run other
# linux OSs under the Cray PE.
# So if we don't detect any Cray OS version on the system,
# we return None. We can't ever be sure we will get a Cray OS
# version.
# Returning None allows the calling code to test for the value
# being "True-ish" rather than requiring a try/except block.
return None
def arguments_to_detect_version_fn(self, paths):
import spack.compilers
command_arguments = []
for compiler_name in spack.compilers.supported_compilers():
cmp_cls = spack.compilers.class_for_compiler_name(compiler_name)
# If the compiler doesn't have a corresponding
# Programming Environment, skip to the next
if cmp_cls.PrgEnv is None:
continue
if cmp_cls.PrgEnv_compiler is None:
tty.die("Must supply PrgEnv_compiler with PrgEnv")
compiler_id = spack.compilers.CompilerID(self, compiler_name, None)
detect_version_args = spack.compilers.DetectVersionArgs(
id=compiler_id, variation=(None, None), language="cc", path="cc"
)
command_arguments.append(detect_version_args)
return command_arguments
def detect_version(self, detect_version_args):
import spack.compilers
modulecmd = self.modulecmd
compiler_name = detect_version_args.id.compiler_name
compiler_cls = spack.compilers.class_for_compiler_name(compiler_name)
output = modulecmd("avail", compiler_cls.PrgEnv_compiler)
version_regex = r"({0})/([\d\.]+[\d]-?[\w]*)".format(compiler_cls.PrgEnv_compiler)
matches = re.findall(version_regex, output)
version = tuple(version for _, version in matches if "classic" not in version)
compiler_id = detect_version_args.id
value = detect_version_args._replace(id=compiler_id._replace(version=version))
return value, None
def make_compilers(self, compiler_id, paths):
import spack.spec
name = compiler_id.compiler_name
cmp_cls = spack.compilers.class_for_compiler_name(name)
compilers = []
for v in compiler_id.version:
comp = cmp_cls(
spack.spec.CompilerSpec(name + "@=" + v),
self,
"any",
["cc", "CC", "ftn"],
[cmp_cls.PrgEnv, name + "/" + v],
)
compilers.append(comp)
return compilers

View File

@@ -1,105 +0,0 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import contextlib
import os
import re
import llnl.util.filesystem as fs
import llnl.util.lang
import llnl.util.tty as tty
from spack.util.environment import get_path
from spack.util.module_cmd import module
from .linux_distro import LinuxDistro
@contextlib.contextmanager
def unload_programming_environment():
"""Context manager that unloads Cray Programming Environments."""
env_bu = None
# We rely on the fact that the PrgEnv-* modules set the PE_ENV
# environment variable.
if "PE_ENV" in os.environ:
# Copy environment variables to restore them after the compiler
# detection. We expect that the only thing PrgEnv-* modules do is
# the environment variables modifications.
env_bu = os.environ.copy()
# Get the name of the module from the environment variable.
prg_env = "PrgEnv-" + os.environ["PE_ENV"].lower()
# Unload the PrgEnv-* module. By doing this we intentionally
# provoke errors when the Cray's compiler wrappers are executed
# (Error: A PrgEnv-* modulefile must be loaded.) so they will not
# be detected as valid compilers by the overridden method. We also
# expect that the modules that add the actual compilers' binaries
# into the PATH environment variable (i.e. the following modules:
# 'intel', 'cce', 'gcc', etc.) will also be unloaded since they are
# specified as prerequisites in the PrgEnv-* modulefiles.
module("unload", prg_env)
yield
# Restore the environment.
if env_bu is not None:
os.environ.clear()
os.environ.update(env_bu)
class CrayFrontend(LinuxDistro):
"""Represents OS that runs on login and service nodes of the Cray platform.
It acts as a regular Linux without Cray-specific modules and compiler
wrappers."""
@property
def compiler_search_paths(self):
"""Calls the default function but unloads Cray's programming
environments first.
This prevents from detecting Cray compiler wrappers and avoids
possible false detections.
"""
import spack.compilers
with unload_programming_environment():
search_paths = get_path("PATH")
extract_path_re = re.compile(r"prepend-path[\s]*PATH[\s]*([/\w\.:-]*)")
for compiler_cls in spack.compilers.all_compiler_types():
# Check if the compiler class is supported on Cray
prg_env = getattr(compiler_cls, "PrgEnv", None)
compiler_module = getattr(compiler_cls, "PrgEnv_compiler", None)
if not (prg_env and compiler_module):
continue
# It is supported, check which versions are available
output = module("avail", compiler_cls.PrgEnv_compiler)
version_regex = r"({0})/([\d\.]+[\d]-?[\w]*)".format(compiler_cls.PrgEnv_compiler)
matches = re.findall(version_regex, output)
versions = tuple(version for _, version in matches if "classic" not in version)
# Now inspect the modules and add to paths
msg = "[CRAY FE] Detected FE compiler [name={0}, versions={1}]"
tty.debug(msg.format(compiler_module, versions))
for v in versions:
try:
current_module = compiler_module + "/" + v
out = module("show", current_module)
match = extract_path_re.search(out)
search_paths += match.group(1).split(":")
except Exception as e:
msg = (
"[CRAY FE] An unexpected error occurred while "
"detecting FE compiler [compiler={0}, "
" version={1}, error={2}]"
)
tty.debug(msg.format(compiler_cls.name, v, str(e)))
search_paths = list(llnl.util.lang.dedupe(search_paths))
return fs.search_paths_for_executables(*search_paths)

View File

@@ -6,7 +6,6 @@
from ._functions import _host, by_name, platforms, prevent_cray_detection, reset
from ._platform import Platform
from .cray import Cray
from .darwin import Darwin
from .freebsd import FreeBSD
from .linux import Linux
@@ -15,7 +14,6 @@
__all__ = [
"Platform",
"Cray",
"Darwin",
"Linux",
"FreeBSD",

View File

@@ -8,7 +8,6 @@
import spack.util.environment
from .cray import Cray
from .darwin import Darwin
from .freebsd import FreeBSD
from .linux import Linux
@@ -16,7 +15,7 @@
from .windows import Windows
#: List of all the platform classes known to Spack
platforms = [Cray, Darwin, Linux, Windows, FreeBSD, Test]
platforms = [Darwin, Linux, Windows, FreeBSD, Test]
@llnl.util.lang.memoized

View File

@@ -2,254 +2,10 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import os.path
import platform
import re
import archspec.cpu
import llnl.util.tty as tty
from llnl.util.symlink import readlink
import spack.target
import spack.version
from spack.operating_systems.cray_backend import CrayBackend
from spack.operating_systems.cray_frontend import CrayFrontend
from spack.paths import build_env_path
from spack.util.executable import Executable
from spack.util.module_cmd import module
from ._platform import NoPlatformError, Platform
_craype_name_to_target_name = {
"x86-cascadelake": "cascadelake",
"x86-naples": "zen",
"x86-rome": "zen2",
"x86-milan": "zen3",
"x86-skylake": "skylake_avx512",
"mic-knl": "mic_knl",
"interlagos": "bulldozer",
"abudhabi": "piledriver",
}
_ex_craype_dir = "/opt/cray/pe/cpe"
_xc_craype_dir = "/opt/cray/pe/cdt"
def slingshot_network():
return os.path.exists("/opt/cray/pe") and (
os.path.exists("/lib64/libcxi.so") or os.path.exists("/usr/lib64/libcxi.so")
)
def _target_name_from_craype_target_name(name):
return _craype_name_to_target_name.get(name, name)
class Cray(Platform):
priority = 10
def __init__(self):
"""Create a Cray system platform.
Target names should use craype target names but not include the
'craype-' prefix. Uses first viable target from:
self
envars [SPACK_FRONT_END, SPACK_BACK_END]
configuration file "targets.yaml" with keys 'front_end', 'back_end'
scanning /etc/bash/bashrc.local for back_end only
"""
super().__init__("cray")
# Make all craype targets available.
for target in self._avail_targets():
name = _target_name_from_craype_target_name(target)
self.add_target(name, spack.target.Target(name, "craype-%s" % target))
self.back_end = os.environ.get("SPACK_BACK_END", self._default_target_from_env())
self.default = self.back_end
if self.back_end not in self.targets:
# We didn't find a target module for the backend
raise NoPlatformError()
# Setup frontend targets
for name in archspec.cpu.TARGETS:
if name not in self.targets:
self.add_target(name, spack.target.Target(name))
self.front_end = os.environ.get("SPACK_FRONT_END", archspec.cpu.host().name)
if self.front_end not in self.targets:
self.add_target(self.front_end, spack.target.Target(self.front_end))
front_distro = CrayFrontend()
back_distro = CrayBackend()
self.default_os = str(back_distro)
self.back_os = self.default_os
self.front_os = str(front_distro)
self.add_operating_system(self.back_os, back_distro)
if self.front_os != self.back_os:
self.add_operating_system(self.front_os, front_distro)
def setup_platform_environment(self, pkg, env):
"""Change the linker to default dynamic to be more
similar to linux/standard linker behavior
"""
# Unload these modules to prevent any silent linking or unnecessary
# I/O profiling in the case of darshan.
modules_to_unload = ["cray-mpich", "darshan", "cray-libsci", "altd"]
for mod in modules_to_unload:
module("unload", mod)
env.set("CRAYPE_LINK_TYPE", "dynamic")
cray_wrapper_names = os.path.join(build_env_path, "cray")
if os.path.isdir(cray_wrapper_names):
env.prepend_path("PATH", cray_wrapper_names)
env.prepend_path("SPACK_ENV_PATH", cray_wrapper_names)
# Makes spack installed pkg-config work on Crays
env.append_path("PKG_CONFIG_PATH", "/usr/lib64/pkgconfig")
env.append_path("PKG_CONFIG_PATH", "/usr/local/lib64/pkgconfig")
# CRAY_LD_LIBRARY_PATH is used at build time by the cray compiler
# wrappers to augment LD_LIBRARY_PATH. This is to avoid long load
# times at runtime. This behavior is not always respected on cray
# "cluster" systems, so we reproduce it here.
if os.environ.get("CRAY_LD_LIBRARY_PATH"):
env.prepend_path("LD_LIBRARY_PATH", os.environ["CRAY_LD_LIBRARY_PATH"])
@classmethod
def craype_type_and_version(cls):
if os.path.isdir(_ex_craype_dir):
craype_dir = _ex_craype_dir
craype_type = "EX"
elif os.path.isdir(_xc_craype_dir):
craype_dir = _xc_craype_dir
craype_type = "XC"
else:
return (None, None)
# Take the default version from known symlink path
default_path = os.path.join(craype_dir, "default")
if os.path.islink(default_path):
version = spack.version.Version(readlink(default_path))
return (craype_type, version)
# If no default version, sort available versions and return latest
versions_available = [spack.version.Version(v) for v in os.listdir(craype_dir)]
versions_available.sort(reverse=True)
if not versions_available:
return (craype_type, None)
return (craype_type, versions_available[0])
@classmethod
def detect(cls):
"""
Detect whether this system requires CrayPE module support.
Systems with newer CrayPE (21.10 for EX systems, future work for CS and
XC systems) have compilers and MPI wrappers that can be used directly
by path. These systems are considered ``linux`` platforms.
For systems running an older CrayPE, we detect the Cray platform based
on the availability through `module` of the Cray programming
environment. If this environment is available, we can use it to find
compilers, target modules, etc. If the Cray programming environment is
not available via modules, then we will treat it as a standard linux
system, as the Cray compiler wrappers and other components of the Cray
programming environment are irrelevant without module support.
"""
if "opt/cray" not in os.environ.get("MODULEPATH", ""):
return False
craype_type, craype_version = cls.craype_type_and_version()
if craype_type == "XC":
return True
if craype_type == "EX" and craype_version < spack.version.Version("21.10"):
return True
return False
def _default_target_from_env(self):
"""Set and return the default CrayPE target loaded in a clean login
session.
A bash subshell is launched with a wiped environment and the list of
loaded modules is parsed for the first acceptable CrayPE target.
"""
# env -i /bin/bash -lc echo $CRAY_CPU_TARGET 2> /dev/null
if getattr(self, "default", None) is None:
bash = Executable("/bin/bash")
output = bash(
"--norc",
"--noprofile",
"-lc",
"echo $CRAY_CPU_TARGET",
env={"TERM": os.environ.get("TERM", "")},
output=str,
error=os.devnull,
)
default_from_module = "".join(output.split()) # rm all whitespace
if default_from_module:
tty.debug("Found default module:%s" % default_from_module)
return default_from_module
else:
front_end = archspec.cpu.host()
# Look for the frontend architecture or closest ancestor
# available in cray target modules
avail = [_target_name_from_craype_target_name(x) for x in self._avail_targets()]
for front_end_possibility in [front_end] + front_end.ancestors:
if front_end_possibility.name in avail:
tty.debug("using front-end architecture or available ancestor")
return front_end_possibility.name
else:
tty.debug("using platform.machine as default")
return platform.machine()
def _avail_targets(self):
"""Return a list of available CrayPE CPU targets."""
def modules_in_output(output):
"""Returns a list of valid modules parsed from modulecmd output"""
return [i for i in re.split(r"\s\s+|\n", output)]
def target_names_from_modules(modules):
# Craype- module prefixes that are not valid CPU targets.
targets = []
for mod in modules:
if "craype-" in mod:
name = mod[7:]
name = name.split()[0]
_n = name.replace("-", "_") # test for mic-knl/mic_knl
is_target_name = name in archspec.cpu.TARGETS or _n in archspec.cpu.TARGETS
is_cray_target_name = name in _craype_name_to_target_name
if is_target_name or is_cray_target_name:
targets.append(name)
return targets
def modules_from_listdir():
craype_default_path = "/opt/cray/pe/craype/default/modulefiles"
if os.path.isdir(craype_default_path):
return os.listdir(craype_default_path)
return []
if getattr(self, "_craype_targets", None) is None:
strategies = [
lambda: modules_in_output(module("avail", "-t", "craype-")),
modules_from_listdir,
]
for available_craype_modules in strategies:
craype_modules = available_craype_modules()
craype_targets = target_names_from_modules(craype_modules)
if craype_targets:
self._craype_targets = craype_targets
break
else:
# If nothing is found add platform.machine()
# to avoid Spack erroring out
self._craype_targets = [platform.machine()]
return self._craype_targets

View File

@@ -3799,12 +3799,6 @@ class Solver:
def __init__(self):
self.driver = PyclingoDriver()
self.selector = ReusableSpecsSelector(configuration=spack.config.CONFIG)
if spack.platforms.host().name == "cray":
msg = (
"The Cray platform, i.e. 'platform=cray', will be removed in Spack v0.23. "
"All Cray machines will be then detected as 'platform=linux'."
)
warnings.warn(msg)
@staticmethod
def _check_input_and_extract_concrete_specs(specs):

View File

@@ -2816,9 +2816,7 @@ def _old_concretize(self, tests=False, deprecation_warning=True):
# Check if we can produce an optimized binary (will throw if
# there are declared inconsistencies)
# No need on platform=cray because of the targeting modules
if not self.satisfies("platform=cray"):
self.architecture.target.optimization_flags(self.compiler)
self.architecture.target.optimization_flags(self.compiler)
def _patches_assigned(self):
"""Whether patches have been assigned to this spec by the concretizer."""

View File

@@ -2,16 +2,12 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import platform
import sys
import pytest
import archspec.cpu
import llnl.util.filesystem as fs
import spack.compilers
import spack.concretize
import spack.operating_systems
@@ -25,9 +21,8 @@ def current_host_platform():
"""Return the platform of the current host as detected by the
'platform' stdlib package.
"""
if os.path.exists("/opt/cray/pe"):
current_platform = spack.platforms.Cray()
elif "Linux" in platform.system():
current_platform = None
if "Linux" in platform.system():
current_platform = spack.platforms.Linux()
elif "Darwin" in platform.system():
current_platform = spack.platforms.Darwin()
@@ -222,28 +217,3 @@ def test_concretize_target_ranges(root_target_range, dep_target_range, result, m
with spack.concretize.disable_compiler_existence_check():
spec.concretize()
assert spec.target == spec["b"].target == result
@pytest.mark.parametrize(
"versions,default,expected",
[
(["21.11", "21.9"], "21.11", False),
(["21.11", "21.9"], "21.9", True),
(["21.11", "21.9"], None, False),
],
)
@pytest.mark.skipif(sys.platform == "win32", reason="Cray does not use windows")
def test_cray_platform_detection(versions, default, expected, tmpdir, monkeypatch, working_env):
ex_path = str(tmpdir.join("fake_craype_dir"))
fs.mkdirp(ex_path)
with fs.working_dir(ex_path):
for version in versions:
fs.touch(version)
if default:
os.symlink(default, "default")
monkeypatch.setattr(spack.platforms.cray, "_ex_craype_dir", ex_path)
os.environ["MODULEPATH"] = "/opt/cray/pe"
assert spack.platforms.cray.Cray.detect() == expected

View File

@@ -556,24 +556,6 @@ def test_build_jobs_defaults():
)
def test_dirty_disable_module_unload(config, mock_packages, working_env, mock_module_cmd):
"""Test that on CRAY platform 'module unload' is not called if the 'dirty'
option is on.
"""
s = spack.spec.Spec("a").concretized()
# If called with "dirty" we don't unload modules, so no calls to the
# `module` function on Cray
spack.build_environment.setup_package(s.package, dirty=True)
assert not mock_module_cmd.calls
# If called without "dirty" we unload modules on Cray
spack.build_environment.setup_package(s.package, dirty=False)
assert mock_module_cmd.calls
assert any(("unload", "cray-libsci") == item[0] for item in mock_module_cmd.calls)
assert any(("unload", "cray-mpich") == item[0] for item in mock_module_cmd.calls)
class TestModuleMonkeyPatcher:
def test_getting_attributes(self, default_mock_concretization):
s = default_mock_concretization("libelf")

View File

@@ -125,18 +125,8 @@ def print_spack_cc(*args):
print(os.environ.get("CC", ""))
# `module unload cray-libsci` in test environment causes failure
# It does not fail for actual installs
# build_environment.py imports module directly, so we monkeypatch it there
# rather than in module_cmd
def mock_module_noop(*args):
pass
def test_dev_build_drop_in(tmpdir, mock_packages, monkeypatch, install_mockery, working_env):
monkeypatch.setattr(os, "execvp", print_spack_cc)
monkeypatch.setattr(spack.build_environment, "module", mock_module_noop)
with tmpdir.as_cwd():
output = dev_build("-b", "edit", "--drop-in", "sh", "dev-build-test-install@0.0.0")
assert "lib/spack/env" in output

View File

@@ -3,12 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Test detection of compiler version"""
import os
import pytest
import llnl.util.filesystem as fs
import spack.compilers.aocc
import spack.compilers.arm
import spack.compilers.cce
@@ -23,7 +19,6 @@
import spack.compilers.xl
import spack.compilers.xl_r
import spack.util.module_cmd
from spack.operating_systems.cray_frontend import CrayFrontend
@pytest.mark.parametrize(
@@ -413,48 +408,6 @@ def test_xl_version_detection(version_str, expected_version):
assert version == expected_version
@pytest.mark.not_on_windows("Not supported on Windows (yet)")
@pytest.mark.parametrize(
"compiler,version",
[
("gcc", "8.1.0"),
("gcc", "1.0.0-foo"),
("pgi", "19.1"),
("pgi", "19.1a"),
("intel", "9.0.0"),
("intel", "0.0.0-foobar"),
# ('oneapi', '2021.1'),
# ('oneapi', '2021.1-foobar')
],
)
def test_cray_frontend_compiler_detection(compiler, version, tmpdir, monkeypatch, working_env):
"""Test that the Cray frontend properly finds compilers form modules"""
# setup the fake compiler directory
compiler_dir = tmpdir.join(compiler)
compiler_exe = compiler_dir.join("cc").ensure()
fs.set_executable(str(compiler_exe))
# mock modules
def _module(cmd, *args):
module_name = "%s/%s" % (compiler, version)
module_contents = "prepend-path PATH %s" % compiler_dir
if cmd == "avail":
return module_name if compiler in args[0] else ""
if cmd == "show":
return module_contents if module_name in args else ""
monkeypatch.setattr(spack.operating_systems.cray_frontend, "module", _module)
# remove PATH variable
os.environ.pop("PATH", None)
# get a CrayFrontend object
cray_fe_os = CrayFrontend()
paths = cray_fe_os.compiler_search_paths
assert paths == [str(compiler_dir)]
@pytest.mark.parametrize(
"version_str,expected_version",
[

View File

@@ -1,77 +0,0 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.operating_systems.cray_backend as cray_backend
def test_read_cle_release_file(tmpdir, monkeypatch):
"""test reading the Cray cle-release file"""
cle_release_path = tmpdir.join("cle-release")
with cle_release_path.open("w") as f:
f.write(
"""\
RELEASE=6.0.UP07
BUILD=6.0.7424
DATE=20190611
ARCH=noarch
NETWORK=ari
PATCHSET=35-201906112304
DUMMY=foo=bar
"""
)
monkeypatch.setattr(cray_backend, "_cle_release_file", str(cle_release_path))
attrs = cray_backend.read_cle_release_file()
assert attrs["RELEASE"] == "6.0.UP07"
assert attrs["BUILD"] == "6.0.7424"
assert attrs["DATE"] == "20190611"
assert attrs["ARCH"] == "noarch"
assert attrs["NETWORK"] == "ari"
assert attrs["PATCHSET"] == "35-201906112304"
assert attrs["DUMMY"] == "foo=bar"
assert cray_backend.CrayBackend._detect_crayos_version() == 6
def test_read_clerelease_file(tmpdir, monkeypatch):
"""test reading the Cray clerelease file"""
clerelease_path = tmpdir.join("clerelease")
with clerelease_path.open("w") as f:
f.write("5.2.UP04\n")
monkeypatch.setattr(cray_backend, "_clerelease_file", str(clerelease_path))
v = cray_backend.read_clerelease_file()
assert v == "5.2.UP04"
assert cray_backend.CrayBackend._detect_crayos_version() == 5
def test_cle_release_precedence(tmpdir, monkeypatch):
"""test that cle-release file takes precedence over clerelease file."""
cle_release_path = tmpdir.join("cle-release")
clerelease_path = tmpdir.join("clerelease")
with cle_release_path.open("w") as f:
f.write(
"""\
RELEASE=6.0.UP07
BUILD=6.0.7424
DATE=20190611
ARCH=noarch
NETWORK=ari
PATCHSET=35-201906112304
DUMMY=foo=bar
"""
)
with clerelease_path.open("w") as f:
f.write("5.2.UP04\n")
monkeypatch.setattr(cray_backend, "_clerelease_file", str(clerelease_path))
monkeypatch.setattr(cray_backend, "_cle_release_file", str(cle_release_path))
assert cray_backend.CrayBackend._detect_crayos_version() == 6

View File

@@ -37,7 +37,6 @@ class _7zip(SourceforgePackage, Package):
conflicts("platform=linux")
conflicts("platform=darwin")
conflicts("platform=cray")
# TODO: Patch on WinSDK version 10.0.20348.0 when SDK is introduced to Spack
# This patch solves a known bug in that SDK version on the 7zip side

View File

@@ -149,7 +149,7 @@ class Adios2(CMakePackage, CudaPackage, ROCmPackage):
conflicts("+rocm", when="~kokkos", msg="ADIOS2 does not support HIP without Kokkos")
conflicts("+sycl", when="~kokkos", msg="ADIOS2 does not support SYCL without Kokkos")
for _platform in ["linux", "darwin", "cray"]:
for _platform in ["linux", "darwin"]:
depends_on("pkgconfig", type="build", when=f"platform={_platform}")
variant(
"pic",

View File

@@ -143,7 +143,6 @@ class Amber(Package, CudaPackage):
depends_on("cuda@7.5.18", when="@:16+cuda")
# conflicts
conflicts("+x11", when="platform=cray", msg="x11 amber applications not available for cray")
conflicts("+openmp", when="%clang", msg="OpenMP not available for the clang compiler")
conflicts(
"+openmp", when="%apple-clang", msg="OpenMP not available for the Apple clang compiler"

View File

@@ -19,7 +19,6 @@ class AppleLibunwind(Package):
# Darwin must be expressed by listing a conflict with every
# platform that isn't Darwin/macOS
conflicts("platform=linux")
conflicts("platform=cray")
# Override the fetcher method to throw a useful error message;
# avoids GitHub issue (#7061) in which the opengl placeholder

View File

@@ -17,7 +17,6 @@ class AppleLibuuid(BundlePackage):
# Only supported on 'platform=darwin'
conflicts("platform=linux")
conflicts("platform=cray")
conflicts("platform=windows")
@property

View File

@@ -100,9 +100,6 @@ def cmake_args(self):
args.append(self.define_from_variant("ENABLE_IBM_BBAPI", "bbapi"))
args.append(self.define_from_variant("ENABLE_CRAY_DW", "dw"))
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("AXL_LINK_STATIC", True))
if spec.satisfies("@0.6.0:"):
args.append(self.define_from_variant("ENABLE_PTHREADS", "pthreads"))

View File

@@ -238,7 +238,7 @@ def test_binaries(self):
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
def configure_args(self):
known_targets = {"x86_64": "x86_64", "aarch64": "aarch64", "ppc64le": "powerpc"}
known_platforms = {"linux": "linux-gnu", "cray": "linux-gnu", "darwin": "apple-darwin"}
known_platforms = {"linux": "linux-gnu", "darwin": "apple-darwin"}
family = str(self.spec.target.family)
platform = self.spec.platform

View File

@@ -1,33 +0,0 @@
Remove the spack wrapper directories from PATH for the bootstrap step.
This was breaking the build for Cray (and other cross-compile) because
bjam was built for the BE and died on SIGILL on the FE. See issue
#9613.
This only affects building bjam. The boost libraries are still built
the normal spack way with the spack wrappers.
diff -Naurb boost_1_66_0.orig/bootstrap.sh boost_1_66_0/bootstrap.sh
--- boost_1_66_0.orig/bootstrap.sh 2017-12-13 17:56:35.000000000 -0600
+++ boost_1_66_0/bootstrap.sh 2019-01-09 13:51:56.407553214 -0600
@@ -7,6 +7,20 @@
# boostinspect:notab - Tabs are required for the Makefile.
+NEWPATH=
+OLDIFS="$IFS"
+IFS=:
+
+for dir in $PATH ; do
+ case "x$dir" in
+ *lib*spack*env* ) ;;
+ * ) NEWPATH="${NEWPATH}:${dir}" ;;
+ esac
+done
+
+IFS="$OLDIFS"
+PATH="$NEWPATH"
+
BJAM=""
TOOLSET=""
BJAM_CONFIG=""

View File

@@ -342,9 +342,6 @@ def libs(self):
# Patch: https://github.com/boostorg/process/commit/6a4d2ff72114ef47c7afaf92e1042aca3dfa41b0.patch
patch("1.72_boost_process.patch", level=2, when="@1.72.0")
# Fix the bootstrap/bjam build for Cray
patch("bootstrap-path.patch", when="@1.39.0: platform=cray")
# Patch fix for warnings from commits 2d37749, af1dc84, c705bab, and
# 0134441 on https://github.com/boostorg/system.
patch("system-non-virtual-dtor-include.patch", when="@1.69.0", level=2)
@@ -528,10 +525,6 @@ def determine_bootstrap_options(self, spec, with_libs, options):
# wrappers. Since Boost doesn't use the MPI C++ bindings,
# that can be used as a compiler option instead.
mpi_line = "using mpi : %s" % spec["mpi"].mpicxx
if "platform=cray" in spec:
mpi_line += " : <define>MPICH_SKIP_MPICXX"
f.write(mpi_line + " ;\n")
if "+python" in spec:

View File

@@ -47,7 +47,6 @@ class Bzip2(Package, SourcewarePackage):
depends_on("diffutils", type="build")
depends_on("gmake", type="build", when="platform=linux")
depends_on("gmake", type="build", when="platform=cray")
depends_on("gmake", type="build", when="platform=darwin")
@classmethod

View File

@@ -58,12 +58,6 @@ class ClingoBootstrap(Clingo):
when="platform=linux",
msg="GCC or clang are required to bootstrap clingo on Linux",
)
requires(
"%gcc",
"%clang",
when="platform=cray",
msg="GCC or clang are required to bootstrap clingo on Cray",
)
conflicts("%gcc@:5", msg="C++14 support is required to bootstrap clingo")
# On Darwin we bootstrap with Apple Clang

View File

@@ -53,7 +53,6 @@ class Clingo(CMakePackage):
depends_on("bison@2.5:", type="build", when="platform=linux")
depends_on("bison@2.5:", type="build", when="platform=darwin")
depends_on("bison@2.5:", type="build", when="platform=freebsd")
depends_on("bison@2.5:", type="build", when="platform=cray")
with when("platform=windows"):
depends_on("re2c@0.13:", type="build")
@@ -67,7 +66,6 @@ class Clingo(CMakePackage):
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=linux")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=darwin")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=freebsd")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=cray")
patch("python38.patch", when="@5.3:5.4.0")
patch("size-t.patch", when="%msvc")

View File

@@ -422,7 +422,6 @@ class Cmake(Package):
depends_on("ninja", when="platform=windows")
depends_on("gmake", when="platform=linux")
depends_on("gmake", when="platform=darwin")
depends_on("gmake", when="platform=cray")
depends_on("gmake", when="platform=freebsd")
# We default ownlibs to true because it greatly speeds up the CMake
@@ -469,7 +468,7 @@ class Cmake(Package):
with when("~ownlibs"):
depends_on("expat")
# expat/zlib are used in CMake/CTest, so why not require them in libarchive.
for plat in ["darwin", "cray", "linux"]:
for plat in ["darwin", "linux"]:
with when("platform=%s" % plat):
depends_on("libarchive@3.1.0: xar=expat compression=zlib")
depends_on("libarchive@3.3.3:", when="@3.15.0:")

View File

@@ -281,7 +281,7 @@ class Curl(NMakePackage, AutotoolsPackage):
variant("librtmp", default=False, description="enable Rtmp support")
variant("ldap", default=False, description="enable ldap support")
variant("libidn2", default=False, description="enable libidn2 support")
for plat in ["darwin", "cray", "linux"]:
for plat in ["darwin", "linux"]:
with when("platform=%s" % plat):
# curl queries pkgconfig for openssl compilation flags
depends_on("pkgconfig", type="build")
@@ -293,7 +293,6 @@ class Curl(NMakePackage, AutotoolsPackage):
description="Build shared libs, static libs or both",
)
conflicts("platform=cray", when="tls=secure_transport", msg="Only supported on macOS")
conflicts("platform=linux", when="tls=secure_transport", msg="Only supported on macOS")
depends_on("gnutls", when="tls=gnutls")

View File

@@ -257,13 +257,6 @@ def initconfig_compiler_entries(self):
entries.append(cmake_cache_string("CMAKE_CXX_STANDARD", "17"))
entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec))
entries.append(cmake_cache_option("CMAKE_EXPORT_COMPILE_COMMANDS", True))
# It's possible this should have a `if "platform=cray" in
# spec:` in front of it, but it's not clear to me when this is
# set. In particular, I don't actually see this blurb showing
# up on Tioga builds. Which is causing the obvious problem
# (namely, the one this was added to supposedly solve in the
# first place.
entries.append(cmake_cache_option("MPI_ASSUME_NO_BUILTIN_MPI", True))
if spec.satisfies("%clang +distconv platform=darwin"):

View File

@@ -65,8 +65,5 @@ def cmake_args(self):
if spec.satisfies("@0.1.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("ER_LINK_STATIC", True))
return args

View File

@@ -26,8 +26,6 @@ class Filo(CMakePackage):
def cmake_args(self):
args = []
args.append("-DMPI_C_COMPILER=%s" % self.spec["mpi"].mpicc)
if self.spec.satisfies("platform=cray"):
args.append("-DFILO_LINK_STATIC=ON")
args.append("-DWITH_AXL_PREFIX=%s" % self.spec["axl"].prefix)
args.append("-DWITH_KVTREE_PREFIX=%s" % self.spec["kvtree"].prefix)
args.append("-DWITH_SPATH_PREFIX=%s" % self.spec["spath"].prefix)

View File

@@ -221,7 +221,6 @@ class FontUtil(AutotoolsPackage, XorgPackage):
when="fonts=" + f,
)
conflicts("fonts=font-bh-ttf", when="platform=cray")
conflicts("fonts=font-bh-ttf", when="arch=linux-rhel7-broadwell")
if f != "font-bh-ttf":

View File

@@ -27,16 +27,12 @@ class Freeglut(CMakePackage, SourceforgePackage):
# FreeGLUT does not support OSMesa
conflicts("^osmesa")
# FreeGLUT only works with GLX on linux (cray is also linux)
# FreeGLUT only works with GLX on linux
with when("platform=linux"):
depends_on("glx")
depends_on("libx11")
depends_on("libxi")
depends_on("libxxf86vm")
with when("platform=cray"):
depends_on("glx")
depends_on("libx11")
depends_on("libxi")
# freeglut 3.2.1 fails to build with -fno-common (default with newer compilers)
# see https://bugs.gentoo.org/705840 and https://github.com/dcnieho/FreeGLUT/pull/76

View File

@@ -44,7 +44,7 @@ class Freetype(AutotoolsPackage, CMakePackage):
depends_on("bzip2")
depends_on("libpng")
for plat in ["linux", "darwin", "cray"]:
for plat in ["linux", "darwin"]:
depends_on("pkgconfig", type="build", when="platform=%s" % plat)
conflicts(

View File

@@ -54,10 +54,9 @@ class GccRuntime(Package):
provides("libgfortran@5", when="%gcc@8:")
depends_on("libc", type="link", when="platform=linux")
depends_on("libc", type="link", when="platform=cray")
def install(self, spec, prefix):
if spec.platform in ["linux", "cray", "freebsd"]:
if spec.platform in ["linux", "freebsd"]:
libraries = get_elf_libraries(compiler=self.compiler, libraries=self.LIBRARIES)
elif spec.platform == "darwin":
libraries = self._get_libraries_macho()

View File

@@ -558,10 +558,8 @@ def filter_detected_exes(cls, prefix, exes_in_prefix):
]
if any(x in basename for x in substring_to_be_filtered):
continue
# Filter out links in favor of real executables on
# all systems but Cray
host_platform = str(spack.platforms.host())
if os.path.islink(exe) and host_platform != "cray":
# Filter out links in favor of real executables
if os.path.islink(exe):
continue
result.append(exe)

View File

@@ -56,7 +56,6 @@ class GdkPixbuf(Package):
depends_on("meson@0.45.0:", type="build", when="@2.37.0:")
depends_on("ninja", type="build", when="@2.37.0:")
depends_on("shared-mime-info", when="@2.36.8: platform=linux")
depends_on("shared-mime-info", when="@2.36.8: platform=cray")
depends_on("pkgconfig", type="build")
# Building the man pages requires libxslt and the Docbook stylesheets
depends_on("libxslt", type="build", when="+man")

View File

@@ -6,6 +6,7 @@
import os
import re
import shutil
import sys
import llnl.util.lang
import llnl.util.tty as tty
@@ -122,7 +123,7 @@ class Hdf5(CMakePackage):
# The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'.
# Skip this on Windows since pkgconfig is autotools
for plat in ["cray", "darwin", "linux"]:
for plat in ["darwin", "linux"]:
depends_on("pkgconfig", when=f"platform={plat}", type="run")
conflicts("+mpi", "^mpich@4.0:4.0.3")
@@ -274,9 +275,13 @@ def patch(self):
# The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI
# compiler wrappers and do not need to be changed.
filter_compiler_wrappers(
"h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin"
)
# These do not exist on Windows.
# Enable only for supported target platforms.
if sys.platform != "win32":
filter_compiler_wrappers(
"h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin"
)
def url_for_version(self, version):
url = (

View File

@@ -188,11 +188,6 @@ def install(self, spec, prefix):
file.write("open " + app_dir + "\n")
os.chmod(viewer_file, 0o755)
# Install for Cray front-end is the same as Linux.
@when("platform=cray")
def install(self, spec, prefix):
self.linux_install(spec, prefix)
@when("platform=linux")
def install(self, spec, prefix):
self.linux_install(spec, prefix)

View File

@@ -92,8 +92,8 @@ class IntelGtpin(Package):
depends_on("patchelf", type="build")
# Gtpin only runs on linux/cray x86_64.
conflicts("platform=darwin", msg="intel-gtpin only runs on linux/cray")
# Gtpin only runs on linux x86_64.
conflicts("platform=darwin", msg="intel-gtpin only runs on linux")
conflicts("target=ppc64:", msg="intel-gtpin only runs on x86_64")
conflicts("target=ppc64le:", msg="intel-gtpin only runs on x86_64")
conflicts("target=aarch64:", msg="intel-gtpin only runs on x86_64")

View File

@@ -46,7 +46,6 @@ class IntelOneapiRuntime(Package):
conflicts("platform=darwin", msg="IntelOneAPI can only be installed on Linux, and FreeBSD")
depends_on("libc", type="link", when="platform=linux")
depends_on("libc", type="link", when="platform=cray")
def install(self, spec, prefix):
libraries = get_elf_libraries(compiler=self.compiler, libraries=self.LIBRARIES)

View File

@@ -274,7 +274,7 @@ def patch(self):
def setup_build_environment(self, env):
# this is a bit ridiculous, but we are setting runtime linker paths to
# dependencies so that libwhich can locate them.
if self.spec.satisfies("platform=linux") or self.spec.satisfies("platform=cray"):
if self.spec.satisfies("platform=linux"):
linker_var = "LD_LIBRARY_PATH"
elif self.spec.satisfies("platform=darwin"):
linker_var = "DYLD_FALLBACK_LIBRARY_PATH"

View File

@@ -60,8 +60,5 @@ def cmake_args(self):
if spec.satisfies("@1.2.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("KVTREE_LINK_STATIC", True))
return args

View File

@@ -357,10 +357,6 @@ def initconfig_hardware_entries(self):
cmake_cache_string("CMAKE_CUDA_FLAGS", "-allow-unsupported-compiler")
)
if "+rocm" in spec:
if "platform=cray" in spec:
entries.append(cmake_cache_option("MPI_ASSUME_NO_BUILTIN_MPI", True))
return entries
def initconfig_package_entries(self):

View File

@@ -40,7 +40,6 @@ class Ldak(Package):
policy="one_of",
msg="Only mkl or openblas are supported for blas/lapack with ldak",
)
conflicts("platform=cray", when="~glpk", msg="bundled qsopt only for linux or mac")
phases = ["build", "install"]

View File

@@ -90,7 +90,6 @@ class Libgit2(CMakePackage):
# Runtime Dependencies
depends_on("libssh2", when="+ssh")
depends_on("openssl", when="https=system platform=linux")
depends_on("openssl", when="https=system platform=cray")
depends_on("openssl", when="https=openssl")
depends_on("curl", when="+curl")
depends_on("pcre", when="@0.99:")
@@ -105,7 +104,7 @@ def flag_handler(self, name, flags):
def cmake_args(self):
args = []
if "https=system" in self.spec:
if "platform=linux" in self.spec or "platform=cray" in self.spec:
if "platform=linux" in self.spec:
args.append("-DUSE_HTTPS=OpenSSL")
elif "platform=darwin" in self.spec:
args.append("-DUSE_HTTPS=SecureTransport")

View File

@@ -24,7 +24,6 @@ class Libice(AutotoolsPackage, XorgPackage):
# technically libbsd is only required when glibc < 2.36 which provides arc4random_buf,
# but spack doesn't currently have a good way to model this so we depend on it unconditionally
depends_on("libbsd", when="platform=linux")
depends_on("libbsd", when="platform=cray")
depends_on("xproto")
depends_on("xtrans")

View File

@@ -22,5 +22,5 @@ class Liburing(AutotoolsPackage):
version("master", branch="master")
version("2.3", sha256="60b367dbdc6f2b0418a6e0cd203ee0049d9d629a36706fcf91dfb9428bae23c8")
conflicts("platform=darwin", msg="Only supported on 'linux' and 'cray'")
conflicts("platform=windows", msg="Only supported on 'linux' and 'cray'")
conflicts("platform=darwin", msg="Only supported on linux")
conflicts("platform=windows", msg="Only supported on linux")

View File

@@ -24,4 +24,3 @@ class Libxdmcp(AutotoolsPackage, XorgPackage):
depends_on("pkgconfig", type="build")
depends_on("util-macros", type="build")
depends_on("libbsd", when="platform=linux")
depends_on("libbsd", when="platform=cray")

View File

@@ -183,7 +183,6 @@ class LlvmDoe(CMakePackage, CudaPackage):
# code signing is only necessary on macOS",
conflicts("+code_signing", when="platform=linux")
conflicts("+code_signing", when="platform=cray")
conflicts(
"+code_signing",
@@ -547,7 +546,7 @@ def cmake_args(self):
if self.compiler.name == "gcc":
cmake_args.append(define("GCC_INSTALL_PREFIX", self.compiler.prefix))
# if spec.satisfies("platform=cray") or spec.satisfies("platform=linux"):
# if spec.satisfies("platform=linux"):
# cmake_args.append("-DCMAKE_BUILD_WITH_INSTALL_RPATH=1")
if self.spec.satisfies("~code_signing platform=darwin"):

View File

@@ -17,7 +17,6 @@ class Macfuse(Package):
provides("fuse")
conflicts("platform=linux", msg="macfuse does not support linux, use libfuse instead")
conflicts("platform=cray", msg="macfuse does not support cray, use libfuse instead")
def install(self, spec, prefix):
msg = """

View File

@@ -54,11 +54,6 @@ def edit(self, spec, prefix):
makefile.filter(r"CPP := clang", r"CPP := armclang")
makefile.filter(r"-cxx=clang.*", "")
# Cray systems require use of 'cc' and 'CC' to call correct mpi wrappers
if self.spec.platform == "cray":
makefile.filter("mpicc", "cc")
makefile.filter("mpicxx", "CC")
if self.spec.compiler.name == "nvhpc":
makefile.filter("pgc", "nvc")

View File

@@ -448,22 +448,10 @@ def setup_build_environment(self, env):
def setup_run_environment(self, env):
# Because MPI implementations provide compilers, they have to add to
# their run environments the code to make the compilers available.
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
if self.spec.satisfies("platform=cray") and spack_cc is not None:
# This is intended to support external MPICH instances registered
# by Spack on Cray machines prior to a879c87; users defining an
# external MPICH entry for Cray should generally refer to the
# "cray-mpich" package
env.set("MPICC", spack_cc)
env.set("MPICXX", spack_cxx)
env.set("MPIF77", spack_fc)
env.set("MPIF90", spack_fc)
else:
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpic++"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpic++"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
def setup_dependent_build_environment(self, env, dependent_spec):
dependent_module = dependent_spec.package.module
@@ -476,20 +464,12 @@ def setup_dependent_build_environment(self, env, dependent_spec):
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
if self.spec.satisfies("platform=cray") and spack_cc is not None:
spec.mpicc = spack_cc
spec.mpicxx = spack_cxx
spec.mpifc = spack_fc
spec.mpif77 = spack_f77
else:
spec.mpicc = join_path(self.prefix.bin, "mpicc")
spec.mpicxx = join_path(self.prefix.bin, "mpic++")
spec.mpicc = join_path(self.prefix.bin, "mpicc")
spec.mpicxx = join_path(self.prefix.bin, "mpic++")
if "+fortran" in spec:
spec.mpifc = join_path(self.prefix.bin, "mpif90")
spec.mpif77 = join_path(self.prefix.bin, "mpif77")
if "+fortran" in spec:
spec.mpifc = join_path(self.prefix.bin, "mpif90")
spec.mpif77 = join_path(self.prefix.bin, "mpif77")
spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),

View File

@@ -50,14 +50,7 @@ def setup_run_environment(self, env):
env.set("MPIF90", self.prefix.bin.mpif90)
def setup_dependent_package(self, module, dependent_spec):
if "platform=cray" in self.spec:
dependent_module = dependent_spec.package.module
self.spec.mpicc = dependent_module.spack_cc
self.spec.mpicxx = dependent_module.spack_cxx
self.spec.mpifc = dependent_module.spack_fc
self.spec.mpif77 = dependent_module.spack_f77
else:
self.spec.mpicc = self.prefix.bin.mpicc
self.spec.mpicxx = self.prefix.bin.mpicxx
self.spec.mpifc = self.prefix.bin.mpif90
self.spec.mpif77 = self.prefix.bin.mpif77
self.spec.mpicc = self.prefix.bin.mpicc
self.spec.mpicxx = self.prefix.bin.mpicxx
self.spec.mpifc = self.prefix.bin.mpif90
self.spec.mpif77 = self.prefix.bin.mpif77

View File

@@ -223,33 +223,16 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env.set("MPICH_FC", dependent_module.spack_fc)
def setup_compiler_environment(self, env):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
if self.spec.satisfies("platform=cray") and spack_cc is not None:
env.set("MPICC", spack_cc)
env.set("MPICXX", spack_cxx)
env.set("MPIF77", spack_fc)
env.set("MPIF90", spack_fc)
else:
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpicxx"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpicxx"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
def setup_dependent_package(self, module, dependent_spec):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
if self.spec.satisfies("platform=cray"):
self.spec.mpicc = spack_cc
self.spec.mpicxx = spack_cxx
self.spec.mpifc = spack_fc
self.spec.mpif77 = spack_f77
else:
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),

View File

@@ -384,33 +384,16 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env.set("MPICH_FC", dependent_module.spack_fc)
def setup_compiler_environment(self, env):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
if self.spec.satisfies("platform=cray") and spack_cc is not None:
env.set("MPICC", spack_cc)
env.set("MPICXX", spack_cxx)
env.set("MPIF77", spack_fc)
env.set("MPIF90", spack_fc)
else:
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpicxx"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpicxx"))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
def setup_dependent_package(self, module, dependent_spec):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
if self.spec.satisfies("platform=cray") and spack_cc is not None:
self.spec.mpicc = spack_cc
self.spec.mpicxx = spack_cxx
self.spec.mpifc = spack_fc
self.spec.mpif77 = spack_f77
else:
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),

View File

@@ -164,7 +164,7 @@ class NetcdfC(CMakePackage, AutotoolsPackage):
# The man files are included in the release tarballs starting version 4.5.0 but they are not
# needed for the Windows platform:
for __p in ["darwin", "cray", "linux"]:
for __p in ["darwin", "linux"]:
with when("platform={0}".format(__p)):
# It is possible to install the package with CMake and without M4 on a non-Windows
# platform but some of the man files will not be installed in that case (even if they
@@ -250,7 +250,7 @@ class NetcdfC(CMakePackage, AutotoolsPackage):
depends_on("zlib@1.2.5:", when="^[virtuals=zlib-api] zlib")
# Use the vendored bzip2 on Windows:
for __p in ["darwin", "cray", "linux"]:
for __p in ["darwin", "linux"]:
depends_on("bzip2", when="@4.9.0:+shared platform={0}".format(__p))
del __p

View File

@@ -157,10 +157,7 @@ def filter_compilers(self):
spec = self.spec
if "cray" in spec.architecture:
cc_compiler = "cc"
cxx_compiler = "CC"
elif spec.satisfies("+mpi"):
if spec.satisfies("+mpi"):
cc_compiler = spec["mpi"].mpicc
cxx_compiler = spec["mpi"].mpicxx
else:

View File

@@ -781,41 +781,31 @@ class Opencv(CMakePackage, CudaPackage):
# using `OCV_OPTION(WITH_* ...)`
conflicts("+android_mediandk", when="platform=darwin", msg="Android only")
conflicts("+android_mediandk", when="platform=linux", msg="Android only")
conflicts("+android_mediandk", when="platform=cray", msg="Android only")
conflicts("+android_native_camera", when="platform=darwin", msg="Android only")
conflicts("+android_native_camera", when="platform=linux", msg="Android only")
conflicts("+android_native_camera", when="platform=cray", msg="Android only")
conflicts("+avfoundation", when="platform=linux", msg="iOS/macOS only")
conflicts("+avfoundation", when="platform=cray", msg="iOS/macOS only")
conflicts("+cap_ios", when="platform=darwin", msg="iOS only")
conflicts("+cap_ios", when="platform=linux", msg="iOS only")
conflicts("+cap_ios", when="platform=cray", msg="iOS only")
conflicts("+carotene", when="target=x86:", msg="ARM/AARCH64 only")
conflicts("+carotene", when="target=x86_64:", msg="ARM/AARCH64 only")
conflicts("+cpufeatures", when="platform=darwin", msg="Android only")
conflicts("+cpufeatures", when="platform=linux", msg="Android only")
conflicts("+cpufeatures", when="platform=cray", msg="Android only")
conflicts("+cublas", when="~cuda")
conflicts("+cudnn", when="~cuda")
conflicts("+cufft", when="~cuda")
conflicts("+directx", when="platform=darwin", msg="Windows only")
conflicts("+directx", when="platform=linux", msg="Windows only")
conflicts("+directx", when="platform=cray", msg="Windows only")
conflicts("+dshow", when="platform=darwin", msg="Windows only")
conflicts("+dshow", when="platform=linux", msg="Windows only")
conflicts("+dshow", when="platform=cray", msg="Windows only")
conflicts("+gtk", when="platform=darwin", msg="Linux only")
conflicts("+ipp", when="target=aarch64:", msg="x86 or x86_64 only")
conflicts("+jasper", when="+openjpeg")
conflicts("+msmf", when="platform=darwin", msg="Windows only")
conflicts("+msmf", when="platform=linux", msg="Windows only")
conflicts("+msmf", when="platform=cray", msg="Windows only")
conflicts("+msmf_dxva", when="platform=darwin", msg="Windows only")
conflicts("+msmf_dxva", when="platform=linux", msg="Windows only")
conflicts("+msmf_dxva", when="platform=cray", msg="Windows only")
conflicts("+opencl_d3d11_nv", when="platform=darwin", msg="Windows only")
conflicts("+opencl_d3d11_nv", when="platform=linux", msg="Windows only")
conflicts("+opencl_d3d11_nv", when="platform=cray", msg="Windows only")
conflicts("+opengl", when="~qt")
conflicts("+tengine", when="platform=darwin", msg="Linux only")
conflicts("+tengine", when="target=x86:", msg="ARM/AARCH64 only")
@@ -823,7 +813,6 @@ class Opencv(CMakePackage, CudaPackage):
conflicts("+v4l", when="platform=darwin", msg="Linux only")
conflicts("+win32ui", when="platform=darwin", msg="Windows only")
conflicts("+win32ui", when="platform=linux", msg="Windows only")
conflicts("+win32ui", when="platform=cray", msg="Windows only")
# https://github.com/opencv/opencv/wiki/ChangeLog#version460
conflicts("%gcc@12:", when="@:4.5")

View File

@@ -106,6 +106,6 @@ def gl_libs(self):
lib_name = "opengl32"
elif "platform=darwin" in spec:
lib_name = "libOpenGL"
else: # linux and cray
else:
lib_name = "libGL"
return find_libraries(lib_name, root=self.prefix, recursive=True)

View File

@@ -1024,7 +1024,7 @@ def configure_args(self):
config_args.extend(self.with_or_without("fabrics"))
if spec.satisfies("@2.0.0:"):
if "fabrics=xpmem platform=cray" in spec:
if "fabrics=xpmem" in spec:
config_args.append("--with-cray-xpmem")
else:
config_args.append("--without-cray-xpmem")

View File

@@ -396,7 +396,6 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
depends_on("nasm", when="platform=windows")
depends_on("gmake", type="build", when="platform=linux")
depends_on("gmake", type="build", when="platform=cray")
depends_on("gmake", type="build", when="platform=darwin")
patch(

View File

@@ -187,9 +187,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
depends_on("gl@3.2:", when="+opengl2")
depends_on("gl@1.2:", when="~opengl2")
depends_on("glew")
for p in ["linux", "cray"]:
depends_on("libxt", when=f"platform={p} ^[virtuals=gl] glx")
depends_on("libxt", when="platform=linux ^[virtuals=gl] glx")
requires("^[virtuals=gl] glx", when="+qt", msg="Qt support requires GLX")

View File

@@ -60,8 +60,4 @@ def cmake_args(self):
self.define("PDC_ENABLE_MPI", "ON"),
self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc),
]
if self.spec.satisfies("platform=cray"):
args.append("-DRANKSTR_LINK_STATIC=ON")
return args

View File

@@ -52,10 +52,8 @@ class PyIpython(PythonPackage):
depends_on("py-matplotlib-inline", when="@7.23:", type=("build", "run"))
depends_on("py-pexpect@4.4:", when="@7.18: platform=linux", type=("build", "run"))
depends_on("py-pexpect@4.4:", when="@7.18: platform=darwin", type=("build", "run"))
depends_on("py-pexpect@4.4:", when="@7.18: platform=cray", type=("build", "run"))
depends_on("py-pexpect", when="platform=linux", type=("build", "run"))
depends_on("py-pexpect", when="platform=darwin", type=("build", "run"))
depends_on("py-pexpect", when="platform=cray", type=("build", "run"))
depends_on("py-pickleshare", type=("build", "run"))
depends_on("py-prompt-toolkit@3.0.30:3.0.36,3.0.38:3.0", when="@8.11:", type=("build", "run"))
depends_on("py-prompt-toolkit@3.0.2:3.0", when="@8.5:", type=("build", "run"))

View File

@@ -250,7 +250,6 @@ class PyMatplotlib(PythonPackage):
msg = "MacOSX backend requires macOS 10.12+"
conflicts("platform=linux", when="backend=macosx", msg=msg)
conflicts("platform=cray", when="backend=macosx", msg=msg)
conflicts("platform=windows", when="backend=macosx", msg=msg)
conflicts("^tk@8.6.0:8.6.1")

View File

@@ -43,14 +43,14 @@ class PyMlflow(PythonPackage):
depends_on("py-pandas@:1", type=("build", "run"))
depends_on("py-querystring-parser@:1", type=("build", "run"))
depends_on("py-sqlalchemy@1.4.0:1", type=("build", "run"))
for platform in ["linux", "darwin", "cray"]:
for platform in ["linux", "darwin"]:
depends_on("py-gunicorn@:20", type=("build", "run"), when=f"platform={platform}")
depends_on("py-waitress@:2", type=("build", "run"), when="platform=windows")
depends_on("py-scikit-learn@:1", type=("build", "run"))
depends_on("py-pyarrow@4.0.0:10", type=("build", "run"))
depends_on("py-shap@0.40:0", type=("build", "run"))
depends_on("py-markdown@3.3:3", type=("build", "run"))
for platform in ["linux", "darwin", "cray"]:
for platform in ["linux", "darwin"]:
depends_on("py-jinja2@2.11:3", type=("build", "run"), when=f"platform={platform}")
depends_on("py-jinja2@3.0:3", type=("build", "run"), when="platform=windows")
depends_on("py-matplotlib@:3", type=("build", "run"))

View File

@@ -69,7 +69,6 @@ class PyMne(PythonPackage):
depends_on("py-matplotlib@3.0.3:", type=("build", "run")) # *
depends_on("py-pyqt5@5.10:,:5.15.1,5.15.4:", when="platform=linux", type=("build", "run"))
depends_on("py-pyqt5@5.10:,:5.13", when="platform=darwin", type=("build", "run"))
depends_on("py-pyqt5@5.10:,:5.15.2,5.15.4:", when="platform=cray", type=("build", "run"))
depends_on("py-pyqt5@5.10:,:5.15.2,5.15.4:", when="platform=win32", type=("build", "run"))
depends_on("py-pyqt5-sip", type=("build", "run"))
depends_on("py-sip", type=("build", "run"))

View File

@@ -331,11 +331,6 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension):
when="platform=darwin",
msg="Currently jemalloc is only support on Linux platform",
)
conflicts(
"+jemalloc",
when="platform=cray",
msg="Currently jemalloc is only support on Linux platform",
)
conflicts("+opencl", when="platform=windows")
conflicts("+computecpp", when="~opencl")
conflicts(
@@ -358,21 +353,12 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension):
when="platform=darwin",
msg="Currently TensorRT is only supported on Linux platform",
)
conflicts(
"+tensorrt",
when="platform=cray",
msg="Currently TensorRT is only supported on Linux platform",
)
conflicts("+nccl", when="~cuda~rocm")
conflicts(
"+nccl", when="platform=darwin", msg="Currently NCCL is only supported on Linux platform"
)
conflicts(
"+nccl", when="platform=cray", msg="Currently NCCL is only supported on Linux platform"
)
conflicts("+mpi", when="platform=windows")
conflicts("+ios", when="platform=linux", msg="iOS support only available on macOS")
conflicts("+ios", when="platform=cray", msg="iOS support only available on macOS")
# https://github.com/tensorflow/tensorflow/pull/45404
conflicts("platform=darwin target=aarch64:", when="@:2.4")
# https://github.com/tensorflow/tensorflow/pull/39225

View File

@@ -76,18 +76,14 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
when="@1.12: platform=darwin",
)
variant("nccl", default=True, description="Use NCCL", when="+cuda platform=linux")
variant("nccl", default=True, description="Use NCCL", when="+cuda platform=cray")
variant("nccl", default=True, description="Use NCCL", when="+rocm platform=linux")
variant("nccl", default=True, description="Use NCCL", when="+rocm platform=cray")
# Requires AVX2: https://discuss.pytorch.org/t/107518
variant("nnpack", default=True, description="Use NNPACK", when="target=x86_64_v3:")
variant("numa", default=True, description="Use NUMA", when="platform=linux")
variant("numa", default=True, description="Use NUMA", when="platform=cray")
variant("numpy", default=True, description="Use NumPy")
variant("openmp", default=True, description="Use OpenMP for parallel code")
variant("qnnpack", default=True, description="Use QNNPACK (quantized 8-bit operators)")
variant("valgrind", default=True, description="Use Valgrind", when="@1.8: platform=linux")
variant("valgrind", default=True, description="Use Valgrind", when="@1.8: platform=cray")
variant("xnnpack", default=True, description="Use XNNPACK", when="@1.5:")
variant("mkldnn", default=True, description="Use MKLDNN")
variant("distributed", default=not is_darwin, description="Use distributed")

View File

@@ -31,6 +31,5 @@ class PyUvicorn(PythonPackage):
depends_on("py-pyyaml@5.1:", type=("build", "run"))
depends_on("py-uvloop@0.14,0.15.2:", when="platform=linux", type=("build", "run"))
depends_on("py-uvloop@0.14,0.15.2:", when="platform=darwin", type=("build", "run"))
depends_on("py-uvloop@0.14,0.15.2:", when="platform=cray", type=("build", "run"))
depends_on("py-watchfiles@0.13:", type=("build", "run"))
depends_on("py-websockets@10.4:", type=("build", "run"))

View File

@@ -243,7 +243,6 @@ class Python(Package):
variant("tix", default=False, description="Build Tix module", when="+tkinter")
variant("crypt", default=True, description="Build crypt module", when="@:3.12 platform=linux")
variant("crypt", default=True, description="Build crypt module", when="@:3.12 platform=darwin")
variant("crypt", default=True, description="Build crypt module", when="@:3.12 platform=cray")
if sys.platform != "win32":
depends_on("gmake", type="build")

View File

@@ -287,7 +287,7 @@ class Qt(Package):
"fj": ("clang",),
"gcc": ("g++",),
}
platform_mapping = {"darwin": ("macx"), "cray": ("linux")}
platform_mapping = {"darwin": ("macx")}
def url_for_version(self, version):
# URL keeps getting more complicated with every release

View File

@@ -36,8 +36,5 @@ def cmake_args(self):
if spec.satisfies("@0.1.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("RANKSTR_LINK_STATIC", True))
return args

View File

@@ -31,7 +31,6 @@ class Re2c(Package):
depends_on("cmake", when="platform=windows")
depends_on("gmake", when="platform=linux")
depends_on("gmake", when="platform=cray")
depends_on("gmake", when="platform=darwin")
depends_on("gmake", when="platform=freebsd")

View File

@@ -51,8 +51,5 @@ def cmake_args(self):
if spec.satisfies("@0.1.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("REDSET_LINK_STATIC", True))
return args

View File

@@ -37,7 +37,7 @@ class Ruby(AutotoolsPackage, NMakePackage):
build_system("autotools", "nmake", default="autotools")
for _platform_condition in ("platform=linux", "platform=darwin", "platform=cray"):
for _platform_condition in ("platform=linux", "platform=darwin"):
with when(_platform_condition):
variant("openssl", default=True, description="Enable OpenSSL support")
variant("readline", default=False, description="Enable Readline support")

View File

@@ -163,8 +163,7 @@ def configure_args(self):
]
cname = spec.compiler.name
if not spec.satisfies("platform=cray"):
config_args.append("--with-nocross-compiler-suite={0}".format(cname))
config_args.append("--with-nocross-compiler-suite={0}".format(cname))
if self.version >= Version("4.0"):
config_args.append("--with-cubew=%s" % spec["cubew"].prefix.bin)
@@ -189,8 +188,7 @@ def configure_args(self):
config_args.append("--with-rocm=%s" % spec["hip"].prefix)
config_args += self.with_or_without("shmem")
if not spec.satisfies("platform=cray"):
config_args += self.with_or_without("mpi")
config_args += self.with_or_without("mpi")
if spec.satisfies("^intel-mpi"):
config_args.append("--with-mpi=intel3")

View File

@@ -302,9 +302,6 @@ def cmake_args(self):
# PDSH required before this point
args.append(self.define("WITH_PDSH_PREFIX", spec["pdsh"].prefix))
if "platform=cray" in spec:
args.append(self.define("SCR_LINK_STATIC", False))
return args
@run_after("install")

View File

@@ -44,8 +44,5 @@ def cmake_args(self):
if spec.satisfies("@0.1.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("SHUFFILE_LINK_STATIC", True))
return args

View File

@@ -115,7 +115,6 @@ class Spack(Package):
depends_on("binutils", type="run", when="@:0.20")
depends_on("gnupg", type="run")
depends_on("patchelf", type="run", when="platform=linux")
depends_on("patchelf", type="run", when="platform=cray")
# See https://github.com/spack/spack/pull/24686
# and #25595, #25726, #25853, #25923, #25924 upstream in python/cpython

View File

@@ -41,8 +41,5 @@ def cmake_args(self):
if spec.satisfies("@0.1.0:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
else:
if spec.satisfies("platform=cray"):
args.append(self.define("SPATH_LINK_STATIC", True))
return args

View File

@@ -54,7 +54,7 @@ class Sqlite(AutotoolsPackage, NMakePackage):
# is enabled, see https://blade.tencent.com/magellan/index_en.html
# no hard readline dep on Windows + no variant support, makefile has minimal to no options
for plat in ["linux", "darwin", "cray", "freebsd"]:
for plat in ["linux", "darwin", "freebsd"]:
variant(
"column_metadata",
default=True,

View File

@@ -250,9 +250,6 @@ def install(self, spec, prefix):
if "+x86_64" in spec:
options.append("-arch=x86_64")
if ("platform=cray" in self.spec) and ("+x86_64" not in spec):
options.append("-arch=craycnl")
if "+pdt" in spec:
options.append("-pdt=%s" % spec["pdt"].prefix)
if spec["pdt"].satisfies("%intel"):

View File

@@ -56,7 +56,8 @@ class Tcl(AutotoolsPackage, NMakePackage, SourceforgePackage, TclHelper):
depends_on("zlib-api")
filter_compiler_wrappers("tclConfig.sh", relative_root="lib")
if sys.platform != "win32":
filter_compiler_wrappers("tclConfig.sh", relative_root="lib")
build_system("autotools", "nmake")
patch("tcl-quote-cc-path.patch", when="platform=windows")

View File

@@ -44,13 +44,6 @@ class Totalview(Package):
# resource once the target architecture is known.
# Version 2022.3.6
resource(
name="crayx86",
url="file://totalview_2022.3.6_linux_x86-64.tar",
destination=".",
sha256="a2639c52bfd4c7484b728d6a0158239074ff0e0c52208a5452b12b878016a519",
when="@2022.3.6 platform=cray target=x86_64:",
)
resource(
name="x86-64",
url="file://totalview.2022.3.6-linux-x86-64.tar",
@@ -81,13 +74,6 @@ class Totalview(Package):
)
# Version 2022.2.13
resource(
name="crayx86",
url="file://totalview_2022.2.13_linux_x86-64.tar",
destination=".",
sha256="aebd11b837ce18b8200859ea762caa56e2cea346daa114f2841aa0f05a422309",
when="@2022.2.13 platform=cray target=x86_64:",
)
resource(
name="x86-64",
url="file://totalview.2022.2.13-linux-x86-64.tar",
@@ -118,13 +104,6 @@ class Totalview(Package):
)
# Version 2022.1.11
resource(
name="crayx86",
url="file://totalview_2022.1.11_linux_x86-64.tar",
destination=".",
sha256="3ec9a7d702572dbbafa41726a036c94b549f9a5911ed6fd6aa55f7b377554bac",
when="@2022.1.11 platform=cray target=x86_64:",
)
resource(
name="x86-64",
url="file://totalview.2022.1.11-linux-x86-64.tar",
@@ -155,13 +134,6 @@ class Totalview(Package):
)
# Version 2021.4.10
resource(
name="crayx86",
url="file://totalview_2021.4.10_linux_x86-64.tar",
destination=".",
sha256="7e5509b2cfb219100b0032304bdad7d422657c0736c386ba64bdb1bf11d10a1d",
when="@2021.4.10 platform=cray target=x86_64:",
)
resource(
name="x86-64",
url="file://totalview.2021.4.10-linux-x86-64.tar",
@@ -230,8 +202,6 @@ def install(self, spec, prefix):
arg_list.extend(["-platform", "linux-x86-64"])
elif spec.target.family == "x86_64" and spec.platform == "darwin":
arg_list.extend(["-platform", "darwin-x86"])
elif spec.target.family == "x86_64" and spec.platform == "cray":
arg_list.extend(["-platform", "linux-x86-64"])
elif spec.target.family == "x86":
arg_list.extend(["-platform", "linux-x86"])
elif spec.target.family == "aarch64":

View File

@@ -426,7 +426,7 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage):
depends_on("cgns", when="+exodus")
depends_on("cmake@3.23:", type="build", when="@14.0.0:")
depends_on("hdf5+hl", when="+hdf5")
for plat in ["cray", "darwin", "linux"]:
for plat in ["darwin", "linux"]:
depends_on("hypre~internal-superlu~int64", when="+hypre platform=%s" % plat)
depends_on("hypre-cmake~int64", when="+hypre platform=windows")
depends_on("kokkos-nvcc-wrapper", when="+wrapper")

View File

@@ -20,11 +20,6 @@ class Unzip(MakefilePackage):
# There is no problem with it on gcc, so make it a catch all
patch("configure-cflags.patch")
# The Cray cc wrapper doesn't handle the '-s' flag (strip) cleanly.
@when("platform=cray")
def patch(self):
filter_file(r"^LFLAGS2=.*", "LFLAGS2=", join_path("unix", "configure"))
def get_make_args(self):
make_args = ["-f", join_path("unix", "Makefile")]

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