diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py index f17b8202d2..4ac71b793f 100644 --- a/var/spack/repos/builtin/packages/tau/package.py +++ b/var/spack/repos/builtin/packages/tau/package.py @@ -104,8 +104,6 @@ class Tau(Package): conflicts('+adios2', when='@:2.29.1') conflicts('+sqlite', when='@:2.29.1') - filter_compiler_wrappers('tau_cc.sh', 'Makefile.tau', relative_root='bin') - def set_compiler_options(self, spec): useropt = ["-O2 -g", self.rpath_args] @@ -271,11 +269,15 @@ def install(self, spec, prefix): compiler_specific_options = self.set_compiler_options(spec) options.extend(compiler_specific_options) configure(*options) + make("install") # Link arch-specific directories into prefix since there is # only one arch per prefix the way spack installs. self.link_tau_arch_dirs() + # TAU may capture Spack's internal compiler wrapper. Replace + # it with the correct compiler. + self.fix_tau_compilers() def link_tau_arch_dirs(self): for subdir in os.listdir(self.prefix): @@ -285,6 +287,22 @@ def link_tau_arch_dirs(self): if os.path.isdir(src) and not os.path.exists(dest): os.symlink(join_path(subdir, d), dest) + def fix_tau_compilers(self): + filter_file('FULL_CC=' + spack_cc, 'FULL_CC=' + self.compiler.cc, + self.prefix + '/include/Makefile', backup=False, + string=True) + filter_file('FULL_CXX=' + spack_cxx, 'FULL_CXX=' + + self.compiler.cxx, self.prefix + '/include/Makefile', + backup=False, string=True) + for makefile in os.listdir(self.prefix.lib): + if makefile.startswith('Makefile.tau'): + filter_file('FULL_CC=' + spack_cc, 'FULL_CC=' + + self.compiler.cc, self.prefix.lib + "/" + + makefile, backup=False, string=True) + filter_file('FULL_CXX=' + spack_cxx, 'FULL_CXX=' + + self.compiler.cxx, self.prefix.lib + + "/" + makefile, backup=False, string=True) + def setup_run_environment(self, env): pattern = join_path(self.prefix.lib, 'Makefile.*') files = glob.glob(pattern)