From 1baf712b8704880151de54c9961783b786aac972 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Thu, 9 Nov 2023 01:40:12 -0600 Subject: [PATCH] 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] --- .../builtin/packages/intel-oneapi-mkl/package.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py index 2eef32fa14..1d80c52f62 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py @@ -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"):