summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRobert Underwood <robertu94@users.noreply.github.com>2021-04-27 23:12:01 -0400
committerGitHub <noreply@github.com>2021-04-27 20:12:01 -0700
commit159d3b3381ce1e391be13fb6be384fcf186f1ee6 (patch)
tree6f13ec1fa7135d9efd3e7fb6d72f9e7143591107 /var
parentb23b126013e0579b7a524dcd442f57f4be32480d (diff)
downloadspack-159d3b3381ce1e391be13fb6be384fcf186f1ee6.tar.gz
spack-159d3b3381ce1e391be13fb6be384fcf186f1ee6.tar.bz2
spack-159d3b3381ce1e391be13fb6be384fcf186f1ee6.tar.xz
spack-159d3b3381ce1e391be13fb6be384fcf186f1ee6.zip
[tau]: Use compiler name instead of basename (#23247)
Previously the tau package got the cxx and cc names from os.path.basename(self.compiler.cxx), however if the path to the compiler looks like "/usr/bin/g++-10.2.0" then tau's custom build system doesn't recognize it. What we want instead is something that looks like "g++" which is exactly what cxx_names[0] gives us. We already did this for fortran, so I am not sure why we didn't do it here. Not doing this causes a build failure when tau tries to use a polyfill (vector.h, iostream.h) that doesn't seem to be packaged with tau. Additionally, tau needs some help finding mpi include directories when building with MPI, so we provide them. Unfortunately, we can't just say that the compilers are mpicc and mpicxx in the previous fix to have these things found automatically. This is because tau assumes we always need the polyfill when the compilers are set to these values which again causes a build failure.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/tau/package.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py
index 75889c9d51..99fd0e6fd8 100644
--- a/var/spack/repos/builtin/packages/tau/package.py
+++ b/var/spack/repos/builtin/packages/tau/package.py
@@ -135,8 +135,8 @@ class Tau(Package):
compiler_path = os.path.dirname(self.compiler.cc)
os.environ['PATH'] = ':'.join([compiler_path, os.environ['PATH']])
- compiler_options = ['-c++=%s' % os.path.basename(self.compiler.cxx),
- '-cc=%s' % os.path.basename(self.compiler.cc)]
+ compiler_options = ['-c++=%s' % self.compiler.cxx_names[0],
+ '-cc=%s' % self.compiler.cc_names[0]]
if '+fortran' in spec and self.compiler.fc:
compiler_options.append('-fortran=%s' % self.compiler.fc_names[0])
@@ -224,6 +224,8 @@ class Tau(Package):
env['CXX'] = spec['mpi'].mpicxx
env['F77'] = spec['mpi'].mpif77
env['FC'] = spec['mpi'].mpifc
+ options.append("-mpiinc=%s" % spec['mpi'].prefix.include)
+ options.append("-mpilib=%s" % spec['mpi'].prefix.lib)
options.append('-mpi')
if '+comm' in spec: