summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/llvm/package.py
diff options
context:
space:
mode:
authorSergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>2023-06-04 06:08:10 +0200
committerGitHub <noreply@github.com>2023-06-03 23:08:10 -0500
commit7d5d07580945d6950b5d3b376108decaacbf1d43 (patch)
treee4fae0bc99691f6c402f79e54d7134de4d38bc13 /var/spack/repos/builtin/packages/llvm/package.py
parent237a0d8999154d6a291bfff56a8bf12ecb104c5b (diff)
downloadspack-7d5d07580945d6950b5d3b376108decaacbf1d43.tar.gz
spack-7d5d07580945d6950b5d3b376108decaacbf1d43.tar.bz2
spack-7d5d07580945d6950b5d3b376108decaacbf1d43.tar.xz
spack-7d5d07580945d6950b5d3b376108decaacbf1d43.zip
llvm: optionally build compiler-rt, libcxx and libunwind as runtimes (#32476)
* llvm: replace +omp_as_runtime with omp=runtime * llvm: fetch 'libomp-libflags-as-list.patch' from upstream repo * llvm: replace 'llvm14-hwloc-ompd.patch' with the official fix from upstream repo * llvm: fix-up for the black reformatting * llvm: fetch 'constexpr_longdouble.patch' from upstream repo * llvm: optionally build libcxx as a runtime * llvm: fetch 'llvm5-sanitizer-ustat.patch' from upstream repo * llvm: update 'sanitizer-ipc_perm_mode.patch' * llvm: refactor compiler conflicts when libcxx=project * llvm: fetch 'llvm_python_path.patch' from upstream repo * llvm: update comments and condition for 'xray_buffer_queue-cstddef.patch' * llvm: optionally build compiler-rt as a runtime * llvm: fetch 'lldb_external_ncurses-10.patch' from upstream repo * llvm: fetch 'llvm_py37.patch' from upstream repo * llvm: rename variant 'internal_unwind' to 'libunwind' * llvm: optionally build libunwind as a runtime * llvm: extend the list of maintainers * llvm: allow for explicit '~clang~flang~libomptarget~lldb~omp_debug~z3' * llvm: fetch 'llvm5-lld-ELF-Symbols.patch' from FreeBSD port repo * llvm: fetch most of 'missing-includes.patch' from upstream repo and reuse 'llvm-gcc11.patch' * llvm: regroup patches for missing include directives and drop compiler constraints for them * llvm: fetch 'llvm-gcc11.patch' from upstream repo * llvm: fetch 'no_cyclades.patch' from upstream repo * llvm: update comments and condition for 'no_cyclades9.patch' * llvm: rename variant 'omp' to 'openmp' * llvm: constrain and rename variant 'omp_tsan' to 'libomp_tsan' * llvm: rename variant 'omp_debug' to 'libomptarget_debug' * llvm: do not apply same patch twice * llvm: constrain and document the '*-thread.patch' patches * llvm: document the '~lld+libomptarget' conflict * llvm: update comments for the 'D133513.diff' patch
Diffstat (limited to 'var/spack/repos/builtin/packages/llvm/package.py')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py356
1 files changed, 251 insertions, 105 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 1b17cbe7d0..7af5766b09 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -26,7 +26,7 @@ class Llvm(CMakePackage, CudaPackage):
url = "https://github.com/llvm/llvm-project/archive/llvmorg-7.1.0.tar.gz"
list_url = "https://releases.llvm.org/download.html"
git = "https://github.com/llvm/llvm-project"
- maintainers("trws", "haampie")
+ maintainers("trws", "haampie", "skosukhin")
tags = ["e4s"]
@@ -82,44 +82,72 @@ class Llvm(CMakePackage, CudaPackage):
variant(
"clang", default=True, description="Build the LLVM C/C++/Objective-C compiler frontend"
)
+
variant(
"flang",
default=False,
- when="@11: +clang",
description="Build the LLVM Fortran compiler frontend "
"(experimental - parser only, needs GCC)",
)
- variant("lldb", default=True, when="+clang", description="Build the LLVM debugger")
+ conflicts("+flang", when="@:10")
+ conflicts("+flang", when="~clang")
+
+ variant("lldb", default=True, description="Build the LLVM debugger")
+ conflicts("+lldb", when="~clang")
+
variant("lld", default=True, description="Build the LLVM linker")
variant("mlir", default=False, when="@10:", description="Build with MLIR support")
variant(
- "internal_unwind", default=True, when="+clang", description="Build the libcxxabi libunwind"
+ "libunwind",
+ values=(
+ "none",
+ conditional("project", when="@:15"),
+ conditional("runtime", when="+clang @6:"),
+ ),
+ default="runtime",
+ description="Build the LLVM unwinder library"
+ "either as a runtime (with just-build Clang) "
+ "or as a project (with the compiler in use)",
)
variant(
"polly",
default=True,
- description="Build the LLVM polyhedral optimization plugin, " "only builds for 3.7.0+",
- )
- variant(
- "libcxx", default=True, when="+clang", description="Build the LLVM C++ standard library"
+ description="Build the LLVM polyhedral optimization plugin, only builds for 3.7.0+",
)
variant(
- "libomptarget",
- default=True,
- when="+clang",
- description="Build the OpenMP offloading library",
+ "libcxx",
+ values=(
+ "none",
+ conditional("project", when="@:15"),
+ conditional("runtime", when="+clang @6:"),
+ ),
+ default="runtime",
+ description="Build the LLVM C++ standard library "
+ "either as a runtime (with just-build Clang) "
+ "or as a project (with the compiler in use)",
)
+
+ variant("libomptarget", default=True, description="Build the OpenMP offloading library")
+ conflicts("+libomptarget", when="~clang")
+
variant(
- "omp_debug",
+ "libomptarget_debug",
default=False,
- when="+libomptarget",
- description="Include debugging code in OpenMP runtime libraries",
+ description="Allow debug output with the environment variable LIBOMPTARGET_DEBUG=1",
)
+ conflicts("+libomptarget_debug", when="~libomptarget")
+
variant(
"compiler-rt",
- when="+clang",
- default=True,
- description="Build LLVM compiler runtime, including sanitizers",
+ values=(
+ "none",
+ conditional("project", when="+clang"),
+ conditional("runtime", when="+clang @6:"),
+ ),
+ default="runtime",
+ description="Build the LLVM compiler runtime, including sanitizers, "
+ "either as a runtime (with just-build Clang) "
+ "or as a project (with the compiler in use)",
)
variant(
"gold",
@@ -170,16 +198,19 @@ class Llvm(CMakePackage, CudaPackage):
multi=True,
)
variant(
- "omp_tsan",
+ "libomp_tsan",
default=False,
- when="@6:",
+ # Added in https://reviews.llvm.org/D13072
+ # Removed in https://reviews.llvm.org/D103767
+ when="@4:12",
description="Build with OpenMP capable thread sanitizer",
)
variant(
- "omp_as_runtime",
- default=True,
- when="+clang @12:",
- description="Build OpenMP runtime via ENABLE_RUNTIME by just-built Clang",
+ "openmp",
+ values=("project", conditional("runtime", when="+clang @12:")),
+ default="runtime",
+ description="Build OpenMP either as a runtime (with just-build Clang) "
+ "or as a project (with the compiler in use)",
)
variant(
"code_signing",
@@ -195,9 +226,10 @@ class Llvm(CMakePackage, CudaPackage):
description="Add shared library symbol version",
when="@13:",
)
- variant(
- "z3", default=False, when="+clang @8:", description="Use Z3 for the clang static analyzer"
- )
+ variant("z3", default=False, description="Use Z3 for the clang static analyzer")
+ conflicts("+z3", when="@:7")
+ conflicts("+z3", when="~clang")
+
variant(
"zstd",
default=False,
@@ -224,6 +256,12 @@ class Llvm(CMakePackage, CudaPackage):
depends_on("cmake@3.4.3:", type="build")
depends_on("cmake@3.13.4:", type="build", when="@12:")
depends_on("cmake@3.20:", type="build", when="@16:")
+ with when("@:10"):
+ # Versions 10 and older cannot build runtimes with cmake@3.17:
+ # See https://reviews.llvm.org/D77284
+ for runtime in ["libunwind", "libcxx", "compiler-rt"]:
+ depends_on("cmake@:3.16", type="build", when="{0}=runtime".format(runtime))
+ del runtime
depends_on("python", when="~python", type="build")
depends_on("pkgconfig", type="build")
@@ -268,17 +306,41 @@ class Llvm(CMakePackage, CudaPackage):
# Internal compiler error on gcc 8.4 on aarch64 https://bugzilla.redhat.com/show_bug.cgi?id=1958295
conflicts("%gcc@8.4:8.4.9", when="@12: target=aarch64:")
- # When these versions are concretized, but not explicitly with +libcxx, these
- # conflicts will enable clingo to set ~libcxx, making the build successful:
-
- # libc++ of LLVM13, see https://libcxx.llvm.org/#platform-and-compiler-support
- # @13 does not support %gcc@:10 https://bugs.llvm.org/show_bug.cgi?id=51359#c1
- # GCC 11 - latest stable release per GCC release page
- # Clang: 11, 12 - latest two stable releases per LLVM release page
- # AppleClang 12 - latest stable release per Xcode release page
- conflicts("%gcc@:10", when="@13:+libcxx")
- conflicts("%clang@:10", when="@13:+libcxx")
- conflicts("%apple-clang@:11", when="@13:+libcxx")
+ # libcxx=project imposes compiler conflicts
+ # see https://libcxx.llvm.org/#platform-and-compiler-support for the latest release
+ # and https://github.com/llvm/www-releases for older releases
+ with when("libcxx=project"):
+ for v, compiler_conflicts in {
+ "@7:": {"clang": "@:3.4", "gcc": "@:4.6"},
+ "@9:": {"clang": "@:3.4", "gcc": "@:4"},
+ "@11:": {"clang": "@:3", "gcc": "@:4"},
+ "@13:": {"clang": "@:10", "gcc": "@:10", "apple-clang": "@:11"},
+ "@14:": {
+ "clang": "@:11",
+ "gcc": "@:10",
+ "apple-clang": "@:11",
+ "xlc": "@:17.0",
+ "xlc_r": "@:17.0",
+ },
+ "@15:": {
+ "clang": "@:12",
+ "gcc": "@:11",
+ "apple-clang": "@:12",
+ "xlc": "@:17.0",
+ "xlc_r": "@:17.0",
+ },
+ "@16:": {
+ "clang": "@:13",
+ "gcc": "@:11",
+ "apple-clang": "@:13",
+ "xlc": "@:17.0",
+ "xlc_r": "@:17.0",
+ },
+ }.items():
+ with when(v):
+ for comp in spack.compilers.supported_compilers():
+ conflicts("%{0}{1}".format(comp, compiler_conflicts.get(comp, "")))
+ del v, compiler_conflicts, comp
# libomptarget
conflicts("+cuda", when="@15:") # +cuda variant is obselete since LLVM 15
@@ -287,6 +349,7 @@ class Llvm(CMakePackage, CudaPackage):
when="+libomptarget",
msg="Non-host backends needed for offloading, set targets=all",
)
+ # See https://github.com/spack/spack/pull/32476#issuecomment-1573770361
conflicts("~lld", when="+libomptarget")
# cuda_arch value must be specified
@@ -297,82 +360,160 @@ class Llvm(CMakePackage, CudaPackage):
# Fixed in upstream versions of both
conflicts("^cmake@3.19.0", when="@6:11.0.0")
- # sys/ustat.h has been removed in favour of statfs from glibc-2.28. Use fixed sizes:
- patch("llvm5-sanitizer-ustat.patch", when="@4:6.0.0+compiler-rt")
-
# Fix lld templates: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230463
- patch("llvm5-lld-ELF-Symbols.patch", when="@5+lld%clang@7:")
-
- # Fix missing std:size_t in 'llvm@4:5' when built with '%clang@7:'
- patch("xray_buffer_queue-cstddef.patch", when="@4:5+compiler-rt%clang@7:")
+ patch(
+ "https://raw.githubusercontent.com/freebsd/freebsd-ports/f8f9333d8e1e5a7a6b28c5ef0ca73785db06136e/devel/llvm50/files/lld/patch-tools_lld_ELF_Symbols.cpp",
+ sha256="c81a50c1b6b78d359c0ce3b88914477f4f2a85b8dbfa7ac745b9e7eb4e53931b",
+ when="@5+lld%clang@7:",
+ )
- # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
- patch("sanitizer-ipc_perm_mode.patch", when="@5:7+compiler-rt%clang@11:")
- patch("sanitizer-ipc_perm_mode.patch", when="@5:9+compiler-rt%gcc@9:")
+ # Add missing include directives for the standard headers (the real need for the following
+ # patches depends on the implementation of the standard C++ library, the headers, however, must
+ # be included according to the standard, therefore, we apply the patches regardless of the
+ # compiler and compiler version).
+ #
+ # fix missing ::size_t in 'llvm@4:5'
+ # see comments in the patch file
+ patch(
+ "xray_buffer_queue-cstddef.patch",
+ # we do not cover compiler-rt=runtime because it is not supported when @:5
+ when="@4:5 compiler-rt=project",
+ )
+ #
+ # see https://reviews.llvm.org/D64937
+ # see https://github.com/spack/spack/issues/24270
+ patch(
+ "https://github.com/llvm/llvm-project/commit/b288d90b39f4b905c02092a9bfcfd6d78f99b191.patch?full_index=1",
+ sha256="2028d52e1a39326bb48fb7463132bbfe7fb4fa18f1adfeea9c3ed0320ed49564",
+ when="@8:9.0.0",
+ )
+ #
+ # committed upstream without a review
+ # see https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1
+ # see https://github.com/spack/spack/pull/28547
+ patch(
+ "https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1.patch?full_index=1",
+ sha256="514926d661635de47972c7d403c9c4669235aa51e22e56d44676d2a2709179b6",
+ when="@8:11",
+ )
- # github.com/spack/spack/issues/24270: MicrosoftDemangle for %gcc@10: and %clang@13:
- patch("missing-includes.patch", when="@8")
+ # fix building of older versions of llvm with newer versions of glibc
+ for compiler_rt_as in ["project", "runtime"]:
+ with when("compiler-rt={0}".format(compiler_rt_as)):
+ # sys/ustat.h has been removed in favour of statfs from glibc-2.28
+ # see https://reviews.llvm.org/D47281
+ patch(
+ "https://github.com/llvm/llvm-project/commit/383fe5c8668f63ef21c646b43f48da9fa41aa100.patch?full_index=1",
+ sha256="66f01ac1769a6815aba09d6f4347ac1744f77f82ec9578a1158b24daca7a89e6",
+ when="@4:6.0.0",
+ )
+ # fix sanitizer-common build with glibc 2.31
+ # see https://reviews.llvm.org/D70662
+ patch("sanitizer-ipc_perm_mode.patch", when="@5:9")
+ del compiler_rt_as
# Backport from llvm upstream gcc ppc const expr long double issue
# see https://bugs.llvm.org/show_bug.cgi?id=39696
- # This fix was initially commited (3bf63cf3b366) for the 9.0 release
+ # This fix was initially committed (3bf63cf3b366) for the 9.0 release
# but was then broken (0583d9ea8d5e) prior to the 9.0 release and
# eventually unbroken (d9a42ec98adc) for the 11.0 release. The first
# patch backports the original correct fix to previous releases. The
# second patch backports the un-breaking of the original fix.
- patch("constexpr_longdouble.patch", when="@6:8+libcxx")
- patch("constexpr_longdouble_9.0.patch", when="@9:10+libcxx")
+ for libcxx_as in ["project", "runtime"]:
+ with when("libcxx={0}".format(libcxx_as)):
+ patch(
+ "https://github.com/llvm/llvm-project/commit/3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1.patch?full_index=1",
+ sha256="e56489a4bcf3c3636e206adca366bfcda2722ad81a5fa9a0360faed63933191a",
+ when="@6:8",
+ )
+ patch(
+ "https://github.com/llvm/llvm-project/commit/d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0.patch?full_index=1",
+ sha256="50bfc4e82c02bb5b7739990f363d99b1e43d5d11a5104f6aabbc303ebce6fbe3",
+ when="@9:10",
+ )
+ del libcxx_as
- # Backport from llvm master; see
- # https://bugs.llvm.org/show_bug.cgi?id=38233
- # for a bug report about this problem in llvm master.
- patch("llvm_py37.patch", when="@4:6 ^python@3.7:")
+ # Backport from llvm to fix issues related to Python 3.7
+ # see https://bugs.llvm.org/show_bug.cgi?id=38233
+ patch(
+ "https://github.com/llvm/llvm-project/commit/5457b426f5e15a29c0acc8af1a476132f8be2a36.patch?full_index=1",
+ sha256="7a1e4aa80760167807255c3e3121b1281bfcf532396b2d8fb3dce021f3f18758",
+ when="@4:6+python+lldb ^python@3.7:",
+ )
- # https://github.com/spack/spack/issues/19625,
- # merged in llvm-11.0.0_rc2, first available in 12.0.0
- patch("lldb_external_ncurses-10.patch", when="@10.0.0:11+lldb")
+ # fix building on SUSE (with panel.h being in /usr/include/ncurses/)
+ # see https://reviews.llvm.org/D85219
+ # see https://github.com/spack/spack/issues/19625
+ patch(
+ "https://github.com/llvm/llvm-project/commit/c952ec15d38843b69e22dfd7b0665304a0459f9f.patch?full_index=1",
+ sha256="66932ba31b5bf8808ea112e42cfd79b2480a4936e711771c06ce851eac429b2c",
+ when="@10:11+lldb",
+ )
- # https://github.com/spack/spack/issues/19908
- # merged in llvm main prior to 12.0.0
- patch("llvm_python_path.patch", when="@:11")
+ # honor Python2_EXECUTABLE and Python3_EXECUTABLE when they are passed to cmake
+ # see https://reviews.llvm.org/D91536
+ patch(
+ "https://github.com/llvm/llvm-project/commit/16de50895e96adbe261a5ce2498366bda7b3fccd.patch?full_index=1",
+ sha256="0e121ed460aa6e117f9f5f339d597a96c0fe4f97dc2209aba47b43ffc831ea24",
+ # The patch is applicable only starting version 7.0.0 (the older version might require a
+ # different patch addressing https://github.com/spack/spack/issues/19908). It looks like
+ # the patched function is used only if both compiler-rt and libcxx are enabled but we keep
+ # it simple:
+ when="@7:11",
+ )
# Workaround for issue https://github.com/spack/spack/issues/18197
patch("llvm7_intel.patch", when="@7 %intel@18.0.2,19.0.0:19.1.99")
# Remove cyclades support to build against newer kernel headers
# https://reviews.llvm.org/D102059
- patch("no_cyclades.patch", when="@10:12.0.0")
- patch("no_cyclades9.patch", when="@6:9")
-
- patch("llvm-gcc11.patch", when="@9:11%gcc@11:")
-
- # add -lpthread to build OpenMP libraries with Fujitsu compiler
- patch("llvm12-thread.patch", when="@12 %fj")
-
- # add -lpthread to build OpenMP libraries
- patch("llvm13-14-thread.patch", when="@13:14")
- patch("llvm15-thread.patch", when="@15")
+ patch(
+ "https://github.com/llvm/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab.patch?full_index=1",
+ sha256="742501723642675075e617f3c38339961b2c7b6fd8290dbffc52239ab0783317",
+ when="@10:12.0.0",
+ )
+ # The patch above is not applicable when "@:9" due to the file renaming and reformatting. The
+ # following patch is applicable starting at least version 5.0.0, the oldest we try to support.
+ patch("no_cyclades9.patch", when="@5:9")
+
+ with when("+libomptarget"):
+ # libomptarget makes use of multithreading via the standard C++ library (e.g.
+ # std::call_once), which, depending on the platform and the implementation of the standard
+ # library, might or might not require linking to libpthread (note that the failure might
+ # happen at the linking time as well as at the runtime). In some cases, the required linker
+ # flag comes as a transitive dependency (e.g. from the static LLVMSupport component). The
+ # following patches enforce linking to the thread library that is relevant for the system,
+ # which might lead to overlinking in some cases though.
+ # TODO: figure out why we do not use LLVM_PTHREAD_LIB but run find_package(Threads), at
+ # least for newer versions (the solution must work with both openmp=runtime and
+ # openmp=project)
+ patch("llvm12-thread.patch", when="@12")
+ patch("llvm13-14-thread.patch", when="@13:14")
+ patch("llvm15-thread.patch", when="@15")
# avoid build failed with Fujitsu compiler
patch("llvm13-fujitsu.patch", when="@13 %fj")
# patch for missing hwloc.h include for libompd
- patch("llvm14-hwloc-ompd.patch", when="@14")
-
- # make libflags a list in openmp subproject when ~omp_as_runtime
- patch("libomp-libflags-as-list.patch", when="@3.7:14")
+ # see https://reviews.llvm.org/D123888
+ patch(
+ "https://github.com/llvm/llvm-project/commit/91ccd8248c85385a5654c63c302a37d97f811bab.patch?full_index=1",
+ sha256="b216cff38659c176c5381e9dda3252edbb204e6f6f1f33e843a9ebcc42732e5d",
+ when="@14 openmp=runtime",
+ )
- # Add missing include leading to build fail with clang
+ # make libflags a list in openmp subproject when openmp=project
+ # see https://reviews.llvm.org/D125370
patch(
- "https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1.patch?full_index=1",
- sha256="514926d661635de47972c7d403c9c4669235aa51e22e56d44676d2a2709179b6",
- when="@8:11",
+ "https://github.com/llvm/llvm-project/commit/e27ce281399dca8b08b6ca593172a1bd5dbdd5c1.patch?full_index=1",
+ sha256="6f0cfa55e3ed17ee33346b0a5bca8092adcc1dc75ca712ab83901755fba9767e",
+ when="@3.7:14 openmp=project",
)
# fix detection of LLDB_PYTHON_EXE_RELATIVE_PATH
# see https://reviews.llvm.org/D133513
- # TODO: adjust version constraint and switch to fetching from the upstream GitHub repo
- # when/if the bugfix is merged
+ # TODO: the patch is not applicable after https://reviews.llvm.org/D141042 but it is not clear
+ # yet whether we need a version of it for when="@16:"
patch("D133513.diff", level=0, when="@14:15+lldb+python")
# Fix hwloc@:2.3 (Conditionally disable hwloc@2.0 and hwloc@2.4 code)
@@ -382,6 +523,14 @@ class Llvm(CMakePackage, CudaPackage):
when="@14:15",
)
+ # Fix false positive detection of a target when building compiler-rt as a runtime
+ # https://reviews.llvm.org/D127975
+ patch(
+ "https://github.com/llvm/llvm-project/commit/9f1d90bf91570efa124c4a86cd033de374d1049a.patch?full_index=1",
+ sha256="1f4287465b3e499911e039e6cc2f395b8cb00eb8a0a223fa0db3704ba77f9969",
+ when="@13:14 compiler-rt=runtime",
+ )
+
# The functions and attributes below implement external package
# detection for LLVM. See:
#
@@ -618,7 +767,7 @@ class Llvm(CMakePackage, CudaPackage):
),
]
)
- if "+omp_as_runtime" in spec:
+ if "openmp=runtime" in spec:
cmake_args.extend(
[
define("LIBOMPTARGET_NVPTX_ENABLE_BCLIB", True),
@@ -637,7 +786,7 @@ class Llvm(CMakePackage, CudaPackage):
]
)
- cmake_args.append(from_variant("LIBOMPTARGET_ENABLE_DEBUG", "omp_debug"))
+ cmake_args.append(from_variant("LIBOMPTARGET_ENABLE_DEBUG", "libomptarget_debug"))
if "+lldb" in spec:
projects.append("lldb")
@@ -663,9 +812,9 @@ class Llvm(CMakePackage, CudaPackage):
if "+clang" in spec:
projects.append("clang")
projects.append("clang-tools-extra")
- if "+omp_as_runtime" in spec:
+ if "openmp=runtime" in spec:
runtimes.append("openmp")
- else:
+ elif "openmp=project" in spec:
projects.append("openmp")
if "+libomptarget" in spec:
@@ -682,23 +831,20 @@ class Llvm(CMakePackage, CudaPackage):
projects.append("flang")
if "+lld" in spec:
projects.append("lld")
- if "+compiler-rt" in spec:
- if self.spec.satisfies("@15.0.0:"):
- runtimes.append("compiler-rt")
- else:
- projects.append("compiler-rt")
- if "+libcxx" in spec:
- if self.spec.satisfies("@15.0.0:"):
- runtimes.extend(["libcxx", "libcxxabi"])
- else:
- projects.extend(["libcxx", "libcxxabi"])
+ if "compiler-rt=runtime" in spec:
+ runtimes.append("compiler-rt")
+ elif "compiler-rt=project" in spec:
+ projects.append("compiler-rt")
+ if "libcxx=runtime" in spec:
+ runtimes.extend(["libcxx", "libcxxabi"])
+ elif "libcxx=project" in spec:
+ projects.extend(["libcxx", "libcxxabi"])
if "+mlir" in spec:
projects.append("mlir")
- if "+internal_unwind" in spec:
- if self.spec.satisfies("@15.0.0:"):
- runtimes.append("libunwind")
- else:
- projects.append("libunwind")
+ if "libunwind=runtime" in spec:
+ runtimes.append("libunwind")
+ elif "libunwind=project" in spec:
+ projects.append("libunwind")
if "+polly" in spec:
projects.append("polly")
cmake_args.append(define("LINK_POLLY_INTO_TOOLS", True))
@@ -718,7 +864,7 @@ class Llvm(CMakePackage, CudaPackage):
cmake_args.append(define("LLVM_TARGETS_TO_BUILD", get_llvm_targets_to_build(spec)))
- cmake_args.append(from_variant("LIBOMP_TSAN_SUPPORT", "omp_tsan"))
+ cmake_args.append(from_variant("LIBOMP_TSAN_SUPPORT", "libomp_tsan"))
if self.compiler.name == "gcc":
cmake_args.append(define("GCC_INSTALL_PREFIX", self.compiler.prefix))
@@ -746,7 +892,7 @@ class Llvm(CMakePackage, CudaPackage):
define = self.define
# unnecessary if we build openmp via LLVM_ENABLE_RUNTIMES
- if "+cuda ~omp_as_runtime" in self.spec:
+ if "+cuda openmp=project" in self.spec:
ompdir = "build-bootstrapped-omp"
prefix_paths = spack.build_environment.get_cmake_prefix_path(self)
prefix_paths.append(str(spec.prefix))