summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorwspear <wjspear@gmail.com>2020-03-17 08:38:53 -0700
committerGitHub <noreply@github.com>2020-03-17 08:38:53 -0700
commit304f0e9ef1f0e811225d4cf5cce957d4431bb734 (patch)
treecc59463c8cfdbed830ab518e9b4a8f81860e162c /var
parentc2e0ee63830c17493c9d025fa46251b806b0323f (diff)
downloadspack-304f0e9ef1f0e811225d4cf5cce957d4431bb734.tar.gz
spack-304f0e9ef1f0e811225d4cf5cce957d4431bb734.tar.bz2
spack-304f0e9ef1f0e811225d4cf5cce957d4431bb734.tar.xz
spack-304f0e9ef1f0e811225d4cf5cce957d4431bb734.zip
Corrected compiler filtering for TAU makefiles (#15342)
* Implemented working file filtering to replace spack compiler wrapper with real compiler. * Using string=True instead of re.escape. Using self.prefix.lib instead of appending /lib. Co-authored-by: Wyatt Spear <wspear@cs.uoregon.edu>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/tau/package.py22
1 files changed, 20 insertions, 2 deletions
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 @@ class Tau(Package):
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 @@ class Tau(Package):
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)