summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/requires_clang/package.py18
-rw-r--r--var/spack/repos/builtin.mock/packages/requires_clang_or_gcc/package.py18
-rw-r--r--var/spack/repos/builtin/packages/bucky/package.py8
-rw-r--r--var/spack/repos/builtin/packages/dyninst/package.py12
-rw-r--r--var/spack/repos/builtin/packages/ffte/package.py7
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py4
6 files changed, 41 insertions, 26 deletions
diff --git a/var/spack/repos/builtin.mock/packages/requires_clang/package.py b/var/spack/repos/builtin.mock/packages/requires_clang/package.py
new file mode 100644
index 0000000000..9f1c2d0ba4
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/requires_clang/package.py
@@ -0,0 +1,18 @@
+# Copyright 2013-2023 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)
+
+from spack.package import *
+
+
+class RequiresClang(Package):
+ """Simple package with no dependencies"""
+
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/b-1.0.tar.gz"
+
+ version("1.0", md5="0123456789abcdef0123456789abcdef")
+ version("0.9", md5="abcd456789abcdef0123456789abcdef")
+
+ requires("%clang", msg="can only be compiled with Clang")
diff --git a/var/spack/repos/builtin.mock/packages/requires_clang_or_gcc/package.py b/var/spack/repos/builtin.mock/packages/requires_clang_or_gcc/package.py
new file mode 100644
index 0000000000..18f924e92f
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/requires_clang_or_gcc/package.py
@@ -0,0 +1,18 @@
+# Copyright 2013-2023 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)
+
+from spack.package import *
+
+
+class RequiresClangOrGcc(Package):
+ """Simple package with no dependencies"""
+
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/b-1.0.tar.gz"
+
+ version("1.0", md5="0123456789abcdef0123456789abcdef")
+ version("0.9", md5="abcd456789abcdef0123456789abcdef")
+
+ requires("%gcc", "%clang", policy="one_of")
diff --git a/var/spack/repos/builtin/packages/bucky/package.py b/var/spack/repos/builtin/packages/bucky/package.py
index 5bd0c9fdf6..601729e82e 100644
--- a/var/spack/repos/builtin/packages/bucky/package.py
+++ b/var/spack/repos/builtin/packages/bucky/package.py
@@ -18,13 +18,7 @@ class Bucky(MakefilePackage):
version("1.4.4", sha256="1621fee0d42314d9aa45d0082b358d4531e7d1d1a0089c807c1b21fbdc4e4592")
- # Compilation requires gcc
- conflicts("%cce")
- conflicts("%apple-clang")
- conflicts("%nag")
- conflicts("%pgi")
- conflicts("%xl")
- conflicts("%xl_r")
+ requires("%gcc", msg="bucky can only be compiled with GCC")
build_directory = "src"
diff --git a/var/spack/repos/builtin/packages/dyninst/package.py b/var/spack/repos/builtin/packages/dyninst/package.py
index c977fcc408..4079212ecf 100644
--- a/var/spack/repos/builtin/packages/dyninst/package.py
+++ b/var/spack/repos/builtin/packages/dyninst/package.py
@@ -87,19 +87,11 @@ class Dyninst(CMakePackage):
patch("v9.3.2-auto.patch", when="@9.3.2 %gcc@:4.7")
patch("tribool.patch", when="@9.3.0:10.0.0 ^boost@1.69:")
+ requires("%gcc", msg="dyninst builds only with GCC")
+
# No Mac support (including apple-clang)
conflicts("platform=darwin", msg="macOS is not supported")
- # We currently only build with gcc
- conflicts("%clang")
- conflicts("%arm")
- conflicts("%cce")
- conflicts("%fj")
- conflicts("%intel")
- conflicts("%pgi")
- conflicts("%xl")
- conflicts("%xl_r")
-
# Version 11.0 requires a C++11-compliant ABI
conflicts("%gcc@:5", when="@11.0.0:")
diff --git a/var/spack/repos/builtin/packages/ffte/package.py b/var/spack/repos/builtin/packages/ffte/package.py
index 8b5b36c788..ed6de99aa4 100644
--- a/var/spack/repos/builtin/packages/ffte/package.py
+++ b/var/spack/repos/builtin/packages/ffte/package.py
@@ -32,12 +32,7 @@ class Ffte(Package):
depends_on("mpi", when="+mpi")
- conflicts("%cce", when="+cuda", msg="Must use NVHPC compiler")
- conflicts("%clang", when="+cuda", msg="Must use NVHPC compiler")
- conflicts("%gcc", when="+cuda", msg="Must use NVHPC compiler")
- conflicts("%llvm", when="+cuda", msg="Must use NVHPC compiler")
- conflicts("%nag", when="+cuda", msg="Must use NVHPC compiler")
- conflicts("%intel", when="+cuda", msg="Must use NVHPC compiler")
+ requires("%nvhpc", when="+cuda", msg="ffte+cuda must use NVHPC compiler")
def edit(self, spec, prefix):
"No make-file, must create one from scratch."
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index 15bede82c0..259629d31e 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -273,9 +273,7 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
# See https://gcc.gnu.org/install/prerequisites.html#GDC-prerequisite
with when("@12:"):
# All versions starting 12 have to be built GCC:
- for c in spack.compilers.supported_compilers():
- if c != "gcc":
- conflicts("%{0}".format(c))
+ requires("%gcc")
# And it has to be GCC older than the version we build:
vv = ["11", "12.1.0", "12.2.0"]