diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py | 52 |
1 files changed, 32 insertions, 20 deletions
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 71cd517fc5..e409a975d8 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.build_environment import dso_suffix from spack.package import * @@ -30,6 +32,13 @@ versions = [ }, }, { + "version": "2023.2.3", + "cpp": { + "url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d85fbeee-44ec-480a-ba2f-13831bac75f7/l_dpcpp-cpp-compiler_p_2023.2.3.12_offline.sh", + "sha256": "b80119a3e54306b85198e907589b00b11c072f107ac39c1686a1996f76466b26", + }, + }, + { "version": "2023.2.1", "cpp": { "url": "https://registrationcenter-download.intel.com/akdlm//IRC_NAS/ebf5d9aa-17a7-46a4-b5df-ace004227c0e/l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh", @@ -196,13 +205,14 @@ class IntelOneapiCompilers(IntelOneApiPackage): for v in versions: version(v["version"], expand=False, **v["cpp"]) - resource( - name="fortran-installer", - placement="fortran-installer", - when="@{0}".format(v["version"]), - expand=False, - **v["ftn"], - ) + if "ftn" in v: + resource( + name="fortran-installer", + placement="fortran-installer", + when="@{0}".format(v["version"]), + expand=False, + **v["ftn"], + ) @property def v2_layout_versions(self): @@ -255,11 +265,13 @@ class IntelOneapiCompilers(IntelOneApiPackage): super().install(spec, prefix) # install fortran - self.install_component(find("fortran-installer", "*")[0]) + ftn = find("fortran-installer", "*") + if ftn: + self.install_component(ftn[0]) - # Some installers have a bug and do not return an error code when failing - if not is_exe(self._llvm_bin.ifx): - raise RuntimeError("Fortran install failed") + # Some installers have a bug and do not return an error code when failing + if not is_exe(self._llvm_bin.ifx): + raise RuntimeError("Fortran install failed") @run_after("install") def inject_rpaths(self): @@ -289,10 +301,14 @@ class IntelOneapiCompilers(IntelOneApiPackage): def write_config_file(self, flags, path, compilers): for compiler in compilers: - p = path.join(compiler + ".cfg") - with open(p, "w") as f: - f.write(" ".join(flags)) - set_install_permissions(p) + # Tolerate missing compilers. + # Initially, we installed icx/ifx/icc/ifort into a single prefix. + # Starting in 2024, there is no icc. 2023.2.3 does not have an ifx. + if os.path.exists(compiler): + p = path.join(compiler + ".cfg") + with open(p, "w") as f: + f.write(" ".join(flags)) + set_install_permissions(p) @run_after("install") def extend_config_flags(self): @@ -329,11 +345,7 @@ class IntelOneapiCompilers(IntelOneApiPackage): self.write_config_file(common_flags + llvm_flags, self._llvm_bin, ["icx", "icpx"]) self.write_config_file(common_flags + classic_flags, self._llvm_bin, ["ifx"]) self.write_config_file(common_flags + classic_flags, self._classic_bin, ["ifort"]) - # 2023 is the last release that includes icc - if self.spec.satisfies("@:2023"): - self.write_config_file( - common_flags + classic_flags, self._classic_bin, ["icc", "icpc"] - ) + self.write_config_file(common_flags + classic_flags, self._classic_bin, ["icc", "icpc"]) def _ld_library_path(self): # Returns an iterable of directories that might contain shared runtime libraries |