diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-04-03 14:18:47 +0200 |
---|---|---|
committer | Harmen Stoppels <harmenstoppels@gmail.com> | 2024-04-22 15:18:06 +0200 |
commit | 34146c197a6addcfda45c54d72d0ddb6871d392c (patch) | |
tree | 680e74eb55a2224c42a565dd19539ae1d41b5b13 /var | |
parent | 209a3bf3026f9d75262dd1e92c04008876b4fbae (diff) | |
download | spack-34146c197a6addcfda45c54d72d0ddb6871d392c.tar.gz spack-34146c197a6addcfda45c54d72d0ddb6871d392c.tar.bz2 spack-34146c197a6addcfda45c54d72d0ddb6871d392c.tar.xz spack-34146c197a6addcfda45c54d72d0ddb6871d392c.zip |
Add libc dependency to compiled packages and runtime deps
This commit differentiate linux from other platforms by
using libc compatibility as a criterion for deciding
which buildcaches / binaries can be reused. Other
platforms still use OS compatibility.
On linux a libc is injected by all compilers as an implicit
external, and the compatibility criterion is that a libc is
compatible with all other libcs with the same name and a
version that is lesser or equal.
Some concretization unit tests use libc when run on linux.
Diffstat (limited to 'var')
13 files changed, 30 insertions, 44 deletions
diff --git a/var/spack/repos/builtin.mock/packages/glibc/package.py b/var/spack/repos/builtin.mock/packages/glibc/package.py new file mode 100644 index 0000000000..17c5087dc7 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/glibc/package.py @@ -0,0 +1,21 @@ +# 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) +from spack.package import * + + +class Glibc(AutotoolsPackage, GNUMirrorPackage): + """The GNU C Library provides many of the low-level components used + directly by programs written in the C or C++ languages. + """ + + homepage = "https://www.gnu.org/software/libc/" + gnu_mirror_path = "libc/glibc-2.33.tar.gz" + git = "https://sourceware.org/git/glibc.git" + + tags = ["runtime"] + + provides("libc") + + version("2.39", sha256="97f84f3b7588cd54093a6f6389b0c1a81e70d99708d74963a2e3eab7c7dc942d") diff --git a/var/spack/repos/builtin/packages/aocc/package.py b/var/spack/repos/builtin/packages/aocc/package.py index 7129cd8697..f51b5d6795 100644 --- a/var/spack/repos/builtin/packages/aocc/package.py +++ b/var/spack/repos/builtin/packages/aocc/package.py @@ -28,7 +28,6 @@ class Aocc(Package): """ _name = "aocc" - family = "compiler" homepage = "https://www.amd.com/en/developer/aocc.html" maintainers("amd-toolchain-support") diff --git a/var/spack/repos/builtin/packages/gcc-runtime/package.py b/var/spack/repos/builtin/packages/gcc-runtime/package.py index d883085cc9..659327b763 100644 --- a/var/spack/repos/builtin/packages/gcc-runtime/package.py +++ b/var/spack/repos/builtin/packages/gcc-runtime/package.py @@ -53,6 +53,8 @@ class GccRuntime(Package): provides("libgfortran@4", when="%gcc@7") provides("libgfortran@5", when="%gcc@8:") + depends_on("libc", type="link") + def install(self, spec, prefix): if spec.platform in ["linux", "cray", "freebsd"]: libraries = get_elf_libraries(compiler=self.compiler, libraries=self.LIBRARIES) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 91f5358b0c..f9ff5b9fbe 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -1185,13 +1185,5 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): description=f"Add a dependency on '{gfortran_str}' for nodes compiled with " f"{str(spec)} and using the 'fortran' language", ) - - libc = compiler.default_libc() - - if libc: - pkg("*").depends_on( - str(libc), when=f"%{str(compiler.spec)}", type="link", description="Add libc" - ) - # The version of gcc-runtime is the same as the %gcc used to "compile" it pkg("gcc-runtime").requires(f"@={str(spec.version)}", when=f"%{str(spec)}") diff --git a/var/spack/repos/builtin/packages/glibc/package.py b/var/spack/repos/builtin/packages/glibc/package.py index d878244f87..16315c4bbc 100644 --- a/var/spack/repos/builtin/packages/glibc/package.py +++ b/var/spack/repos/builtin/packages/glibc/package.py @@ -198,3 +198,7 @@ class Glibc(AutotoolsPackage, GNUMirrorPackage): make("-C", "..", f"objdir={os.getcwd()}", "lib") delete_rpath(join_path("elf", "ld.so")) make() + + @property + def libs(self): + return LibraryList([]) diff --git a/var/spack/repos/builtin/packages/intel-llvm/package.py b/var/spack/repos/builtin/packages/intel-llvm/package.py index 630e2df996..ea9dd94650 100644 --- a/var/spack/repos/builtin/packages/intel-llvm/package.py +++ b/var/spack/repos/builtin/packages/intel-llvm/package.py @@ -14,8 +14,6 @@ class IntelLlvm(CMakePackage): homepage = "https://github.com/intel/llvm" git = "https://github.com/intel/llvm.git" - family = "compiler" - license("Apache-2.0") version("sycl", branch="sycl") diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index cce9869e85..f52a68a9c6 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -422,5 +422,5 @@ class IntelOneapiCompilers(IntelOneApiPackage): description=f"Add a dependency on 'libifcore' for nodes compiled with " f"{str(spec)} and using the 'fortran' language", ) - # The version of gcc-runtime is the same as the %gcc used to "compile" it + # The version of intel-oneapi-runtime is the same as the %oneapi used to "compile" it pkg("intel-oneapi-runtime").requires(f"@={str(spec.version)}", when=f"%{str(spec)}") diff --git a/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py b/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py index 67361000c5..c4a21a71c3 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py @@ -44,6 +44,8 @@ class IntelOneapiRuntime(Package): conflicts("platform=windows", msg="IntelOneAPI can only be installed on Linux, and FreeBSD") conflicts("platform=darwin", msg="IntelOneAPI can only be installed on Linux, and FreeBSD") + depends_on("libc", type="link") + def install(self, spec, prefix): libraries = get_elf_libraries(compiler=self.compiler, libraries=self.LIBRARIES) mkdir(prefix.lib) diff --git a/var/spack/repos/builtin/packages/libc/package.py b/var/spack/repos/builtin/packages/libc/package.py deleted file mode 100644 index 2a1f13739b..0000000000 --- a/var/spack/repos/builtin/packages/libc/package.py +++ /dev/null @@ -1,24 +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) - -from spack.package import * - - -class Libc(BundlePackage): - """Dummy package to provide interfaces available in libc.""" - - homepage = "https://en.wikipedia.org/wiki/C_standard_library" - - version("1.0") # Dummy - - variant("iconv", default=False, description="Provides interfaces for Localization Functions") - variant("rpc", default=False, description="Provides interfaces for RPC") - - provides("iconv", when="+iconv") - provides("rpc", when="+rpc") - - @property - def libs(self): - return LibraryList([]) diff --git a/var/spack/repos/builtin/packages/llvm-doe/package.py b/var/spack/repos/builtin/packages/llvm-doe/package.py index 8402e0c743..a0d2af411e 100644 --- a/var/spack/repos/builtin/packages/llvm-doe/package.py +++ b/var/spack/repos/builtin/packages/llvm-doe/package.py @@ -28,8 +28,6 @@ class LlvmDoe(CMakePackage, CudaPackage): generator("ninja") - family = "compiler" # Used by lmod - version("doe", branch="doe", preferred=True) version("upstream", branch="llvm.org/main") version("bolt", branch="bolt/main") diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 2e8e1cce48..ae907cd50d 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -32,8 +32,6 @@ class Llvm(CMakePackage, CudaPackage): generator("ninja") - family = "compiler" # Used by lmod - license("Apache-2.0") version("main", branch="main") diff --git a/var/spack/repos/builtin/packages/sollve/package.py b/var/spack/repos/builtin/packages/sollve/package.py index 3cb3e5cd7e..fcfe622eed 100644 --- a/var/spack/repos/builtin/packages/sollve/package.py +++ b/var/spack/repos/builtin/packages/sollve/package.py @@ -16,8 +16,6 @@ class Sollve(CMakePackage): homepage = "https://www.bnl.gov/compsci/projects/SOLLVE/" git = "https://github.com/SOLLVE/llvm.git" - family = "compiler" # Used by lmod - # NOTE: The debug version of LLVM is an order of magnitude larger than # the release version, and may take up 20-30 GB of space. If you want # to save space, build with `build_type=Release`. diff --git a/var/spack/repos/builtin/packages/templight/package.py b/var/spack/repos/builtin/packages/templight/package.py index 76df5f2bed..2dc5b50a85 100644 --- a/var/spack/repos/builtin/packages/templight/package.py +++ b/var/spack/repos/builtin/packages/templight/package.py @@ -18,8 +18,6 @@ class Templight(CMakePackage): git = "https://github.com/mikael-s-persson/templight.git" llvm_svn = "http://llvm.org/svn/llvm-project/{0}/trunk" - family = "compiler" # Used by lmod - # Templight is a patch to clang, so we have three versions to care about: # - The one that will be used in Spack specifications # - The git branch that we need to fetch from in the templight repo |