intel-oneapi-compilers 2023.2.3: added new version to dpcpp package (#41680)

* add new cpp compiler version

* empty ftn for 2023.2.3

* OLD ftn in 2023.2.3 version

* tolerate missing fortran compiler

---------

Co-authored-by: Robert Cohn <robert.s.cohn@intel.com>
This commit is contained in:
Andrey Perestoronin 2023-12-14 18:03:18 +00:00 committed by GitHub
parent 0dc3fc2d21
commit 330a9a7c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 *
@ -29,6 +31,13 @@
"sha256": "57faf854b8388547ee4ef2db387a9f6f3b4d0cebd67b765cf5e844a0a970d1f9",
},
},
{
"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": {
@ -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 @@ def install(self, spec, prefix):
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 @@ def inject_rpaths(self):
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 @@ def extend_config_flags(self):
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