Tau must get GCC path from environment on Cray (#31751)

* Tau must get GCC path from environment on Cray

self.compiler doesn't provide the path to the gcc compiler when using cray cc and the spack internal compiler overrides the location in PATH. If possible get the location from the GCC_PATH variable instead.

* Fix flake8 issues

* Update package.py
This commit is contained in:
wspear 2022-07-27 10:04:06 -07:00 committed by GitHub
parent 3db87f207e
commit 02151565e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,10 +146,16 @@ def set_compiler_options(self, spec):
# 4 - if no -cc=<compiler> -cxx=<compiler> is passed tau is built with
# system compiler silently
# (regardless of what %<compiler> is used in the spec)
# 5 - On cray gnu compilers are not provied by self.compilers
# Checking GCC_PATH will work if spack loads the gcc module
#
# In the following we give TAU what he expects and put compilers into
# PATH
compiler_path = os.path.dirname(self.compiler.cc)
if not compiler_path and self.compiler.cc_names[0] == "gcc":
compiler_path = os.environ.get('GCC_PATH', '')
if compiler_path:
compiler_path = compiler_path + "/bin/"
os.environ['PATH'] = ':'.join([compiler_path, os.environ['PATH']])
compiler_options = ['-c++=%s' % self.compiler.cxx_names[0],