Skip to content
Snippets Groups Projects
Commit 177b7f11 authored by Denis Davydov's avatar Denis Davydov Committed by Gregory Lee
Browse files

intel: optionally take gcc executable from cflags (#11136)

parent 6b097819
Branches
Tags
No related merge requests found
...@@ -682,6 +682,19 @@ def openmp_libs(self): ...@@ -682,6 +682,19 @@ def openmp_libs(self):
debug_print(omp_libs) debug_print(omp_libs)
return omp_libs 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 @property
def tbb_libs(self): def tbb_libs(self):
'''Supply LibraryList for linking TBB''' '''Supply LibraryList for linking TBB'''
...@@ -693,7 +706,7 @@ def tbb_libs(self): ...@@ -693,7 +706,7 @@ def tbb_libs(self):
# option: "icpc -tbb" # option: "icpc -tbb"
# TODO: clang(?) # 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( cxx_lib_path = gcc(
'--print-file-name', 'libstdc++.%s' % dso_suffix, output=str) '--print-file-name', 'libstdc++.%s' % dso_suffix, output=str)
...@@ -704,8 +717,7 @@ def tbb_libs(self): ...@@ -704,8 +717,7 @@ def tbb_libs(self):
@property @property
def _tbb_abi(self): def _tbb_abi(self):
'''Select the ABI needed for linking TBB''' '''Select the ABI needed for linking TBB'''
# Match the available gcc, as it's done in tbbvars.sh. gcc = self._gcc_executable
gcc = Executable('gcc')
matches = re.search(r'(gcc|LLVM).* ([0-9]+\.[0-9]+\.[0-9]+).*', matches = re.search(r'(gcc|LLVM).* ([0-9]+\.[0-9]+\.[0-9]+).*',
gcc('--version', output=str), re.I | re.M) gcc('--version', output=str), re.I | re.M)
abi = '' abi = ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment