Classic Intel compilers do not support gcc-toolchain (#33281)
* Classic Intel compilers do not support gcc-toolchain This fix removes `--gcc-toolchain=` from the ~.fcg` files for the classic Intel compilers. AFAIK this option is only supported for Clang based compilers. This lead to an issue when installing cmake. Reproducer: ``` spack install cmake@3.24.2%intel@2021.7.0~doc+ncurses+ownlibs~qt build_type=Release arch=linux-amzn2-skylake_avx512 ``` Tagging maintainer @rscohn2 * Add `-gcc-name` for icc .. and `-gxx-name` for icpc. AFAIK this is used for modern C++ support, so we can ignore `ifort`. Co-authored-by: Stephen Sachs <stesachs@amazon.com>
This commit is contained in:
parent
e7b14dd491
commit
2e55812417
@ -131,7 +131,7 @@ class IntelOneapiCompilers(IntelOneApiPackage):
|
|||||||
placement="fortran-installer",
|
placement="fortran-installer",
|
||||||
when="@{0}".format(v["version"]),
|
when="@{0}".format(v["version"]),
|
||||||
expand=False,
|
expand=False,
|
||||||
**v["ftn"]
|
**v["ftn"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -206,21 +206,32 @@ def extend_config_flags(self):
|
|||||||
if self.spec.version < Version("2022.1.0"):
|
if self.spec.version < Version("2022.1.0"):
|
||||||
flags_list.append("-Wno-unused-command-line-argument")
|
flags_list.append("-Wno-unused-command-line-argument")
|
||||||
|
|
||||||
|
def write_cfg(cmp_list, flags_list):
|
||||||
|
flags = " ".join(flags_list)
|
||||||
|
for cmp in cmp_list:
|
||||||
|
cfg_file = self.component_prefix.linux.bin.join(cmp + ".cfg")
|
||||||
|
with open(cfg_file, "w") as f:
|
||||||
|
f.write(flags)
|
||||||
|
set_install_permissions(cfg_file)
|
||||||
|
|
||||||
|
# Make sure that icc gets the right GCC C+ support
|
||||||
|
write_cfg(
|
||||||
|
[
|
||||||
|
join_path("intel64", "icc"),
|
||||||
|
],
|
||||||
|
flags_list + ["-gcc-name={}".format(self.compiler.cc)],
|
||||||
|
)
|
||||||
|
write_cfg(
|
||||||
|
[
|
||||||
|
join_path("intel64", "icpc"),
|
||||||
|
],
|
||||||
|
flags_list + ["-gxx-name={}".format(self.compiler.cxx)],
|
||||||
|
)
|
||||||
# Make sure that underlying clang gets the right GCC toolchain by default
|
# Make sure that underlying clang gets the right GCC toolchain by default
|
||||||
flags_list.append("--gcc-toolchain={}".format(self.compiler.prefix))
|
write_cfg(
|
||||||
flags = " ".join(flags_list)
|
["icx", "icpx", "ifx"],
|
||||||
for cmp in [
|
flags_list + ["--gcc-toolchain={}".format(self.compiler.prefix)],
|
||||||
"icx",
|
)
|
||||||
"icpx",
|
|
||||||
"ifx",
|
|
||||||
join_path("intel64", "icc"),
|
|
||||||
join_path("intel64", "icpc"),
|
|
||||||
join_path("intel64", "ifort"),
|
|
||||||
]:
|
|
||||||
cfg_file = self.component_prefix.linux.bin.join(cmp + ".cfg")
|
|
||||||
with open(cfg_file, "w") as f:
|
|
||||||
f.write(flags)
|
|
||||||
set_install_permissions(cfg_file)
|
|
||||||
|
|
||||||
def _ld_library_path(self):
|
def _ld_library_path(self):
|
||||||
# Returns an iterable of directories that might contain shared runtime libraries
|
# Returns an iterable of directories that might contain shared runtime libraries
|
||||||
|
Loading…
Reference in New Issue
Block a user