diff options
author | Greg Becker <becker33@llnl.gov> | 2022-11-07 21:50:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 21:50:16 -0800 |
commit | c9561c5a0e962a7c17eb961d21bfd4f7728e656b (patch) | |
tree | cb58d0eb0c5430e8f7db88f07cd0e5ac4cabe156 /var/spack/repos/builtin.mock | |
parent | f099a68e65f3db5f33cb73b9ab9b798b37f4e4cf (diff) | |
download | spack-c9561c5a0e962a7c17eb961d21bfd4f7728e656b.tar.gz spack-c9561c5a0e962a7c17eb961d21bfd4f7728e656b.tar.bz2 spack-c9561c5a0e962a7c17eb961d21bfd4f7728e656b.tar.xz spack-c9561c5a0e962a7c17eb961d21bfd4f7728e656b.zip |
intel oneapi classic bootstrapping (#31285)
The `intel` compiler at versions > 20 is provided by the `intel-oneapi-compilers-classic`
package (a thin wrapper around the `intel-oneapi-compilers` package), and the `oneapi`
compiler is provided by the `intel-oneapi-compilers` package.
Prior to this work, neither of these compilers could be bootstrapped by Spack as part of
an install with `install_missing_compilers: True`.
Changes made to make these two packages bootstrappable:
1. The `intel-oneapi-compilers-classic` package includes a bin directory and symlinks
to the compiler executables, not just logical pointers in Spack.
2. Spack can look for bootstrapped compilers in directories other than `$prefix/bin`,
defined on a per-package basis
3. `intel-oneapi-compilers` specifies a non-default search directory for the
compiler executables.
4. The `spack.compilers` module now can make more advanced associations between
packages and compilers, not just simple name translations
5. Spack support for lmod hierarchies accounts for differences between package
names and the associated compiler names for `intel-oneapi-compilers/oneapi`,
`intel-oneapi-compilers-classic/intel@20:`, `llvm+clang/clang`, and
`llvm-amdgpu/rocmcc`.
- [x] full end-to-end testing
- [x] add unit tests
Diffstat (limited to 'var/spack/repos/builtin.mock')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/intel-oneapi-compilers/package.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin.mock/packages/intel-oneapi-compilers/package.py new file mode 100644 index 0000000000..3ab49f1e1c --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/intel-oneapi-compilers/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2022 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 IntelOneapiCompilers(Package): + """Simple compiler package.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/oneapi-1.0.tar.gz" + + version("1.0", "0123456789abcdef0123456789abcdef") + version("2.0", "abcdef0123456789abcdef0123456789") + version("3.0", "def0123456789abcdef0123456789abc") + + @property + def compiler_search_prefix(self): + return self.prefix.foo.bar.baz.bin + + def install(self, spec, prefix): + # Create the minimal compiler that will fool `spack compiler find` + mkdirp(self.compiler_search_prefix) + with open(self.compiler_search_prefix.icx, "w") as f: + f.write('#!/bin/bash\necho "oneAPI DPC++ Compiler %s"' % str(spec.version)) + set_executable(self.compiler_search_prefix.icx) |