From 02151565e919fc7c1d17a99924e729f897d5bce9 Mon Sep 17 00:00:00 2001 From: wspear Date: Wed, 27 Jul 2022 10:04:06 -0700 Subject: 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 --- var/spack/repos/builtin/packages/tau/package.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py index a1069a1517..6a45739df4 100644 --- a/var/spack/repos/builtin/packages/tau/package.py +++ b/var/spack/repos/builtin/packages/tau/package.py @@ -146,10 +146,16 @@ class Tau(Package): # 4 - if no -cc= -cxx= is passed tau is built with # system compiler silently # (regardless of what % 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], -- cgit v1.2.3-70-g09d2