intel-oneapi-mkl: do not set __INTEL_POST_CFLAGS env variable (#40947)

This triggers warnings from icx compiler - that breaks petsc configure

$ I_MPI_CC=icx /opt/intel/oneapi/mpi/2021.7.0/bin/mpiicc -E a.c > /dev/null
$ __INTEL_POST_CFLAGS=-Wl,-rpath,/opt/intel/oneapi/mkl/2022.2.0/lib/intel64 I_MPI_CC=icx /opt/intel/oneapi/mpi/2021.7.0/bin/mpiicc -E a.c > /dev/null
icx: warning: -Wl,-rpath,/opt/intel/oneapi/mkl/2022.2.0/lib/intel64: 'linker' input unused [-Wunused-command-line-argument]
This commit is contained in:
Satish Balay 2023-11-09 01:40:12 -06:00 committed by GitHub
parent 26d6bfbb7f
commit 78449ba92b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,21 +149,6 @@ def libs(self):
else:
return IntelOneApiStaticLibraryList(libs, system_libs)
def setup_run_environment(self, env):
super().setup_run_environment(env)
# Support RPATH injection to the library directories when the '-mkl' or '-qmkl'
# flag of the Intel compilers are used outside the Spack build environment. We
# should not try to take care of other compilers because the users have to
# provide the linker flags anyway and are expected to take care of the RPATHs
# flags too. We prefer the __INTEL_POST_CFLAGS/__INTEL_POST_FFLAGS flags over
# the PRE ones so that any other RPATHs provided by the users on the command
# line come before and take precedence over the ones we inject here.
for d in self._find_mkl_libs(self.spec.satisfies("+shared")).directories:
flag = "-Wl,-rpath,{0}".format(d)
env.append_path("__INTEL_POST_CFLAGS", flag, separator=" ")
env.append_path("__INTEL_POST_FFLAGS", flag, separator=" ")
def setup_dependent_build_environment(self, env, dependent_spec):
# Only if environment modifications are desired (default is +envmods)
if self.spec.satisfies("+envmods"):