summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Sachs <stephenmsachs@gmail.com>2022-10-17 18:46:11 +0200
committerGitHub <noreply@github.com>2022-10-17 10:46:11 -0600
commit2e55812417398ea2fcb2f9e8d75cf7c86b9095d2 (patch)
tree51c23d2976764ebc6b3f7ff5dfe6bff4e4b5d1ee
parente7b14dd4911cee11b04c031cfc9ee096a1f5ea6f (diff)
downloadspack-2e55812417398ea2fcb2f9e8d75cf7c86b9095d2.tar.gz
spack-2e55812417398ea2fcb2f9e8d75cf7c86b9095d2.tar.bz2
spack-2e55812417398ea2fcb2f9e8d75cf7c86b9095d2.tar.xz
spack-2e55812417398ea2fcb2f9e8d75cf7c86b9095d2.zip
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>
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py41
1 files changed, 26 insertions, 15 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 df40c94f8a..0ad8d3921d 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py
@@ -131,7 +131,7 @@ class IntelOneapiCompilers(IntelOneApiPackage):
placement="fortran-installer",
when="@{0}".format(v["version"]),
expand=False,
- **v["ftn"]
+ **v["ftn"],
)
@property
@@ -206,21 +206,32 @@ class IntelOneapiCompilers(IntelOneApiPackage):
if self.spec.version < Version("2022.1.0"):
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
- flags_list.append("--gcc-toolchain={}".format(self.compiler.prefix))
- flags = " ".join(flags_list)
- for cmp in [
- "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)
+ write_cfg(
+ ["icx", "icpx", "ifx"],
+ flags_list + ["--gcc-toolchain={}".format(self.compiler.prefix)],
+ )
def _ld_library_path(self):
# Returns an iterable of directories that might contain shared runtime libraries