diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2022-10-12 14:38:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 14:38:57 +0200 |
commit | acd4787a1a9595c3799b7618ed70f982ea995e2b (patch) | |
tree | 432f66f9065e76921393a9413087e9fd20bc73a5 /var | |
parent | 4ee22e7cf790e7193944ef3dd1690ea77ffa3d01 (diff) | |
download | spack-acd4787a1a9595c3799b7618ed70f982ea995e2b.tar.gz spack-acd4787a1a9595c3799b7618ed70f982ea995e2b.tar.bz2 spack-acd4787a1a9595c3799b7618ed70f982ea995e2b.tar.xz spack-acd4787a1a9595c3799b7618ed70f982ea995e2b.zip |
oneapi: set -Wno-unused-command-line-argument (#33192)
For older versions of intel-oneapi-compilers, running the compiler in
preprocessor / compilation mode would trigger warnings that
`-Wl,-rpath,...` flags were unused.
This in turn caused certain configure scripts to fail as they did not
expect output from the compiler (it's treated as an error). Notably
cmake's bootstrap phase failed to detect c++ features of the compiler.
As a workaround, add this flag to silence the warning, since I don't
think we can scope the flags to compile+link mode.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py | 10 |
1 files changed, 10 insertions, 0 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 7f601fc3d1..df40c94f8a 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -197,6 +197,16 @@ class IntelOneapiCompilers(IntelOneApiPackage): # _ld_library_path because it looks like the only rpath that needs to be # injected is self.component_prefix.linux.compiler.lib.intel64_lin. flags_list = ["-Wl,-rpath,{}".format(d) for d in self._ld_library_path()] + + # Older versions trigger -Wunused-command-line-argument warnings whenever + # linker flags are passed in preprocessor (-E) or compilation mode (-c). + # The cfg flags are treated as command line flags apparently. Newer versions + # do not trigger these warnings. In some build systems these warnings can + # cause feature detection to fail, so we silence them with -Wno-unused-... + if self.spec.version < Version("2022.1.0"): + flags_list.append("-Wno-unused-command-line-argument") + + # 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 [ |