diff options
author | Denis Davydov <davydden@gmail.com> | 2019-04-11 21:33:59 +0200 |
---|---|---|
committer | Gregory Lee <lee218@llnl.gov> | 2019-04-11 12:33:59 -0700 |
commit | 177b7f111a68ef179b36a33aefa9dab627878585 (patch) | |
tree | cf8f2343adca3d5f7a5151ab3ef4dc2b7f801978 /lib | |
parent | 6b09781936592512bceda1ecf07753dedbe6a1a9 (diff) | |
download | spack-177b7f111a68ef179b36a33aefa9dab627878585.tar.gz spack-177b7f111a68ef179b36a33aefa9dab627878585.tar.bz2 spack-177b7f111a68ef179b36a33aefa9dab627878585.tar.xz spack-177b7f111a68ef179b36a33aefa9dab627878585.zip |
intel: optionally take gcc executable from cflags (#11136)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_systems/intel.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/spack/spack/build_systems/intel.py b/lib/spack/spack/build_systems/intel.py index 7882d55f87..152e5eec16 100644 --- a/lib/spack/spack/build_systems/intel.py +++ b/lib/spack/spack/build_systems/intel.py @@ -683,6 +683,19 @@ class IntelPackage(PackageBase): return omp_libs @property + def _gcc_executable(self): + '''Return GCC executable''' + # Match the available gcc, as it's done in tbbvars.sh. + gcc_name = 'gcc' + # but first check if -gcc-name is specified in cflags + for flag in self.spec.compiler_flags['cflags']: + if flag.startswith('-gcc-name='): + gcc_name = flag.split('-gcc-name=')[1] + break + debug_print(gcc_name) + return Executable(gcc_name) + + @property def tbb_libs(self): '''Supply LibraryList for linking TBB''' @@ -693,7 +706,7 @@ class IntelPackage(PackageBase): # option: "icpc -tbb" # TODO: clang(?) - gcc = Executable('gcc') # must be gcc, not self.compiler.cc + gcc = self._gcc_executable # must be gcc, not self.compiler.cc cxx_lib_path = gcc( '--print-file-name', 'libstdc++.%s' % dso_suffix, output=str) @@ -704,8 +717,7 @@ class IntelPackage(PackageBase): @property def _tbb_abi(self): '''Select the ABI needed for linking TBB''' - # Match the available gcc, as it's done in tbbvars.sh. - gcc = Executable('gcc') + gcc = self._gcc_executable matches = re.search(r'(gcc|LLVM).* ([0-9]+\.[0-9]+\.[0-9]+).*', gcc('--version', output=str), re.I | re.M) abi = '' |